w-web-sso 1.1.7 → 1.1.8
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/w-web-sso.umd.js +5 -5
- package/dist/w-web-sso.umd.js.map +1 -1
- package/docs/WWebSso.html +1 -1
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/docs/server_WWebSso.mjs.html +1 -1
- package/docs/server_lockSave.mjs.html +1 -1
- package/docs/src_components_Common_CheckYesNo.vue.html +1 -1
- package/docs/src_fetchSsoMsg.mjs.html +1 -1
- package/docs/src_httpGetJson.mjs.html +1 -1
- package/docs/src_maskUrl.mjs.html +1 -1
- package/docs/src_plugins_submitGuard.mjs.html +1 -1
- package/package.json +12 -12
package/dist/w-web-sso.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* w-web-sso v1.1.
|
|
2
|
+
* w-web-sso v1.1.8
|
|
3
3
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("path"),require("fs"),require("@hapi/hapi"),require("@hapi/inert"),require("stream"),require("http"),require("worker_threads"),require("url"),require("pino"),require("node:events"),require("node:net"),require("node:url"),require("node:util"),require("node:fs"),require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:dns"),require("node:os"),require("node:path"),require("node:crypto"),require("node:tls"),require("node:child_process"),require("crypto"),require("readline")):"function"==typeof define&&define.amd?define(["path","fs","@hapi/hapi","@hapi/inert","stream","http","worker_threads","url","pino","node:events","node:net","node:url","node:util","node:fs","node:http","node:https","node:zlib","node:stream","node:dns","node:os","node:path","node:crypto","node:tls","node:child_process","crypto","readline"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-web-sso"]=t(e.path,e.fs,e["@hapi/hapi"],e["@hapi/inert"],e.stream,e.http,e.require$$0$1,e.url,e.pino,e.require$$0$6,e.require$$0$2,e.require$$1,e.require$$1$2,e.require$$2,e.require$$0$3,e.require$$1$1,e.require$$3,e.require$$0$4,e.require$$6,e.require$$8,e.require$$0$5,e.require$$2$1,e.require$$1$3,e.require$$0$7,e.crypto$1,e.readline)}(this,function(e,t,i,n,s,r,o,a,c,l,u,p,d,m,h,f,g,w,M,y,D,x,L,v,I,b){"use strict";var C="undefined"!=typeof document?document.currentScript:null,E=Array.isArray,T="object"==typeof global&&global&&global.Object===Object&&global,A="object"==typeof self&&self&&self.Object===Object&&self,S=T||A||Function("return this")(),N=S.Symbol,k=Object.prototype,j=k.hasOwnProperty,Z=k.toString,z=N?N.toStringTag:void 0;var Y=Object.prototype.toString;var X=N?N.toStringTag:void 0;function F(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":X&&X in Object(e)?function(e){var t=j.call(e,z),i=e[z];try{e[z]=void 0;var n=!0}catch(e){}var s=Z.call(e);return n&&(t?e[z]=i:delete e[z]),s}(e):function(e){return Y.call(e)}(e)}function U(e){return null!=e&&"object"==typeof e}function G(e){return"symbol"==typeof e||U(e)&&"[object Symbol]"==F(e)}var P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/;function O(e,t){if(E(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!G(e))||(K.test(e)||!P.test(e)||null!=t&&e in Object(t))}function _(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function W(e){if(!_(e))return!1;var t=F(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,B=S["__core-js_shared__"],V=(H=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var Q=Function.prototype.toString;function R(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var J=/^\[object .+?Constructor\]$/,q=Function.prototype,$=Object.prototype,ee=q.toString,te=$.hasOwnProperty,ie=RegExp("^"+ee.call(te).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ne(e){return!(!_(e)||(t=e,V&&V in t))&&(W(e)?ie:J).test(R(e));var t}function se(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ne(i)?i:void 0}var re=se(Object,"create");var oe=Object.prototype.hasOwnProperty;var ae=Object.prototype.hasOwnProperty;function ce(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function le(e,t){return e===t||e!=e&&t!=t}function ue(e,t){for(var i=e.length;i--;)if(le(e[i][0],t))return i;return-1}ce.prototype.clear=function(){this.__data__=re?re(null):{},this.size=0},ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce.prototype.get=function(e){var t=this.__data__;if(re){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return oe.call(t,e)?t[e]:void 0},ce.prototype.has=function(e){var t=this.__data__;return re?void 0!==t[e]:ae.call(t,e)},ce.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=re&&void 0===t?"__lodash_hash_undefined__":t,this};var pe=Array.prototype.splice;function de(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}de.prototype.clear=function(){this.__data__=[],this.size=0},de.prototype.delete=function(e){var t=this.__data__,i=ue(t,e);return!(i<0)&&(i==t.length-1?t.pop():pe.call(t,i,1),--this.size,!0)},de.prototype.get=function(e){var t=this.__data__,i=ue(t,e);return i<0?void 0:t[i][1]},de.prototype.has=function(e){return ue(this.__data__,e)>-1},de.prototype.set=function(e,t){var i=this.__data__,n=ue(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var me=se(S,"Map");function he(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(me||de),string:new ce}},fe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},fe.prototype.get=function(e){return he(this,e).get(e)},fe.prototype.has=function(e){return he(this,e).has(e)},fe.prototype.set=function(e,t){var i=he(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ge(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var o=e.apply(this,n);return i.cache=r.set(s,o)||r,o};return i.cache=new(ge.Cache||fe),i}ge.Cache=fe;var we=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/\\(\\)?/g,ye=function(e){var t=ge(e,function(e){return 500===i.size&&i.clear(),e}),i=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(we,function(e,i,n,s){t.push(n?s.replace(Me,"$1"):i||e)}),t}),De=ye;function xe(e,t){for(var i=-1,n=null==e?0:e.length,s=Array(n);++i<n;)s[i]=t(e[i],i,e);return s}var Le=N?N.prototype:void 0,ve=Le?Le.toString:void 0;function Ie(e){if("string"==typeof e)return e;if(E(e))return xe(e,Ie)+"";if(G(e))return ve?ve.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function be(e){return null==e?"":Ie(e)}function Ce(e,t){return E(e)?e:O(e,t)?[e]:De(be(e))}function Ee(e){if("string"==typeof e||G(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Te(e,t){for(var i=0,n=(t=Ce(t,e)).length;null!=e&&i<n;)e=e[Ee(t[i++])];return i&&i==n?e:void 0}function Ae(e,t,i){var n=null==e?void 0:Te(e,t);return void 0===n?i:n}var Se=Object.prototype;function Ne(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)}function ke(e,t){return function(i){return e(t(i))}}var je=ke(Object.keys,Object),Ze=Object.prototype.hasOwnProperty;function ze(e){if(!Ne(e))return je(e);var t=[];for(var i in Object(e))Ze.call(e,i)&&"constructor"!=i&&t.push(i);return t}var Ye=se(S,"DataView"),Xe=se(S,"Promise"),Fe=se(S,"Set"),Ue=se(S,"WeakMap"),Ge="[object Map]",Pe="[object Promise]",Ke="[object Set]",Oe="[object WeakMap]",_e="[object DataView]",We=R(Ye),He=R(me),Be=R(Xe),Ve=R(Fe),Qe=R(Ue),Re=F;(Ye&&Re(new Ye(new ArrayBuffer(1)))!=_e||me&&Re(new me)!=Ge||Xe&&Re(Xe.resolve())!=Pe||Fe&&Re(new Fe)!=Ke||Ue&&Re(new Ue)!=Oe)&&(Re=function(e){var t=F(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case We:return _e;case He:return Ge;case Be:return Pe;case Ve:return Ke;case Qe:return Oe}return t});var Je=Re;function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $e(e){return null!=e&&qe(e.length)&&!W(e)}function et(e){return function(t){return null==t?void 0:t[e]}}var tt=et("length"),it=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function nt(e){return it.test(e)}var st="\\ud800-\\udfff",rt="["+st+"]",ot="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",at="\\ud83c[\\udffb-\\udfff]",ct="[^"+st+"]",lt="(?:\\ud83c[\\udde6-\\uddff]){2}",ut="[\\ud800-\\udbff][\\udc00-\\udfff]",pt="(?:"+ot+"|"+at+")"+"?",dt="[\\ufe0e\\ufe0f]?",mt=dt+pt+("(?:\\u200d(?:"+[ct,lt,ut].join("|")+")"+dt+pt+")*"),ht="(?:"+[ct+ot+"?",ot,lt,ut,rt].join("|")+")",ft=RegExp(at+"(?="+at+")|"+ht+mt,"g");function gt(e){return nt(e)?function(e){for(var t=ft.lastIndex=0;ft.test(e);)++t;return t}(e):tt(e)}function wt(e){if(null==e)return 0;if($e(e))return"string"==typeof(t=e)||!E(t)&&U(t)&&"[object String]"==F(t)?gt(e):e.length;var t,i=Je(e);return"[object Map]"==i||"[object Set]"==i?e.size:ze(e).length}function Mt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(!t(e[i],i,e))return!1;return!0}var yt,Dt=function(e,t,i){for(var n=-1,s=Object(e),r=i(e),o=r.length;o--;){var a=r[yt?o:++n];if(!1===t(s[a],a,s))break}return e};function xt(e){return U(e)&&"[object Arguments]"==F(e)}var Lt=Object.prototype,vt=Lt.hasOwnProperty,It=Lt.propertyIsEnumerable,bt=xt(function(){return arguments}())?xt:function(e){return U(e)&&vt.call(e,"callee")&&!It.call(e,"callee")},Ct=bt;var Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,At=Tt&&Tt.exports===Et?S.Buffer:void 0,St=(At?At.isBuffer:void 0)||function(){return!1},Nt=/^(?:0|[1-9]\d*)$/;function kt(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Nt.test(e))&&e>-1&&e%1==0&&e<t}var jt={};function Zt(e){return function(t){return e(t)}}jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Arguments]"]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object Boolean]"]=jt["[object DataView]"]=jt["[object Date]"]=jt["[object Error]"]=jt["[object Function]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object WeakMap]"]=!1;var zt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yt=zt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Yt&&Yt.exports===zt&&T.process,Ft=function(){try{var e=Yt&&Yt.require&&Yt.require("util").types;return e||Xt&&Xt.binding&&Xt.binding("util")}catch(e){}}(),Ut=Ft&&Ft.isTypedArray,Gt=Ut?Zt(Ut):function(e){return U(e)&&qe(e.length)&&!!jt[F(e)]},Pt=Object.prototype.hasOwnProperty;function Kt(e,t){var i=E(e),n=!i&&Ct(e),s=!i&&!n&&St(e),r=!i&&!n&&!s&&Gt(e),o=i||n||s||r,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Pt.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||kt(l,c))||a.push(l);return a}function Ot(e){return $e(e)?Kt(e):ze(e)}function _t(e,t){return e&&Dt(e,t,Ot)}var Wt=function(e,t){return function(i,n){if(null==i)return i;if(!$e(i))return e(i,n);for(var s=i.length,r=t?s:-1,o=Object(i);(t?r--:++r<s)&&!1!==n(o[r],r,o););return i}}(_t),Ht=Wt;function Bt(e,t){var i=!0;return Ht(e,function(e,n,s){return i=!!t(e,n,s)}),i}function Vt(e){var t=this.__data__=new de(e);this.size=t.size}Vt.prototype.clear=function(){this.__data__=new de,this.size=0},Vt.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Vt.prototype.get=function(e){return this.__data__.get(e)},Vt.prototype.has=function(e){return this.__data__.has(e)},Vt.prototype.set=function(e,t){var i=this.__data__;if(i instanceof de){var n=i.__data__;if(!me||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new fe(n)}return i.set(e,t),this.size=i.size,this};function Qt(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new fe;++t<i;)this.add(e[t])}function Rt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function Jt(e,t){return e.has(t)}Qt.prototype.add=Qt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Qt.prototype.has=function(e){return this.__data__.has(e)};function qt(e,t,i,n,s,r){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=r.get(e),u=r.get(t);if(l&&u)return l==t&&u==e;var p=-1,d=!0,m=2&i?new Qt:void 0;for(r.set(e,t),r.set(t,e);++p<a;){var h=e[p],f=t[p];if(n)var g=o?n(f,h,p,t,e,r):n(h,f,p,e,t,r);if(void 0!==g){if(g)continue;d=!1;break}if(m){if(!Rt(t,function(e,t){if(!Jt(m,t)&&(h===e||s(h,e,i,n,r)))return m.push(t)})){d=!1;break}}else if(h!==f&&!s(h,f,i,n,r)){d=!1;break}}return r.delete(e),r.delete(t),d}var $t=S.Uint8Array;function ei(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function ti(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var ii=N?N.prototype:void 0,ni=ii?ii.valueOf:void 0;function si(e,t){for(var i=-1,n=t.length,s=e.length;++i<n;)e[s+i]=t[i];return e}function ri(e,t,i){var n=t(e);return E(e)?n:si(n,i(e))}function oi(e,t){for(var i=-1,n=null==e?0:e.length,s=0,r=[];++i<n;){var o=e[i];t(o,i,e)&&(r[s++]=o)}return r}function ai(){return[]}var ci=Object.prototype.propertyIsEnumerable,li=Object.getOwnPropertySymbols,ui=li?function(e){return null==e?[]:(e=Object(e),oi(li(e),function(t){return ci.call(e,t)}))}:ai;function pi(e){return ri(e,Ot,ui)}var di=Object.prototype.hasOwnProperty;var mi="[object Arguments]",hi="[object Array]",fi="[object Object]",gi=Object.prototype.hasOwnProperty;function wi(e,t,i,n,s,r){var o=E(e),a=E(t),c=o?hi:Je(e),l=a?hi:Je(t),u=(c=c==mi?fi:c)==fi,p=(l=l==mi?fi:l)==fi,d=c==l;if(d&&St(e)){if(!St(t))return!1;o=!0,u=!1}if(d&&!u)return r||(r=new Vt),o||Gt(e)?qt(e,t,i,n,s,r):function(e,t,i,n,s,r,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new $t(e),new $t(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return le(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ei;case"[object Set]":var c=1&n;if(a||(a=ti),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=qt(a(e),a(t),n,s,r,o);return o.delete(e),u;case"[object Symbol]":if(ni)return ni.call(e)==ni.call(t)}return!1}(e,t,c,i,n,s,r);if(!(1&i)){var m=u&&gi.call(e,"__wrapped__"),h=p&&gi.call(t,"__wrapped__");if(m||h){var f=m?e.value():e,g=h?t.value():t;return r||(r=new Vt),s(f,g,i,n,r)}}return!!d&&(r||(r=new Vt),function(e,t,i,n,s,r){var o=1&i,a=pi(e),c=a.length;if(c!=pi(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:di.call(t,u)))return!1}var p=r.get(e),d=r.get(t);if(p&&d)return p==t&&d==e;var m=!0;r.set(e,t),r.set(t,e);for(var h=o;++l<c;){var f=e[u=a[l]],g=t[u];if(n)var w=o?n(g,f,u,t,e,r):n(f,g,u,e,t,r);if(!(void 0===w?f===g||s(f,g,i,n,r):w)){m=!1;break}h||(h="constructor"==u)}if(m&&!h){var M=e.constructor,y=t.constructor;M==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof M&&M instanceof M&&"function"==typeof y&&y instanceof y||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,i,n,s,r))}function Mi(e,t,i,n,s){return e===t||(null==e||null==t||!U(e)&&!U(t)?e!=e&&t!=t:wi(e,t,i,n,Mi,s))}function yi(e){return e==e&&!_(e)}function Di(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function xi(e){var t=function(e){for(var t=Ot(e),i=t.length;i--;){var n=t[i],s=e[n];t[i]=[n,s,yi(s)]}return t}(e);return 1==t.length&&t[0][2]?Di(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var s=i.length,r=s,o=!n;if(null==e)return!r;for(e=Object(e);s--;){var a=i[s];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<r;){var c=(a=i[s])[0],l=e[c],u=a[1];if(o&&a[2]){if(void 0===l&&!(c in e))return!1}else{var p=new Vt;if(n)var d=n(l,u,c,e,t,p);if(!(void 0===d?Mi(u,l,3,n,p):d))return!1}}return!0}(i,e,t)}}function Li(e,t){return null!=e&&t in Object(e)}function vi(e,t){return null!=e&&function(e,t,i){for(var n=-1,s=(t=Ce(t,e)).length,r=!1;++n<s;){var o=Ee(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=s?r:!!(s=null==e?0:e.length)&&qe(s)&&kt(o,s)&&(E(e)||Ct(e))}(e,t,Li)}function Ii(e){return e}function bi(e){return O(e)?et(Ee(e)):function(e){return function(t){return Te(t,e)}}(e)}function Ci(e){return"function"==typeof e?e:null==e?Ii:"object"==typeof e?E(e)?function(e,t){return O(e)&&yi(t)?Di(Ee(e),t):function(i){var n=Ae(i,e);return void 0===n&&n===t?vi(i,e):Mi(t,n,3)}}(e[0],e[1]):xi(e):bi(e)}function Ei(e,t,i){if(!_(i))return!1;var n=typeof t;return!!("number"==n?$e(i)&&kt(t,i.length):"string"==n&&t in i)&&le(i[t],e)}function Ti(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ai(e){if(Ti(e)){for(let t in e)return!0;return!1}return!1}function Si(e){return"[object String]"===Object.prototype.toString.call(e)}function Ni(e){return!(!Si(e)||""===e)}var ki=/\s/;var ji=/^\s+/;function Zi(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&ki.test(e.charAt(t)););return t}(e)+1).replace(ji,""):e}var zi=/^[-+]0x[0-9a-f]+$/i,Yi=/^0b[01]+$/i,Xi=/^0o[0-7]+$/i,Fi=parseInt;function Ui(e){if("number"==typeof e)return e;if(G(e))return NaN;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zi(e);var i=Yi.test(e);return i||Xi.test(e)?Fi(e.slice(2),i?2:8):zi.test(e)?NaN:+e}var Gi=1/0;function Pi(e){return e?(e=Ui(e))===Gi||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ki(e){var t=Pi(e),i=t%1;return t==t?i?t-i:t:0}function Oi(e){return!0===(t=e)||!1===t||U(t)&&"[object Boolean]"==F(t);var t}function _i(e){return e!=e}function Wi(e){let t=!1;if(Ni(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(_i(e))return!1;t=!0}return t}function Hi(e){if(!Wi(e))return 0;return Pi(e)}function Bi(e,t={}){let i=Ae(t,"useLimitSafe",null);return Oi(i)||(i=!1),!!Wi(e)&&(e=Hi(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==Ki(n));var n}var Vi=S.isFinite,Qi=Math.min;var Ri,Ji=(Ri=Math["round"],function(e,t){if(e=Ui(e),(t=null==t?0:Qi(Ki(t),292))&&Vi(e)){var i=(be(e)+"e").split("e");return+((i=(be(Ri(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return Ri(e)});function qi(e,t={}){let i=Ae(t,"useClampSafe",null);Oi(i)||(i=!1);let n=Ae(t,"useLimitSafe",null);Oi(n)||(n=!1);let s=Ae(t,"returnWithStateAndMsg",null);Oi(s)||(s=!1);let r=e=>s?{state:"success",msg:e}:e,o=e=>{if(s)return{state:"error",msg:e};throw new Error(e)};if(!Wi(e))return r(0);let a=null;try{e=Hi(e),a=Ji(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),r(a))}function $i(e,t={}){if(!Bi(e,t))return!1;return qi(e)>0}function en(e){return"[object Array]"===Object.prototype.toString.call(e)}function tn(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function nn(e){if(Ti(e)){for(let t in e)return!1;return!0}return!1}function sn(e){return!!en(e)&&0===e.length}function rn(e){return!!tn(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!nn(e)||(!!function(e){return!(!Si(e)||""!==e)}(e)||(!!sn(e)||!!_i(e)))))}function on(e){return!!en(e)&&(0!==e.length&&(1!==e.length||!rn(e[0])))}function an(e){if(!Wi(e))return!1;return Hi(e)>0}var cn=ke(Object.getPrototypeOf,Object),ln=Function.prototype,un=Object.prototype,pn=ln.toString,dn=un.hasOwnProperty,mn=pn.call(Object);function hn(e){if(!U(e)||"[object Object]"!=F(e))return!1;var t=cn(e);if(null===t)return!0;var i=dn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&pn.call(i)==mn}function fn(e){if(!U(e))return!1;var t=F(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!hn(e)}function gn(e){return fn(e)}function wn(e){return W(e)}function Mn(e,t={}){if(!Bi(e,t))return!1;return qi(e)>=0}function yn(e,t){return Ni(e)&&Mn(t)?0===(t=qi(t))?"":e.substring(0,t):""}function Dn(e,t){if(!Ni(e))return"";if(!Mn(t))return"";if(0===(t=qi(t)))return"";let i=e.length-t;return i<0&&(i=0),e.substring(i,i+t)}function xn(e,t){return Ni(e)&&Mn(t)?0===(t=qi(t))?e:yn(e,e.length-t):""}function Ln(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}function vn(e){let t,i=Object.prototype.toString.call(e);if(t="[object Promise]"===i,t)return!0;if("[object Function]"!==i)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}let In=function(e){if(!wn(e))throw new Error("fn is not a function");return function(){let t=Ln(),i=null,n=null;try{i=e.apply(this,arguments)}catch(e){n=e}return null!==n?t.resolve({state:"error",msg:n}):vn(i)?i.then(e=>{t.resolve({state:"success",msg:e})}).catch(e=>{"cancelled"===Ae(e,"reason")?t.resolve({state:"cancelled",msg:""}):t.resolve({state:"error",msg:e})}):t.resolve({state:"success",msg:i}),t}};function bn(e,t={}){let i=Ae(t,"fs"),n=!1;try{i.statSync(e),n=!0}catch{n=!1}return n}function Cn(e,t={}){let i=Ae(t,"fs");if(!bn(e,{fs:i}))return!1;let n=i.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function En(e){return Cn(e,{fs:t})}function Tn(e,t={}){let i=Ae(t,"fs");return!!bn(e,{fs:i})&&(!i.lstatSync(e).isDirectory()&&!i.lstatSync(e).isSymbolicLink())}function An(e){return Tn(e,{fs:t})}function Sn(e,t,i){if(!Ni(e))return"";if(!Ni(t))return"";if(!Si(i))return"";return String(e).replaceAll(t,i)}var Nn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(t,i))}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),i}var Zn={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",s="second",r="minute",o="hour",a="day",c="week",l="month",u="quarter",p="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},w=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},M={s:w,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),s=i%60;return(t<=0?"+":"-")+w(n,2,"0")+":"+w(s,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),s=t.clone().add(n,l),r=i-s<0,o=t.clone().add(n+(r?-1:1),l);return+(-(n+(i-s)/(r?s-o:o-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:p,w:c,d:a,D:d,h:o,m:r,s:s,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",D={};D[y]=g;var x="$isDayjsObject",L=function(e){return e instanceof C||!(!e||!e[x])},v=function e(t,i,n){var s;if(!t)return y;if("string"==typeof t){var r=t.toLowerCase();D[r]&&(s=r),i&&(D[r]=i,s=r);var o=t.split("-");if(!s&&o.length>1)return e(o[0])}else{var a=t.name;D[a]=t,s=a}return!n&&s&&(y=s),s||!n&&y},I=function(e,t){if(L(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new C(i)},b=M;b.l=v,b.i=L,b.w=function(e,t){return I(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function g(e){this.$L=v(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var w=g.prototype;return w.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var s=n[2]-1||0,r=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)}}return new Date(t)}(e),this.init()},w.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},w.$utils=function(){return b},w.isValid=function(){return!(this.$d.toString()===m)},w.isSame=function(e,t){var i=I(e);return this.startOf(t)<=i&&i<=this.endOf(t)},w.isAfter=function(e,t){return I(e)<this.startOf(t)},w.isBefore=function(e,t){return this.endOf(t)<I(e)},w.$g=function(e,t,i){return b.u(e)?this[t]:this.set(i,e)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(e,t){var i=this,n=!!b.u(t)||t,u=b.p(e),m=function(e,t){var s=b.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?s:s.endOf(a)},h=function(e,t){return b.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},f=this.$W,g=this.$M,w=this.$D,M="set"+(this.$u?"UTC":"");switch(u){case p:return n?m(1,0):m(31,11);case l:return n?m(1,g):m(0,g+1);case c:var y=this.$locale().weekStart||0,D=(f<y?f+7:f)-y;return m(n?w-D:w+(6-D),g);case a:case d:return h(M+"Hours",0);case o:return h(M+"Minutes",1);case r:return h(M+"Seconds",2);case s:return h(M+"Milliseconds",3);default:return this.clone()}},w.endOf=function(e){return this.startOf(e,!1)},w.$set=function(e,t){var i,c=b.p(e),u="set"+(this.$u?"UTC":""),m=(i={},i[a]=u+"Date",i[d]=u+"Date",i[l]=u+"Month",i[p]=u+"FullYear",i[o]=u+"Hours",i[r]=u+"Minutes",i[s]=u+"Seconds",i[n]=u+"Milliseconds",i)[c],h=c===a?this.$D+(t-this.$W):t;if(c===l||c===p){var f=this.clone().set(d,1);f.$d[m](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},w.set=function(e,t){return this.clone().$set(e,t)},w.get=function(e){return this[b.p(e)]()},w.add=function(n,u){var d,m=this;n=Number(n);var h=b.p(u),f=function(e){var t=I(m);return b.w(t.date(t.date()+Math.round(e*n)),m)};if(h===l)return this.set(l,this.$M+n);if(h===p)return this.set(p,this.$y+n);if(h===a)return f(1);if(h===c)return f(7);var g=(d={},d[r]=t,d[o]=i,d[s]=e,d)[h]||1,w=this.$d.getTime()+n*g;return b.w(w,this)},w.subtract=function(e,t){return this.add(-1*e,t)},w.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=b.z(this),r=this.$H,o=this.$m,a=this.$M,c=i.weekdays,l=i.months,u=i.meridiem,p=function(e,i,s,r){return e&&(e[i]||e(t,n))||s[i].slice(0,r)},d=function(e){return b.s(r%12||12,e,"0")},h=u||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(f,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return b.s(t.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return p(i.monthsShort,a,l,3);case"MMMM":return p(l,a);case"D":return t.$D;case"DD":return b.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(i.weekdaysMin,t.$W,c,2);case"ddd":return p(i.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(r);case"HH":return b.s(r,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(r,o,!0);case"A":return h(r,o,!1);case"m":return String(o);case"mm":return b.s(o,2,"0");case"s":return String(t.$s);case"ss":return b.s(t.$s,2,"0");case"SSS":return b.s(t.$ms,3,"0");case"Z":return s}return null}(e)||s.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(n,d,m){var h,f=this,g=b.p(d),w=I(n),M=(w.utcOffset()-this.utcOffset())*t,y=this-w,D=function(){return b.m(f,w)};switch(g){case p:h=D()/12;break;case l:h=D();break;case u:h=D()/3;break;case c:h=(y-M)/6048e5;break;case a:h=(y-M)/864e5;break;case o:h=y/i;break;case r:h=y/t;break;case s:h=y/e;break;default:h=y}return m?h:b.a(h)},w.daysInMonth=function(){return this.endOf(l).$D},w.$locale=function(){return D[this.$L]},w.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=v(e,t,!0);return n&&(i.$L=n),i},w.clone=function(){return b.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},g}(),E=C.prototype;return I.prototype=E,[["$ms",n],["$s",s],["$m",r],["$H",o],["$W",a],["$M",l],["$y",p],["$D",d]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),I.extend=function(e,t){return e.$i||(e(t,C,I),e.$i=!0),I},I.locale=v,I.isDayjs=L,I.unix=function(e){return I(1e3*e)},I.en=D[y],I.Ls=D,I.p={},I}()}(Zn);var zn=kn(Zn.exports);function Yn(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYY-MM-DDTHH:mm:ssZ")}let Xn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Fn=Xn.length;function Un(e=32){let t=[];e=$i(e)?qi(e):32;for(let i=0;i<e;i++)t[i]=Xn[0|Math.random()*Fn];return t.join("")}var Gn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(Gn);var Pn=kn(Gn.exports);function Kn(){return new Pn}let On=2147483647;async function _n(e,t={}){let i=null,n=Ln();if(!wn(e))return n.reject("waitfunction需輸入函數f"),n;let s=async()=>{let t=e();return vn(t)&&(t=await t),t};if(i=await s(),!0===i)return n.resolve(),n;let r=Ae(t,"attemptNum",null);$i(r)||(r=200);let o=Ae(t,"timeInterval",null);$i(o)||(o=1e3),o=Math.min(o,On);let a=0,c=setInterval(async()=>{a+=1,i=await s(),!0===i&&(clearInterval(c),n.resolve()),a>r&&(clearInterval(c),n.reject(`exceeded attemptNum[${r}]`))},o);return n}function Wn(e){return function(e,t={}){let i=Ae(t,"fs");if(Cn(e,{fs:i}))return{success:"input folder is already exists: "+e};if(bn(e,{fs:i}))return{error:"input path already exists: "+e};try{i.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}function Hn(e,t,i=[],n={}){let s=n.funSettle,r=n.tag||"evem",o=(t,...i)=>e.emit(t,...i);wn(n.funEmit)&&(o=n.funEmit);try{return o(t,...i)}catch(n){if(wn(s))try{s(n)}catch(e){}try{"error"!==t&&e.listenerCount("error")>0?o("error",{fun:"listener",name:t,msg:n,args:i}):console.error(`[wsemi ${r}] listener of '${String(t)}' threw:`,n)}catch(e){try{console.error(`[wsemi ${r}] listener of '${String(t)}' threw, and reporting it also threw:`,e,n)}catch(e){}}return!1}}function Bn(e,t,i=[],n={}){let s=n.ms;return $i(s)||(s=1),s=qi(s),s=Math.min(s,On),setTimeout(()=>{Hn(e,t,i,n)},s)}function Vn(e){try{let t=e();return"string"==typeof t?t:""}catch(e){return""}}function Qn(e,t){try{let i=new WeakSet,n=[],s=JSON.stringify(e,function(e,s){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.length>=t)return"[Deep]";if("bigint"==typeof s)return String(s);if(null!==s&&"object"==typeof s){if(i.has(s))return"[Circular]";i.add(s),n.push(s)}return s});return"string"==typeof s?s:""}catch(e){return""}}function Rn(e){if(e.length>=2&&'"'===e[0]&&'"'===e[e.length-1]){let t=Vn(()=>JSON.parse(e));if(""!==t)return t}return e}function Jn(e,t){if(void 0===e)return"";if(null===e)return"null";let i=function(e){let t=typeof e;return"string"===t?e:null==e?"":"number"===t||"boolean"===t||"bigint"===t||"symbol"===t?String(e):""}(e);if(""!==i)return i;let n=Qn(e,t);if(""!==n&&"{}"!==n)return Rn(n);let s=Vn(()=>String(e));return""!==s&&"[object Object]"!==s?s:n}function qn(e,t){let i=new WeakSet;null===e||"object"!=typeof e&&"function"!=typeof e||i.add(e);let n=e,s=[];for(let e=0;e<t.levelCauseMax;e++){let e=null;try{e=n.cause}catch(e){break}if(null==e)break;if("object"==typeof e||"function"==typeof e){if(i.has(e))break;i.add(e)}let r=es(e,{...t,useCause:!1,useAggregate:!1});""!==r&&s.push(r),n=e}return s.join(" <- ")}function $n(e,t){let i=null;try{i=e.errors}catch(e){return""}if(!Array.isArray(i)||0===i.length)return"";let n=[];for(let s=0;s<i.length&&s<t.levelCauseMax;s++){if(i[s]===e)continue;let r=es(i[s],{...t,useCause:!1,useAggregate:!1});""!==r&&n.push(r)}return n.join("; ")}function es(e,t){if("string"==typeof e)return e;if(null==e)return"";if("number"==typeof e)return Number.isNaN(e)?"":String(e);if("boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);let i=null,n=!1;try{i=e.message,n=!0}catch(e){n=!1}if(n&&"string"==typeof i){if(""!==i){let n=i;if(t.useCause){let i=qn(e,t);""!==i&&(n=`${n} <- ${i}`)}if(t.useAggregate){let i=$n(e,t);""!==i&&(n=`${n} [${i}]`)}return n}let n=qn(e,t);return""!==n?n:""}if(n){let e=Jn(i,t.levelJsonMax);if(""!==e)return e}let s=qn(e,t);if(""!==s)return s;if(t.useAggregate){let i=$n(e,t);if(""!==i)return i}let r=Qn(e,t.levelJsonMax),o=Rn(r);if(""!==o&&"{}"!==o)return o;let a=Vn(()=>String(e));if(""!==a&&"[object Object]"!==a)return a;let c=Vn(()=>Object.prototype.toString.call(e));return""!==c&&"[object Object]"!==c?c:""!==r?r:""}function ts(e,t={}){let i=Ae(t,"useCause",null);Oi(i)||(i=!1);let n=Ae(t,"useAggregate",null);Oi(n)||(n=!1);let s=Ae(t,"levelCauseMax",null);$i(s,{useLimitSafe:!0})||(s=8),s=qi(s);let r=Ae(t,"levelJsonMax",null);$i(r,{useLimitSafe:!0})||(r=6),r=qi(r);let o=Ae(t,"lengthMessageMax",null);$i(o,{useLimitSafe:!0})||(o=0),o=qi(o);let a={useCause:i,useAggregate:n,levelCauseMax:s,levelJsonMax:r,lengthMessageMax:o},c="";try{c=es(e,a)}catch(e){return c="",c}return Ni(c)?(a.lengthMessageMax>0&&c.length>a.lengthMessageMax&&(c=a.lengthMessageMax>3?c.slice(0,a.lengthMessageMax-3)+"...":c.slice(0,a.lengthMessageMax)),c):(c="",c)}function is(e){if(!(Ni(e)||Wi(e)||G(e)||function(e){return"[object BigInt]"===Object.prototype.toString.call(e)}(e)))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}var ns={exports:{}};var ss,rs={exports:{}},os=jn(Object.freeze({__proto__:null,default:{}}));function as(){return ss||(ss=1,function(e){var t;e.exports=(t=t||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==Nn&&Nn.crypto&&(i=Nn.crypto),!i)try{i=os}catch(e){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),r={},o=r.lib={},a=o.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=a.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++){var o=i[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var a=0;a<s;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new c.init(t,e)}}),l=r.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(i,t/2)}},p=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(i,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,a=r/(4*o),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*l,r);if(l){for(var p=0;p<l;p+=o)this._doProcessBlock(s,p);i=s.splice(0,l),n.sigBytes-=u}return new c.init(i,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=r.algo={};return r}(Math),t)}(rs)),rs.exports}!function(e){e.exports=as().enc.Utf8}(ns);var cs=kn(ns.exports),ls={exports:{}};!function(e){var t;e.exports=(t=as(),function(){var e=t,i=e.lib.WordArray;function n(e,t,n){for(var s=[],r=0,o=0;o<t;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return i.create(s,r)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var s=[],r=0;r<i;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<i;a++)s.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,i=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<i.length;r++)s[i.charCodeAt(r)]=r}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return n(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(ls);var us=kn(ls.exports);function ps(e,t){return!!Ti(e)&&(!(!Ni(t)&&!Wi(t))&&t in e)}function ds(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}function ms(e,t){var i;return(E(e)?ds:Ht)(e,"function"==typeof(i=t)?i:Ii)}function hs(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function fs(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function gs(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function ws(e){if(!(hs(e)||function(e){let t=Object.prototype.toString.call(e);if("[object Blob]"===t||"[object File]"===t)return!0;try{if("undefined"!=typeof Blob&&e instanceof Blob)return!0}catch(e){}return!1}(e)||fs(e)||gs(e)))return null;try{if(Wi(e.byteLength))return e.byteLength}catch(e){}try{if(Wi(e.length))return e.length}catch(e){}try{if(Wi(e.size))return e.size}catch(e){}return null}let Ms=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function ys(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:new Uint8Array;if(!Ni(e))return n("invalid str");if(!("function"==typeof e.isWellFormed?e.isWellFormed():!Ms.test(e)))return n("invalid str, contains lone surrogates");let s=null;try{s=(new TextEncoder).encode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function Ds(e,t,i=0,n=!0,s=52,r=8){return function(e,t,i,n,s,r){if(!Wi(e))return null;if(!fs(t))return null;if(!Bi(i))return null;if(!Oi(n))return null;if(!Bi(s))return null;if(!Bi(r))return null;let o,a,c;e=Hi(e);let l=8*r-s-1,u=(1<<l)-1,p=u>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?r-1:0,h=n?-1:1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(o++,c/=2),o+p>=u?(a=0,o=u):o+p>=1?(a=(e*c-1)*Math.pow(2,s),o+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;t[i+m]=255&a,m+=h,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;t[i+m]=255&o,m+=h,o/=256,l-=8);return t[i+m-h]|=128*f,null}(e,t,i,n,s,r)}function xs(e){let t=0;ms(e,e=>{t+=ws(e)});let i=new Uint8Array(t),n=0;return ms(e,e=>{let t=function(e){return hs(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0)}(e);i.set(t,n),n+=t.length}),i}function Ls(e,t={}){let i=[],n=new Uint8Array,s=Ae(t,"returnWithStateAndMsg",null);Oi(s)||(s=!1);let r=e=>s?{state:"error",msg:e}:new Uint8Array;if(!(o=e,en(o)&&o.length>=1||Ai(e)))return r("invalid data, data is not an effective object or a non-empty array");var o;let a=[],c=[];function l(e){a.push(ws(e)),c.push(e)}try{let t=function(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{results:"",binarys:[]};if(!Ti(e)&&!en(e))return n("invalid data, data is not an object or array");if(nn(e)||sn(e))return n("invalid data, data is an empty object or empty array");let s=/^(?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,r="",o=[];try{let t=-1;r=JSON.stringify(e,function(e,i){if(fs(i)){t+=1;let e=`[BlazeForUint8Array]::${t}`;return o.push(i),e}if(gs(i)){t+=1;let e=`[BlazeForUint16Array]::${t}`;return o.push(i),e}if(hs(i)){t+=1;let e=`[BlazeForArrayBuffer]::${t}`;return o.push(i),e}return fn(i)&&(i=i.toString()),Ni(i)&&91===i.charCodeAt(0)&&s.test(i)?"[BlazeForPreventEscape]"+i:i})}catch(e){return n(e.toString())}return i?{state:"success",msg:{results:r,binarys:o}}:{results:r,binarys:o}}(e,{returnWithStateAndMsg:!0});if("error"===t.state)return r(`obj2stru8arr: ${t.msg}`);let s=t.msg;l(ys(s.results)),ms(s.binarys,e=>{l(e)});let o=a,u=ys(JSON.stringify(o)),p=new Uint8Array(8);Ds(ws(u),p),i.push(p),i.push(u),ms(c,e=>{i.push(e)}),n=xs(i)}catch(e){return r(e.toString())}return s?{state:"success",msg:n}:n}function vs(e,t=0,i=!0,n=52,s=8){return function(e,t,i,n,s){if(!fs(e))return null;if(!Bi(t))return null;if(!Oi(i))return null;if(!Bi(n))return null;if(!Bi(s))return null;let r,o,a=8*s-n-1,c=(1<<a)-1,l=c>>1,u=-7,p=i?0:s-1,d=i?1:-1,m=e[t+p];for(p+=d,r=m&(1<<-u)-1,m>>=-u,u+=a;u>0;r=256*r+e[t+p],p+=d,u-=8);for(o=r&(1<<-u)-1,r>>=-u,u+=n;u>0;o=256*o+e[t+p],p+=d,u-=8);if(0===r)r=1-l;else{if(r===c)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,n),r-=l}return(m?-1:1)*o*Math.pow(2,r-n)}(e,t,i,n,s)}function Is(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!fs(e))return n("invalid u8a");let s="";try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function bs(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Ai(e))return n("invalid data");let s=null,r=null;try{s=e.results,r=e.binarys}catch(e){return n(e.toString())}if(!Ni(s))return n("invalid results");if(!en(r))return n("invalid binarys");let o=/^\[BlazeFor(Uint8Array|Uint16Array|ArrayBuffer)\]::(\d+)$/,a=/^\[BlazeForPreventEscape\](?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,c={};try{c=JSON.parse(s,function(e,t){if(!Ni(t)||91!==t.charCodeAt(0))return t;let i=o.exec(t);if(null===i)return a.test(t)?t.slice(23):t;let n=Number(i[2]);if(n>=r.length)throw new Error(`binary index out of range[${n}], binarys.length[${r.length}]`);return((e,t,i)=>{if("Uint16Array"===e&&!gs(i)){if(!fs(i))throw new Error(`binarys[${t}] can not be restored to Uint16Array`);if(i.byteLength%2!=0)throw new Error(`binarys[${t}] byteLength[${i.byteLength}] is not even, can not be restored to Uint16Array`);let e=0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i);return new Uint16Array(e.buffer)}if("ArrayBuffer"===e&&!hs(i)){if(!fs(i))throw new Error(`binarys[${t}] can not be restored to ArrayBuffer`);return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}return i})(i[1],n,r[n])})}catch(e){return n(e.toString())}return i?{state:"success",msg:c}:c}function Cs(e,t={}){let i={},n=Ae(t,"returnWithStateAndMsg",null);Oi(n)||(n=!1);let s=e=>n?{state:"error",msg:e}:{};if(!fs(e))return s("invalid u8a");try{let t=8,n=e.slice(0,t),r=e.slice(t,ws(e)),o=vs(n),a=r.slice(0,o),c=r.slice(o,ws(r)),l=Is(a,{returnWithStateAndMsg:!0});if("error"===l.state)return s(`u8arr2str: ${l.msg}`);let u=l.msg,p=function(e,t){let i=0,n=0,s=[];return ms(t,t=>{n=i+t;let r=e.slice(i,n);i=n,s.push(r)}),s}(c,JSON.parse(u)),d=Is(p.shift(),{returnWithStateAndMsg:!0});if("error"===d.state)return s(`u8arr2str: ${d.msg}`);let m=bs({results:d.msg,binarys:p},{returnWithStateAndMsg:!0});if("error"===m.state)return s(`stru8arr2obj: ${m.msg}`);i=m.msg}catch(e){return s(e.toString())}return n?{state:"success",msg:i}:i}function Es(e){return function(e,t={}){let i=Ae(t,"fs");if(!bn(e,{fs:i}))return{success:"file does not exist: "+e};if(!Tn(e,{fs:i}))return{error:"input path is not a file: "+e};try{i.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}function Ts(e){return Ni(e)&&e.length<=128&&/^[A-Za-z0-9]+$/.test(e)}let As={permission:200,param:200,app:200,output:200,packet:200,internal:200},Ss={main:{apiType:"main",api:"apiMain",authFrom:"header",statusOf:As},ulctr:{apiType:"upload-controller",api:"apiUploadCheck",authFrom:"header",statusOf:As},slc:{apiType:"upload-slice",api:"apiUploadSlice",authFrom:"header",statusOf:As},dwgfn:{apiType:"download-get-filename",api:"apiDownloadGetFilename",authFrom:"header",statusOf:As,fields:[{name:"streamRead"},{name:"filename"}]},dwgf:{apiType:"download-get-file",api:"apiDownloadGetFile",authFrom:"query",statusOf:{permission:403,param:400,app:404,output:500,packet:500,internal:500},fields:[{name:"streamRead"},{name:"fileSize"},{name:"fileType"},{name:"filename",optional:!0}]},dw:{apiType:"download",api:"apiDownload",authFrom:"header",statusOf:As,fields:[{name:"streamRead"},{name:"filename"},{name:"fileSize"},{name:"fileType"}]}};function Ns(e,t){var i=-1,n=$e(e)?Array(e.length):[];return Ht(e,function(e,s,r){n[++i]=t(e,s,r)}),n}function ks(e,t){return(E(e)?xe:Ns)(e,Ci(t))}function js(e,t,i){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(i=i>s?s:i)<0&&(i+=s),s=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(s);++n<s;)r[n]=e[n+t];return r}function Zs(e){return e!=e}function zs(e,t,i){return t==t?function(e,t,i){for(var n=i-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var s=e.length,r=i+(n?1:-1);n?r--:++r<s;)if(t(e[r],r,e))return r;return-1}(e,Zs,i)}var Ys="\\ud800-\\udfff",Xs="["+Ys+"]",Fs="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Us="\\ud83c[\\udffb-\\udfff]",Gs="[^"+Ys+"]",Ps="(?:\\ud83c[\\udde6-\\uddff]){2}",Ks="[\\ud800-\\udbff][\\udc00-\\udfff]",Os="(?:"+Fs+"|"+Us+")"+"?",_s="[\\ufe0e\\ufe0f]?",Ws=_s+Os+("(?:\\u200d(?:"+[Gs,Ps,Ks].join("|")+")"+_s+Os+")*"),Hs="(?:"+[Gs+Fs+"?",Fs,Ps,Ks,Xs].join("|")+")",Bs=RegExp(Us+"(?="+Us+")|"+Hs+Ws,"g");function Vs(e){return nt(e)?function(e){return e.match(Bs)||[]}(e):function(e){return e.split("")}(e)}function Qs(e,t,i){if((e=be(e))&&(i||void 0===t))return Zi(e);if(!e||!(t=Ie(t)))return e;var n=Vs(e),s=Vs(t),r=function(e,t){for(var i=-1,n=e.length;++i<n&&zs(t,e[i],0)>-1;);return i}(n,s),o=function(e,t){for(var i=e.length;i--&&zs(t,e[i],0)>-1;);return i}(n,s)+1;return function(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:js(e,t,i)}(n,r,o).join("")}function Rs(e,t){if(!Ni(e))return[];if(!Ni(t))return[];let i=function(e,t){return Ni(e)&&Ni(t)?e.split(t):[]}(e,t);i=ks(i,Qs);let n=[];return ms(i,function(e){Ni(e)&&n.push(e)}),n}const Js=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function qs(e,t={}){let i=Ae(t,"fs"),n=Ae(t,"chunkSize");if(Wi(n)||(n=67108864),n=Hi(n),!Tn(e,{fs:i}))return Promise.reject("fp is not a file");let s=Ln();try{let{create64:t}=await async function(){return function(e){const{exports:{mem:t,xxh32:i,xxh64:n,init32:s,update32:r,digest32:o,init64:a,update64:c,digest64:l}}=e;let u=new Uint8Array(t.buffer);function p(e,i){if(t.buffer.byteLength<e+i){const n=Math.ceil((e+i-t.buffer.byteLength)/65536);t.grow(n),u=new Uint8Array(t.buffer)}}function d(e,t,i,n,s,r){p(e);const o=new Uint8Array(e);return u.set(o),i(0,t),o.set(u.subarray(0,e)),{update(t){let i;return u.set(o),"string"==typeof t?(p(3*t.length,e),i=g.encodeInto(t,u.subarray(e)).written):(p(t.byteLength,e),u.set(t,e),i=t.byteLength),n(0,e,i),o.set(u.subarray(0,e)),this},digest:()=>(u.set(o),r(s(0)))}}function m(e){return e>>>0}const h=2n**64n-1n;function f(e){return e&h}const g=new TextEncoder;function w(e,t=0){return p(3*e.length,0),m(i(0,g.encodeInto(e,u).written,t))}function M(e,t=0n){return p(3*e.length,0),f(n(0,g.encodeInto(e,u).written,t))}return{h32:w,h32ToString:(e,t=0)=>w(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(p(e.byteLength,0),u.set(e),m(i(0,e.byteLength,t))),create32:(e=0)=>d(48,e,s,r,o,m),h64:M,h64ToString:(e,t=0n)=>M(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(p(e.byteLength,0),u.set(e),f(n(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,a,c,l,f)}}((await WebAssembly.instantiate(Js)).instance)}(),r=t(),o=i.createReadStream(e,{highWaterMark:n});o.on("data",e=>{r.update(e)}),o.on("end",()=>{let e=r.digest().toString(16).padStart(16,"0");s.resolve(e)}),o.on("error",s.reject)}catch(e){s.reject(e.toString())}return s}var $s={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcyB3b3JrZXLlhafkvb/nlKjnhKHms5XovYnora/nmoTljp/nlJ/lpZfku7bkvovlpoJmcywg6YG/5YWN5L2/55So6aCC5bGkaW1wb3J05Yqg6LyJ5L2/55SoLCDlm6DnhKHms5XovYnora/mnIPnm7TmjqXkv53nlZkKICAgICAgICAvL+S4puWboGltcG9ydOS9jeaWvHdvcmtlcuWkluWxpOmZkOWumueCunJlcXVpcmXljYAocGFja2FnZS5qc29u5LiN57WmdHlwZT1tb2R1bGUpLCDmlYXlh7rnj77pjK/oqqTnhKHms5XovYnora8KICAgICAgICAKCiJ1c2Ugc3RyaWN0Ijt2YXIgdD1yZXF1aXJlKCJwYXRoIiksZT1yZXF1aXJlKCJmcyIpLHI9cmVxdWlyZSgiZXZlbnRzIiksbj1BcnJheS5pc0FycmF5LGk9Im9iamVjdCI9PXR5cGVvZiBnbG9iYWwmJmdsb2JhbCYmZ2xvYmFsLk9iamVjdD09PU9iamVjdCYmZ2xvYmFsLG89Im9iamVjdCI9PXR5cGVvZiBzZWxmJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2Vs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gICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKICAgIAogICAgICAgICAgICAvL2luc3RhbmNlCiAgICAgICAgICAgIGlmKHR5cGUgPT09ICdmdW5jdGlvbicpewogICAgICAgICAgICAgICAgaW5pdCguLi5pbnB1dCkKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmKHR5cGUgPT09ICdvYmplY3QnKXsKICAgICAgICAgICAgICAgIGluc3RhbmNlID0gbWVyZ2VTbGljZXMKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAKICAgICAgICAgICAgLy9zZW5kTWVzc2FnZQogICAgICAgICAgICBsZXQgcmVzID0gewogICAgICAgICAgICAgICAgbW9kZTogJ2VtaXQnLAogICAgICAgICAgICAgICAgZXZOYW1lOiAnZXJyb3InLAogICAgICAgICAgICAgICAgbXNnOiBlcnIsCiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VuZE1lc3NhZ2UocmVzKQoKICAgICAgICB9CiAgICAgICAgICAgIAogICAgfQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgPT09ICdjYWxsJyl7CiAgICAgICAgbGV0IHN0YXRlID0gJycKICAgICAgICBsZXQgbXNnID0gbnVsbAoKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL2Z1bgogICAgICAgICAgICBsZXQgZnVuID0gaW5zdGFuY2VbZGF0YS5mdW5dCgogICAgICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKCiAgICAgICAgICAgIC8vZXhlYwogICAgICAgICAgICBhd2FpdCBmdW4oLi4uaW5wdXQpCiAgICAgICAgICAgICAgICAudGhlbigoc3VjKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU9J3N1Y2Nlc3MnCiAgICAgICAgICAgICAgICAgICAgbXNnPXN1YwogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIC5jYXRjaCgoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU9J2Vycm9yJwogICAgICAgICAgICAgICAgICAgIG1zZz1lcnIKICAgICAgICAgICAgICAgIH0pCgogICAgICAgIH0KICAgICAgICBjYXRjaChlcnIpewogICAgICAgICAgICBzdGF0ZSA9ICdlcnJvcicKICAgICAgICAgICAgbXNnID0gZXJyCiAgICAgICAgfQogICAgICAgIAogICAgICAgIC8vc2VuZE1lc3NhZ2UKICAgICAgICBsZXQgcmVzID0gewogICAgICAgICAgICBtb2RlOiAncmV0dXJuJywKICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgIGZ1bjogZGF0YS5mdW4sCiAgICAgICAgICAgIHN0YXRlLAogICAgICAgICAgICBtc2csCiAgICAgICAgfQogICAgICAgIHNlbmRNZXNzYWdlKHJlcykKCiAgICB9Cgp9CgpmdW5jdGlvbiByZWN2TWVzc2FnZShkYXRhKSB7CiAgICAvLyBjb25zb2xlLmxvZygnaW5uZXIgd29ya2VyIHJlY3Y6JywgZGF0YSkKCiAgICAvL2RhdGFSZWN2CiAgICBsZXQgZGF0YVJlY3YgPSBkYXRhCgogICAgLy9ydW4KICAgIHJ1bihkYXRhUmVjdikKCn0KCgogICAgICAgIHBhcmVudFBvcnQub24oJ21lc3NhZ2UnLCByZWN2TWVzc2FnZSkKICAgICAgICAKCnRyeXsKCiAgICAvL+WDheS7pXVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcuiomOmMhCwg5LiN5Y+v6Ki75YaKdW5jYXVnaHRFeGNlcHRpb27oiId1bmhhbmRsZWRSZWplY3Rpb27nm6Pogb06CiAgICAvL+aWvHdvcmtlcuWFp+iou+WGiuatpOS6jOebo+iBveacg+mYu+atok5vZGXpoJDoqK3nmoR3b3JrZXLntYLmraLooYzngrosIOS9v3dvcmtlcuW0qea9sOW+jOS7jeWtmOa0u+epuui9iSwKICAgIC8v5aSW5bGk5pS25LiN5YiwZXJyb3IvZXhpdOS6i+S7tiwgcGVuZGluZyBwcm9taXNl5rC45LmF5oe4572uLCDkuJTlrZjmtLvmrq3lsY13b3JrZXLmnIPku6Tlrr/kuLvnqIvluo/nhKHms5XpgIDlh7o7CiAgICAvL+enu+mZpOW+jHdvcmtlcuS+nemgkOioreihjOeCuuatu+S6oSwgZXJyb3Lkuovku7blgrPoh7PlpJblsaQsIOeUseWkluWxpOaVtOaJuXJlamVjdCBwZW5kaW5nCiAgICAvLyBwcm9jZXNzLm9uKCd1bmhhbmRsZWRSZWplY3Rpb24nLCAoZXJyKSA9PiB7CiAgICAvLyAgICAgY29uc29sZS5sb2coJ2lubmVyOnVuaGFuZGxlZFJlamVjdGlvbicsIGVycikKICAgIC8vIH0pCiAgICAvLyBwcm9jZXNzLm9uKCd1bmNhdWdodEV4Y2VwdGlvbicsIChlcnIpID0+IHsKICAgIC8vICAgICBjb25zb2xlLmxvZygnaW5uZXI6dW5jYXVnaHRFeGNlcHRpb24nLCBlcnIpCiAgICAvLyB9KQogICAgcHJvY2Vzcy5vbigndW5jYXVnaHRFeGNlcHRpb25Nb25pdG9yJywgKGVycikgPT4gewogICAgICAgIGNvbnNvbGUubG9nKCdpbm5lcjp1bmNhdWdodEV4Y2VwdGlvbk1vbml0b3InLCBlcnIpCiAgICB9KQoKfQpjYXRjaChlcnIpe30KCg==",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}($s);var er=kn($s.exports);let tr=new Set,ir=new Map,nr=(t,i,n="")=>{let s=e.resolve(i,t);return{fp:s,fpm:`${s}.merging`,fpd:`${s}.done`,fpe:`${s}.error`,fpr:Ni(n)?`${s}.q${n}.ro`:""}},sr=e=>{let t=Es(e);if(An(e))throw new Error(`can not remove ${e}: ${ts(Ae(t,"error"))}`)},rr=async(e,i)=>{tr.add(i.fp);try{let n=await function(e,i={}){return qs(e,{fs:t,...i})}(i.fp);if(n===e)return t.writeFileSync(i.fpd,"","utf8"),{state:"done"};let s=`merged file[${i.fp}] is incomplete: hash[${n}] != fileHash[${e}], merge was interrupted`;try{t.writeFileSync(i.fpe,s,"utf8")}catch(e){console.log(`can not write ${i.fpe}`,e)}return{state:"mismatch",reason:s}}catch(e){return{state:"error",reason:`verify merged file[${i.fp}] error: ${ts(e)}`}}finally{tr.delete(i.fp)}},or=async(e,i,n)=>{let s=`${function(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYYMMDDHHmmss")}()}|${Un(6)}|${e}`,r=nr(e,n);if(tr.has(r.fp))return s;let o=An(r.fpe),a=An(r.fp);if(!o&&a){let t=await rr(e,r);if("done"===t.state)return s;if("error"===t.state)throw new Error(t.reason)}return sr(r.fpd),sr(r.fpe),tr.add(r.fp),setTimeout(()=>{er(e,i,n,r.fpm).then(i=>{let n=Ae(i,"hash","");if(n!==e)throw new Error(`merged file hash[${n}] != fileHash[${e}]`);t.renameSync(r.fpm,r.fp),t.writeFileSync(r.fpd,"","utf8")}).catch(e=>{console.log(e),Es(r.fpm);let i=ts(e);try{t.writeFileSync(r.fpe,i,"utf8")}catch(e){console.log(`can not write ${r.fpe}`,e)}}).finally(()=>{tr.delete(r.fp)})},1),s},ar=async(e,i,n={})=>{let s=Ae(n,"funConsume"),r=Ae(n,"funLog");wn(r)||(r=e=>{console.log(e)});let o=Rs(e,"|"),a=Ae(o,0,""),c=Ae(o,1,""),l=Ae(o,2,"");if(3!==wt(o)||!Ts(a)||!Ts(c)||!Ts(l)){let t=`invalid queueId[${ts(e)}]`;return console.log(t),{state:"error",msg:"invalid queueId",reason:t,path:""}}let u=nr(l,i,`${a}${c}`);if(An(u.fpr)){let e=((e,i)=>{try{let n=Cs(new Uint8Array(t.readFileSync(e.fpr)),{returnWithStateAndMsg:!0});if("success"!==Ae(n,"state"))return i(`stored result ${e.fpr} is corrupted, treat as not stored: ${Ae(n,"msg","unknown error")}`),{ok:!1};let s=n.msg;return Ti(s)&&ps(s,"ro")?{ok:!0,ro:s.ro}:(i(`stored result ${e.fpr} has no own 'ro' key, treat as not stored`),{ok:!1})}catch(t){return i(`can not read stored result ${e.fpr}: ${ts(t)}`),{ok:!1}}})(u,r);if(e.ok)return{state:"success",msg:e.ro,path:u.fp,from:"stored"}}if(An(u.fpe)){let e="";try{e=t.readFileSync(u.fpe,"utf8")}catch(e){}return{state:"error",msg:"merge slices failed",reason:e,path:u.fp}}if(tr.has(u.fp))return{state:"merging",msg:"",path:u.fp};let p=An(u.fp),d=An(u.fpd);if(p&&!d){let e=await rr(l,u);if("done"!==e.state)return{state:"error",msg:"merge slices failed",reason:e.reason,path:u.fp};d=!0}if(p&&d){if(!wn(s))return{state:"success",msg:"",path:u.fp};let i=await((e,i,n,s)=>{let r=ir.get(e);return r||(r=Promise.resolve().then(()=>n(i.fp)).then(e=>{e=void 0===e?null:e;try{let n=Ls({ro:e},{returnWithStateAndMsg:!0});if("success"!==Ae(n,"state"))return e;t.writeFileSync(i.fpr,Buffer.from(n.msg));let s=Cs(n.msg,{returnWithStateAndMsg:!0});if("success"===Ae(s,"state")&&Ti(s.msg)&&ps(s.msg,"ro"))return s.msg.ro}catch(e){s(`can not store consumed result to ${i.fpr}: ${ts(e)}`)}return e}).finally(()=>{ir.delete(e)}),ir.set(e,r),r)})(e,u,s,r);return{state:"success",msg:i,path:u.fp,from:"consumed"}}return!p&&d?{state:"error",msg:"merged file already consumed",reason:`merged file[${u.fp}] no longer exists and no stored result for queueId[${e}]`,path:u.fp}:{state:"error",msg:"no merge task",reason:`no merge task for fileHash[${l}] (never pushed, or artifacts removed)`,path:u.fp}};var cr={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcyB3b3JrZXLlhafkvb/nlKjnhKHms5XovYnora/nmoTljp/nlJ/lpZfku7bkvovlpoJmcywg6YG/5YWN5L2/55So6aCC5bGkaW1wb3J05Yqg6LyJ5L2/55SoLCDlm6DnhKHms5XovYnora/mnIPnm7TmjqXkv53nlZkKICAgICAgICAvL+S4puWboGltcG9ydOS9jeaWvHdvcmtlcuWkluWxpOmZkOWumueCunJlcXVpcmXljYAocGFja2FnZS5qc29u5LiN57WmdHlwZT1tb2R1bGUpLCDmlYXlh7rnj77pjK/oqqTnhKHms5XovYnora8KICAgICAgICAKCiJ1c2Ugc3RyaWN0Ijt2YXIgdD1yZXF1aXJlKCJwYXRoIiksZT1yZXF1aXJlKCJmcyIpO2Z1bmN0aW9uIHIodCxlKXtmb3IodmFyIHI9LTEsbj1udWxsPT10PzA6dC5sZW5ndGg7KytyPG4mJiExIT09ZSh0W3JdLHIsdCk7KTtyZXR1cm4gdH12YXIgbixvPWZ1bmN0aW9uKHQsZSxyKXtmb3IodmFyIG89LTEsdT1PYmplY3QodCksaT1yKHQpLGE9aS5sZW5ndGg7YS0tOyl7dmFyIGM9aVtuP2E6KytvXTtpZighMT09PWUodVtjXSxjLHUpKWJyZWFrfXJld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lID0gbnVsbApmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBjaGVja1RvdGFsSGFzaAogICAgICAgIH0KICAgICAgICAKCiAgICAvL29uCiAgICAKCiAgICAvL3NhdmUKICAgIGluc3RhbmNlID0gcgoKfQoKZnVuY3Rpb24gc2VuZE1lc3NhZ2UoZGF0YSkgewogICAgCiAgICAgICAgcGFyZW50UG9ydC5wb3N0TWVzc2FnZShkYXRhKQogICAgICAgIAp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBjaGVja1RvdGFsSGFzaAogICAgICAgICAgICB9CgogICAgICAgIH0KICAgICAgICBjYXRjaChlcnIpewogICAgICAgIAogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMpCgogICAgICAgIH0KICAgICAgICAgICAgCiAgICB9CgogICAgLy9jaGVjawogICAgaWYobW9kZSA9PT0gJ2NhbGwnKXsKICAgICAgICBsZXQgc3RhdGUgPSAnJwogICAgICAgIGxldCBtc2cgPSBudWxsCgogICAgICAgIHRyeXsKCiAgICAgICAgICAgIC8vZnVuCiAgICAgICAgICAgIGxldCBmdW4gPSBpbnN0YW5jZVtkYXRhLmZ1bl0KCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAoKICAgICAgICAgICAgLy9leGVjCiAgICAgICAgICAgIGF3YWl0IGZ1biguLi5pbnB1dCkKICAgICAgICAgICAgICAgIC50aGVuKChzdWMpID0+IHsKICAgICAgICAgICAgICAgICAgICBzdGF0ZT0nc3VjY2VzcycKICAgICAgICAgICAgICAgICAgICBtc2c9c3VjCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgLmNhdGNoKChlcnIpID0+IHsKICAgICAgICAgICAgICAgICAgICBzdGF0ZT0nZXJyb3InCiAgICAgICAgICAgICAgICAgICAgbXNnPWVycgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgfQogICAgICAgIGNhdGNoKGVycil7CiAgICAgICAgICAgIHN0YXRlID0gJ2Vycm9yJwogICAgICAgICAgICBtc2cgPSBlcnIKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgLy9zZW5kTWVzc2FnZQogICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICBpZDogZGF0YS5pZCwKICAgICAgICAgICAgZnVuOiBkYXRhLmZ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uJywgZXJyKQogICAgLy8gfSkKICAgIC8vIHByb2Nlc3Mub24oJ3VuY2F1Z2h0RXhjZXB0aW9uJywgKGVycikgPT4gewogICAgLy8gICAgIGNvbnNvbGUubG9nKCdpbm5lcjp1bmNhdWdodEV4Y2VwdGlvbicsIGVycikKICAgIC8vIH0pCiAgICBwcm9jZXNzLm9uKCd1bmNhdWdodEV4Y2VwdGlvbk1vbml0b3InLCAoZXJyKSA9PiB7CiAgICAgICAgY29uc29sZS5sb2coJ2lubmVyOnVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcicsIGVycikKICAgIH0pCgp9CmNhdGNoKGVycil7fQoK",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(cr);var lr=kn(cr.exports),ur={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcy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hdGEpIHsKICAgIAogICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YSkKICAgICAgICAKfQoKYXN5bmMgZnVuY3Rpb24gcnVuKGRhdGEpIHsKICAgIC8vIGNvbnNvbGUubG9nKCdpbm5lciB3b3JrZXIgcnVuJyxkYXRhKQoKICAgIC8vbW9kZQogICAgbGV0IG1vZGUgPSBkYXRhLm1vZGUKCiAgICAvL2NoZWNrCiAgICBpZihtb2RlICE9PSAnaW5pdCcgJiYgbW9kZSAhPT0gJ2NhbGwnKXsKICAgICAgICByZXR1cm4KICAgIH0KCiAgICAvL2luaXQKICAgIGlmKG1vZGUgPT09ICdpbml0Jyl7CiAgICAgICAgCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy90eXBlCiAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YS50eXBlCgogICAgICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKICAgIAogICAgICAgICAgICAvL2luc3RhbmNlCiAgICAgICAgICAgIGlmKHR5cGUgPT09ICdmdW5jdGlvbicpewogICAgICAgICAgICAgICAgaW5pdCguLi5pbnB1dCkKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmKHR5cGUgPT09ICdvYmplY3QnKXsKICAgICAgICAgICAgICAgIGluc3RhbmNlID0gY2hlY2tTbGljZXNIYXNoCiAgICAgICAgICAgIH0KCiAgICAgICAgfQogICAgICAgIGNhdGNoKGVycil7CiAgICAgICAgCiAgICAgICAgICAgIC8vc2VuZE1lc3NhZ2UKICAgICAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdlbWl0JywKICAgICAgICAgICAgICAgIGV2TmFtZTogJ2Vycm9yJywKICAgICAgICAgICAgICAgIG1zZzogZXJyLAogICAgICAgICAgICB9CiAgICAgICAgICAgIHNlbmRNZXNzYWdlKHJlcykKCiAgICAgICAgfQogICAgICAgICAgICAKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9mdW4KICAgICAgICAgICAgbGV0IGZ1biA9IGluc3RhbmNlW2RhdGEuZnVuXQoKICAgICAgICAgICAgLy9pbnB1dAogICAgICAgICAgICBsZXQgaW5wdXQgPSBkYXRhLmlucHV0CgogICAgICAgICAgICAvL2V4ZWMKICAgICAgICAgICAgYXdhaXQgZnVuKC4uLmlucHV0KQogICAgICAgICAgICAgICAgLnRoZW4oKHN1YykgPT4gewogICAgICAgICAgICAgICAgICAgIHN0YXRlPSdzdWNjZXNzJwogICAgICAgICAgICAgICAgICAgIG1zZz1zdWMKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4gewogICAgICAgICAgICAgICAgICAgIHN0YXRlPSdlcnJvcicKICAgICAgICAgICAgICAgICAgICBtc2c9ZXJyCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KICAgICAgICAKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ2UoZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciByZWN2OicsIGRhdGEpCgogICAgLy9kYXRhUmVj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9uaXRvcicsIChlcnIpID0+IHsKICAgICAgICBjb25zb2xlLmxvZygnaW5uZXI6dW5jYXVnaHRFeGNlcHRpb25Nb25pdG9yJywgZXJyKQogICAgfSkKCn0KY2F0Y2goZXJyKXt9Cgo=",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(ur);var pr=kn(ur.exports);function dr(e,t){try{return{ok:!0,value:t()}}catch(t){let i=ts(t);return{ok:!1,stage:e,cause:Ni(i)?i:"unknown error"}}}function mr(e,t){try{return r.validateHeaderValue(e,t),!0}catch(e){return!1}}function hr(e,t,i,n={}){let r=!0===Ae(n,"forHead",!1);if(null==e)return{error:"invalid streamRead",reason:"streamRead is null or undefined"};let o=dr("identify streamRead",()=>e instanceof s.Readable?{isReadable:!0,objectMode:!0===e.readableObjectMode,done:!0===e.destroyed||!0===e.readableEnded}:{isReadable:!1});if(!o.ok)return{error:"invalid streamRead",reason:`${o.stage} failed: ${o.cause}`};if(o.value.isReadable){if(o.value.objectMode)return{error:"invalid streamRead",reason:"streamRead is in object mode"};if(o.value.done)return{error:"invalid streamRead",reason:"streamRead is already destroyed or ended (each download event must provide a new stream)"};if(r)return{source:e};let n=dr("setup pipeline",()=>{let n=0,r=!1,o=new s.Transform({transform(e,i,s){if(n+=e.length,n>t)return r=!0,void s(new Error(`streamRead sent more than fileSize[${t}] bytes`));s(null,e)},flush(e){if(n!==t)return r=!0,void e(new Error(`streamRead ended at ${n} bytes but fileSize is ${t}`));e()}});return s.pipeline(e,o,e=>{e&&r&&i(ts(e))}),o});return n.ok?{source:n.value}:{error:"invalid streamRead",reason:`${n.stage} failed: ${n.cause}`}}let a=dr("materialize streamRead",()=>{if(Buffer.isBuffer(e))return{buf:e};if(e instanceof Uint8Array)return{buf:Buffer.from(e)};if(Si(e))return{buf:Buffer.from(e,"utf8")};if("number"==typeof e||Oi(e)||"object"==typeof e&&!1===function(e){try{return wn(e.pipe)}catch(e){return null}}(e)){let t=null;try{t=JSON.stringify(e)}catch(e){return{unserializable:ts(e)}}return"string"!=typeof t?{unserializable:""}:{buf:Buffer.from(t,"utf8")}}return{unsupported:!0}});if(!a.ok)return{error:"invalid streamRead",reason:`${a.stage} failed: ${a.cause}`};if(ps(a.value,"unserializable")){let e=a.value.unserializable;return{error:"invalid streamRead",reason:Ni(e)?`streamRead can not be serialized: ${e}`:"streamRead can not be serialized"}}if(!0===a.value.unsupported)return{error:"invalid streamRead",reason:"streamRead must be a readable stream, buffer, string, number, boolean or plain object"};let c=a.value.buf;return c.length!==t?{error:"fileSize mismatch",reason:`streamRead has ${c.length} bytes but fileSize is ${t}`}:{source:c}}let fr=e=>"function"==typeof e.toWellFormed?e.toWellFormed():e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�");function gr(e,t){let i=dr(`check field[${e}]`,()=>{if("fileSize"===e)return function(e){return Mn(e,{useLimitSafe:!0})}(t)?{ok:!0,value:qi(t)}:{ok:!1};if("filename"===e||"fileType"===e){if(!Ni(t))return{ok:!1};let i=is(t);return Ni(i)?"fileType"===e?mr("Content-Type",i)?{ok:!0,value:i}:{ok:!1}:{ok:!0,value:fr(i)}:{ok:!1}}throw new Error(`unknown field[${e}]`)});return i.ok?{ok:i.value.ok,value:i.value.value,cause:""}:{ok:!1,value:void 0,cause:i.cause}}function wr(e){try{e&&wn(e.pipe)&&wn(e.destroy)&&e.destroy()}catch(e){}}function Mr(e){return void 0===e||wn(e)||"symbol"==typeof e?null:e}function yr(e,t,i={}){let n=new s.Readable;n._read=()=>{},n.push(t),n.push(null);let r=Ae(i,"returnType",""),o=Ae(i,"returnMsg",""),a=e.response(n).header("Cache-Control","no-cache, no-store, must-revalidate").header("Content-Type","application/octet-stream").header("Content-Length",n.readableLength);return Ni(r)&&a.header("Return-Type",r),Ni(o)&&mr("Return-Msg",o)&&a.header("Return-Msg",o),a}function Dr(r={}){let o={useLimitSafe:!0},a=Ae(r,"port");(!$i(a,o)||qi(a)>65535)&&(a=8080),a=qi(a);let c=Ae(r,"useInert");Oi(c)||(c=!0);let l=Ae(r,"pathStaticFiles");Ni(l)||(l="dist");let u=Ae(r,"pathUploadTemp");Ni(u)||(u="./uploadTemp");let p="";if(!En(u)){let e=Wn(u);ps(e,"error")&&(p=ts(e.error))}let d=Ae(r,"apiName");Ni(d)||(d="api");let m=Ae(r,"tokenType");Ni(m)||(m="Bearer");let h=Ae(r,"sizeSlice");$i(h,o)||(h=1048576),h=qi(h);let f=Ae(r,"sizeMsg");$i(f,o)||(f=104857600),f=qi(f);let g=Ae(r,"verifyConn");wn(g)||(g=()=>!0);let w=Ae(r,"corsOrigins",[]);on(w)||(w=["*"]);let M=Ae(r,"delayForSlice","");(!Mn(M,o)||qi(M)>2147483647)&&(M=100),M=qi(M);let y=null;y=Ae(r,"serverHapi")?r.serverHapi:i.server({port:a,routes:{timeout:{server:!1,socket:!1},cors:{origin:w,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}}});let D=Kn(),x={tag:"w-converhp"},L=(e,...t)=>Hn(D,e,t,{...x,funSettle:()=>{let i=t[t.length-1];vn(i)&&i.reject(`listener of event[${e}] error`)},funEmit:I}),v=(e,...t)=>Bn(D,e,t,{...x,funEmit:I});function I(e,...t){if("error"===e&&Ai(t[0])&&"listener"===t[0].fun){let e=Ae(t[0],"name",""),i=Ae(t[0],"msg");return console.log(`listener of event[${e}] error`,i),D.emit("error",`listener of event[${e}] error: ${ts(i)}`)}return D.emit(e,...t)}Ni(p)&&v("error",`create pathUploadTemp[${u}] error: ${p}`);let b=(e,t,i)=>{let n=Ln(),s=Ln();return s.then(t=>{void 0===t&&(t=null);let s=typeof t;if("function"===s||"symbol"===s)return n.reject("output can not be serialized"),void L("error",`event[${e}] output can not be serialized: output is a ${s}`);n.resolve(wn(i)?i(t):t)}).catch(e=>{n.reject(e)}),function(e,t,i,n,s,r){if(0===e.listenerCount(i)){let e=`no listener for event[${i}]`;return s.reject(e),r(e),!1}t(i,...n,s)}(D,L,e,t,s,e=>{L("error",e)}),n};async function C(e){return b("upload",[e])}async function E(e){return b("download",[e])}let T=`${is(m)} `,A=(e,t)=>{let i=Ae(e,"headers");i=Ai(i)?i:"";let n=Ae(e,"query");n=Ai(n)?n:"";let s="",r="";return"query"===t.authFrom?(r=Ae(n,"token",""),r=Ni(r)?r:"",Ni(r)&&(s=`${m} ${r}`)):(s=Ae(i,"authorization",""),s=Ni(s)?s:"",r=s.startsWith(T)?s.slice(T.length):""),{headers:i,query:n,authorization:s,token:r}},S=(e,t)=>{let i=(i,n,s)=>function(e,t,i={}){Ni(t)||(console.log("msg",t),console.log("msg is not an effective string, set msg=''"),t="");let n=Ae(i,"retryable",!0),s={error:t};!1===n&&(s.retryable=!1);let r=yr(e,Ls(s),{returnType:"error",returnMsg:t});return!1===n&&r.header("Return-Retryable","false"),r}(e,n,s).code(t.statusOf[i]);return{permission:()=>i("permission","permission denied"),param:e=>i("param",e,{retryable:!1}),app:e=>i("app",e),output:e=>i("output",e),packet:e=>i("packet",e),internal:e=>i("internal",e)}},N=async(e,t,i,n)=>!0!==await async function(e){let t=!1;try{t=g(e),vn(t)&&(t=await t)}catch(i){t=!1,console.log(`verifyConn error for apiType[${Ae(e,"apiType","")}]`,i),L("error",`verifyConn error for apiType[${Ae(e,"apiType","")}]: ${ts(i)}`)}return!0===t}({apiType:i.apiType,authorization:t.authorization,query:t.query,headers:t.headers,req:e})?n.permission():(L("handler",{api:i.api,headers:t.headers,query:t.query}),null),k=(e,t,i,n)=>{let s=function(e,t){let i={};for(let n of t){let t=dr(`read field[${n}]`,()=>Ae(e,n));if(!t.ok)return{ok:!1,field:n,cause:t.cause,fields:i};i[n]=t.value}return{ok:!0,fields:i}}(e,i.fields.map(e=>e.name));if(!s.ok)return wr(Ae(s.fields,"streamRead")),L("error",`download fileId[${t}] output error: can not read field[${s.field}]: ${s.cause}`),{ok:!1,res:n.output("invalid streamRead")};let r={streamRead:s.fields.streamRead};for(let e of i.fields){if("streamRead"===e.name)continue;let i=gr(e.name,s.fields[e.name]);if(i.ok){r[e.name]=i.value;continue}if(!0===e.optional&&!Ni(i.cause)){r[e.name]="";continue}wr(r.streamRead);let o="fileSize"===e.name?`[${ts(s.fields.fileSize)}]`:"";return L("error",`download fileId[${t}] output error: invalid ${e.name}${o}${Ni(i.cause)?`: ${i.cause}`:""}`),{ok:!1,res:n.output(`invalid ${e.name}`)}}return{ok:!0,v:r}},j=async(e,t,i,n)=>{let s={},r="";await i.then(e=>{s.success=e,r="success"}).catch(e=>{s.error=e,r="error"});let o=function(e,t){let i={};for(let t of Object.keys(e))i[t]=Mr(e[t]);let n=Ls(i,{returnWithStateAndMsg:!0});return"success"!==Ae(n,"state")?(t(Ae(n,"msg","unknown error")),null):n.msg}(s,e=>{L("error",`${n} output can not be serialized: ${e}`)});return null===o?t.internal("output can not be serialized"):yr(e,o,{returnType:r,returnMsg:"need to parse"})},Z=e=>(t,i,n)=>{if(413===Ae(n,"output.statusCode"))throw n;return L("error",`invalid request packet for ${e.api}: ${ts(n)}`),S(i,e).packet("invalid request packet").takeover()},z={path:`/${d}/main`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.main,n=S(t,i),r=A(e,i),o=await N(e,r,i,n);if(o)return o;let a=null;try{a=await(()=>{let t=Ln(),i=[],n=0,r=!1,o=new s.Writable({write(e,t,s){if(n+=e.length,n>f)return i=[],r=!0,void s();i.push(e),s()}});return o.on("finish",()=>{}),e.payload.pipe(o),e.payload.on("end",()=>{if(r)return void t.reject("payload too large");let e=Buffer.concat(i);i=[],t.resolve(e)}),e.payload.on("close",()=>{}),e.payload.on("error",e=>{console.log("apiMain req.payload err",e),L("error",`receive payload error: ${ts(e)}`),t.reject(`receive payload error: ${ts(e)}`)}),t})()}catch(e){if("payload too large"===e)return t.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${f}`}).code(413);throw e}let c=Cs(new Uint8Array(a),{returnWithStateAndMsg:!0});if("success"!==Ae(c,"state")||!Ai(c.msg)){let e=ts(Ae(c,"msg",""));return L("error",`invalid request packet for apiMain: ${Ni(e)?e:"not an effective object"}`),n.packet("invalid request packet")}let l=c.msg;return j(t,n,async function(e){return b("execute",[Ae(e,"func",""),Ae(e,"input",null)],t=>(e.output=t,delete e.input,e))}(l),`execute func[${ts(Ae(l,"func",""))}]`)}},Y={path:`/${d}/ulctr`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.ulctr)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.ulctr,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.mode","");if("check-total-hash"!==o&&"check-slices-hash"!==o&&"merge-slices-push"!==o&&"merge-slices-get"!==o)return n.param(`invalid mode[${ts(o)}] in payload`);let a=Ae(e,"payload.fileHash","");if(!Ts(a))return n.param("invalid fileHash in payload");let c=Ae(e,"payload.chunkTotal","");if("merge-slices-push"===o){if(!$i(c))return n.param("invalid chunkTotal in payload");c=qi(c)}let l=Ae(e,"payload.filename",""),p=function(e,t="unknown"){if(!Ni(e))return t;let i=e.replace(/\\/g,"/").split("/").filter(e=>""!==e&&"."!==e&&".."!==e).pop()||"";return i=i.replace(/[\x00-\x1f\x7f<>:"|?*]/g,"_"),i=i.replace(/[. ]+$/g,""),/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i.test(i)&&(i=`_${i}`),""===i?t:i}(l,""),d=e=>Ai(e)&&ps(e,"error")?`${o}: ${is(e.error)}`:"",m=async(e,t)=>{try{return await t()}catch(t){return L("error",`upload-controller mode[${o}] ${e} error: ${ts(t)}`),Promise.reject(`${o} failed`)}};return j(t,n,(async()=>{let t=null;if("check-total-hash"===o){let i=Ae(e,"payload.fileSize","");t=await m("check total hash",()=>lr(i,h,a,u));let n=d(t);if(Ni(n))return Promise.reject(n);if(t.bAllHash){let e={from:"check-total-hash",filename:l,filenameSafe:p,path:t.path},i=await C(e);t={...t,msg:i}}delete t.path,t.sizeSlice=h}else if("check-slices-hash"===o){let i=Ae(e,"payload.fileSliceHashs",[]);t=await m("check slices hash",()=>pr(i,a,u));let n=d(t);if(Ni(n))return Promise.reject(n)}else if("merge-slices-push"===o){t={queueId:await m("push merge task",()=>or(a,c,u))}}else if("merge-slices-get"===o){let i=Ae(e,"payload.queueId",""),n=await ar(i,u,{funConsume:async e=>await C({from:"merge-slices-get",filename:l,filenameSafe:p,path:e}),funLog:e=>{L("error",e)}});t={state:n.state,msg:n.msg,queueId:i,filename:l},"error"===n.state&&Ni(n.reason)&&L("error",`${n.msg} for fileHash[${a}]: ${n.reason}`)}return t})(),`upload-controller mode[${o}]`)}},X={path:`/${d}/slc`,method:"POST",options:{payload:{maxBytes:h,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(i,n){let s=Ss.slc,r=S(n,s),o=A(i,s),a=await N(i,o,s,r);if(a)return a;let c=Ae(o.headers,"chunk-index",""),l=Ae(o.headers,"chunk-total",""),p=Ae(o.headers,"package-id","");if(!Mn(c))return r.param("invalid chunkIndex in headers");if(c=qi(c),!Mn(l))return r.param("invalid chunkTotal in headers");if(l=qi(l),!Ts(p))return r.param("invalid packageId in headers");let d=e.resolve(u,`${p}_${c}`),m=t.createWriteStream(d),f=()=>{let e=Ln(),t=0,n=!1,s=!1,r=!1,o=!1;m.on("error",t=>{s||n||r||(s=!0,i.payload.unpipe(m),i.payload.resume(),console.log(`apiUploadSlice streamWrite chunk[${c+1}/${l}] of packageId[${p}] err`,t),L("error",`write chunk[${c+1}/${l}] of packageId[${p}] error: ${ts(t)}`),e.reject(`write chunk[${c+1}/${l}] of packageId[${p}] error`))}),m.on("close",()=>{n||s||r?Es(d):o&&!0===m.writableFinished&&setTimeout(()=>{e.resolve(`chunk[${c+1}/${l}] of packageId[${p}] done`)},M)}),i.payload.on("data",e=>{n||(t+=e.length,t>h&&(n=!0,i.payload.unpipe(m),i.payload.resume(),m.destroy()))}),i.payload.pipe(m),i.payload.on("end",()=>{o=!0,s||n&&e.reject("payload too large")});let a=t=>{r||o||s||(r=!0,m.destroy(),L("error",`receive chunk[${c+1}/${l}] of packageId[${p}] error: ${t}`),e.reject(`receive chunk[${c+1}/${l}] of packageId[${p}] error: ${t}`))};return i.payload.on("error",e=>{console.log(`apiUploadSlice req.payload chunk[${c+1}/${l}] of packageId[${p}] err`,e),a(ts(e))}),i.payload.on("close",()=>{a("closed before end")}),e},g={},w="",y="";try{let e=await f();g.success=e,w="success",y="need to parse"}catch(e){if("payload too large"===e)return n.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${h}`}).code(413);g.error=e,w="error",y="need to parse"}return yr(n,Ls(g),{returnType:w,returnMsg:y})}},F={path:`/${d}/dwgfn`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.dwgfn)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.dwgfn,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.fileId","");if(!Ni(o))return n.param("invalid fileId in payload");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);return l.ok?(wr(l.v.streamRead),j(t,n,Promise.resolve({filename:l.v.filename}),`download fileId[${o}]`)):l.res}},U={path:`/${d}/dwgf`,method:"GET",options:{timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Ss.dwgf,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(s.query,"fileId","");if(o=Ni(o)?o:"",!Ni(o))return n.param("invalid fileId in query");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=l.v.fileSize,d=l.v.fileType,m=l.v.filename,h=hr(u,p,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===is(Ae(e,"method","")).toLowerCase()});if(h.error)return wr(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error);let f=t.response(h.source).type(d).header("Content-Encoding","identity").header("Content-Length",p).header("Content-Disposition",Ni(m)?`attachment; filename*=UTF-8''${function(e){let t=Array.from(is(e)),i="";for(let e of t){let t="";try{t=encodeURIComponent(e)}catch(e){t="%EF%BF%BD"}i+=t}return i.replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}(m)}`:"attachment");return f}},G={path:`/${d}/dw`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.dw)},timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Ss.dw,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.fileId","");if(!Ni(o))return n.param("invalid fileId in payload");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=function(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!Ni(e))return n("invalid str");let s="";try{let t=cs.parse(e);s=us.stringify(t)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}(l.v.filename),d=l.v.fileSize,m=l.v.fileType,h=hr(u,d,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===is(Ae(e,"method","")).toLowerCase()});return h.error?(wr(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error)):t.response(h.source).type(m).header("Content-Encoding","identity").header("Content-Disposition",`attachment; filename="${p}"`).header("Content-Length",d)}};let P=null;if(Ae(r,"serverHapi"))try{y.route([z,Y,X,F,U,G])}catch(e){console.log("register routes error",e),v("error",`register routes error: ${ts(e)}`)}else P=async function(){c&&await y.register(n);let e=[];if(c){let t={method:"GET",path:"/{file*}",handler:{directory:{path:`${l}/`}}};e=[...e,t]}e=[...e,z,Y,X,F,U,G],y.route(e),await y.start(),console.log(`Server running at: ${y.info.uri}`)}().catch(e=>{console.log("start server error",e),v("error",`start server error: ${ts(e)}`)});return D.stop=async()=>{try{vn(P)&&await P,await y.stop()}catch(e){console.log("stop server error",e),L("error",`stop server error: ${ts(e)}`)}},D}var xr=function(){return S.Date.now()},Lr=Math.max,vr=Math.min;function Ir(e,t,i){var n,s,r,o,a,c,l=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=n,r=s;return n=s=void 0,l=t,o=e.apply(r,i)}function h(e){var i=e-c;return void 0===c||i>=t||i<0||p&&e-l>=r}function f(){var e=xr();if(h(e))return g(e);a=setTimeout(f,function(e){var i=t-(e-c);return p?vr(i,r-(e-l)):i}(e))}function g(e){return a=void 0,d&&n?m(e):(n=s=void 0,o)}function w(){var e=xr(),i=h(e);if(n=arguments,s=this,c=e,i){if(void 0===a)return function(e){return l=e,a=setTimeout(f,t),u?m(e):o}(c);if(p)return clearTimeout(a),a=setTimeout(f,t),m(c)}return void 0===a&&(a=setTimeout(f,t)),o}return t=Ui(t)||0,_(i)&&(u=!!i.leading,r=(p="maxWait"in i)?Lr(Ui(i.maxWait)||0,t):r,d="trailing"in i?!!i.trailing:d),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=s=a=void 0},w.flush=function(){return void 0===a?o:g(xr())},w}var br=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Cr=br;function Er(e,t,i){"__proto__"==t&&Cr?Cr(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function Tr(e,t,i){(void 0!==i&&!le(e[t],i)||void 0===i&&!(t in e))&&Er(e,t,i)}var Ar="object"==typeof exports&&exports&&!exports.nodeType&&exports,Sr=Ar&&"object"==typeof module&&module&&!module.nodeType&&module,Nr=Sr&&Sr.exports===Ar?S.Buffer:void 0,kr=Nr?Nr.allocUnsafe:void 0;function jr(e,t){if(t)return e.slice();var i=e.length,n=kr?kr(i):new e.constructor(i);return e.copy(n),n}function Zr(e){var t=new e.constructor(e.byteLength);return new $t(t).set(new $t(e)),t}function zr(e,t){var i=t?Zr(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Yr(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}var Xr=Object.create,Fr=function(){function e(){}return function(t){if(!_(t))return{};if(Xr)return Xr(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Ur(e){return"function"!=typeof e.constructor||Ne(e)?{}:Fr(cn(e))}function Gr(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Pr=Object.prototype.hasOwnProperty;function Kr(e,t,i){var n=e[t];Pr.call(e,t)&&le(n,i)&&(void 0!==i||t in e)||Er(e,t,i)}function Or(e,t,i,n){var s=!i;i||(i={});for(var r=-1,o=t.length;++r<o;){var a=t[r],c=n?n(i[a],e[a],a,i,e):void 0;void 0===c&&(c=e[a]),s?Er(i,a,c):Kr(i,a,c)}return i}var _r=Object.prototype.hasOwnProperty;function Wr(e){if(!_(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Ne(e),i=[];for(var n in e)("constructor"!=n||!t&&_r.call(e,n))&&i.push(n);return i}function Hr(e){return $e(e)?Kt(e,!0):Wr(e)}function Br(e,t,i,n,s,r,o){var a=Gr(e,i),c=Gr(t,i),l=o.get(c);if(l)Tr(e,i,l);else{var u,p=r?r(a,c,i+"",e,t,o):void 0,d=void 0===p;if(d){var m=E(c),h=!m&&St(c),f=!m&&!h&&Gt(c);p=c,m||h||f?E(a)?p=a:U(u=a)&&$e(u)?p=Yr(a):h?(d=!1,p=jr(c,!0)):f?(d=!1,p=zr(c,!0)):p=[]:hn(c)||Ct(c)?(p=a,Ct(a)?p=function(e){return Or(e,Hr(e))}(a):_(a)&&!W(a)||(p=Ur(c))):d=!1}d&&(o.set(c,p),s(p,c,n,r,o),o.delete(c)),Tr(e,i,p)}}function Vr(e,t,i,n,s){e!==t&&Dt(t,function(r,o){if(s||(s=new Vt),_(r))Br(e,t,o,i,Vr,n,s);else{var a=n?n(Gr(e,o),r,o+"",e,t,s):void 0;void 0===a&&(a=r),Tr(e,o,a)}},Hr)}var Qr=Math.max;var Rr=Cr?function(e,t){return Cr(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ii,Jr=Rr,qr=Date.now;var $r=function(e){var t=0,i=0;return function(){var n=qr(),s=16-(n-i);if(i=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Jr),eo=$r;function to(e,t){return eo(function(e,t,i){return t=Qr(void 0===t?e.length-1:t,0),function(){for(var n=arguments,s=-1,r=Qr(n.length-t,0),o=Array(r);++s<r;)o[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=i(o),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,a)}}(e,t,Ii),e+"")}var io,no=(io=function(e,t,i){Vr(e,t,i)},to(function(e,t){var i=-1,n=t.length,s=n>1?t[n-1]:void 0,r=n>2?t[2]:void 0;for(s=io.length>3&&"function"==typeof s?(n--,s):void 0,r&&Ei(t[0],t[1],r)&&(s=n<3?void 0:s,n=1),e=Object(e);++i<n;){var o=t[i];o&&io(e,o,i,s)}return e}));function so(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Ni(e))return n("invalid v");let s={};try{s=JSON.parse(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function ro(e,i={}){let n={};if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let s=Ae(i,"fpTableTags","");Ni(s)||(s="./tableTags.json");let r=Ae(i,"genTag");wn(r)||(r=()=>Yn()+"|"+Un(6));let o=(t,...i)=>{setTimeout(()=>{e.emit(t,...i)},1)};function a(){let e={};try{if(t.existsSync(s)){let i=so(t.readFileSync(s,"utf8"));Ai(i)&&(e=i)}}catch(e){o("error",{msg:"readTableTags catch",err:e})}return e}function c(){try{let e=function(e,t=!1,i={}){let n=Ae(i,"returnWithStateAndMsg",null);Oi(n)||(n=!1);let s=e=>n?{state:"error",msg:e}:"";if(tn(e))return s("invalid v");let r="";try{r=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){return s(e.toString())}return n?{state:"success",msg:r}:r}(n);t.writeFileSync(s,e,"utf8")}catch(e){o("error",{msg:"writeTableTags catch",err:e})}}let l=Ir(()=>{c(),o("changeTableTags",n)},200);return e.readTableTags=a,e.writeTableTags=c,e.initTableTags=function(e={},t="useInputFirst"){if("useInputOnly"===t)n=e;else if("useStorageOnly"===t)n=a();else if("useInputFirst"===t)n=no(a(),e);else{if("useStorageFirst"!==t)throw new Error(`invalid mode[${t}]`);n=no(e,a())}c()},e.setTableTags=function(e={}){n=no(n,e),c()},e.getTableTags=function(){return n},e.updateTableTag=function(e){n[e]=r(),l()},e}var oo=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)si(t,ui(e)),e=cn(e);return t}:ai;function ao(e){return ri(e,Hr,oo)}var co=Object.prototype.hasOwnProperty;var lo=/\w*$/;var uo=N?N.prototype:void 0,po=uo?uo.valueOf:void 0;function mo(e,t,i){var n,s,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Zr(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var i=t?Zr(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return zr(e,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(r=new(s=e).constructor(s.source,lo.exec(s))).lastIndex=s.lastIndex,r;case"[object Symbol]":return n=e,po?Object(po.call(n)):{}}}var ho=Ft&&Ft.isMap,fo=ho?Zt(ho):function(e){return U(e)&&"[object Map]"==Je(e)};var go=Ft&&Ft.isSet,wo=go?Zt(go):function(e){return U(e)&&"[object Set]"==Je(e)},Mo="[object Arguments]",yo="[object Function]",Do="[object Object]",xo={};function Lo(e,t,i,n,s,r){var o,a=1&t,c=2&t,l=4&t;if(i&&(o=s?i(e,n,s,r):i(e)),void 0!==o)return o;if(!_(e))return e;var u=E(e);if(u){if(o=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&co.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!a)return Yr(e,o)}else{var p=Je(e),d=p==yo||"[object GeneratorFunction]"==p;if(St(e))return jr(e,a);if(p==Do||p==Mo||d&&!s){if(o=c||d?{}:Ur(e),!a)return c?function(e,t){return Or(e,oo(e),t)}(e,function(e,t){return e&&Or(t,Hr(t),e)}(o,e)):function(e,t){return Or(e,ui(e),t)}(e,function(e,t){return e&&Or(t,Ot(t),e)}(o,e))}else{if(!xo[p])return s?e:{};o=mo(e,p,a)}}r||(r=new Vt);var m=r.get(e);if(m)return m;r.set(e,o),wo(e)?e.forEach(function(n){o.add(Lo(n,t,i,n,e,r))}):fo(e)&&e.forEach(function(n,s){o.set(s,Lo(n,t,i,s,e,r))});var h=u?void 0:(l?c?ao:pi:c?Hr:Ot)(e);return ds(h||e,function(n,s){h&&(n=e[s=n]),Kr(o,s,Lo(n,t,i,s,e,r))}),o}xo[Mo]=xo["[object Array]"]=xo["[object ArrayBuffer]"]=xo["[object DataView]"]=xo["[object Boolean]"]=xo["[object Date]"]=xo["[object Float32Array]"]=xo["[object Float64Array]"]=xo["[object Int8Array]"]=xo["[object Int16Array]"]=xo["[object Int32Array]"]=xo["[object Map]"]=xo["[object Number]"]=xo[Do]=xo["[object RegExp]"]=xo["[object Set]"]=xo["[object String]"]=xo["[object Symbol]"]=xo["[object Uint8Array]"]=xo["[object Uint8ClampedArray]"]=xo["[object Uint16Array]"]=xo["[object Uint32Array]"]=!0,xo["[object Error]"]=xo[yo]=xo["[object WeakMap]"]=!1;function vo(e){return Lo(e,5)}function Io(e={}){let t=Kn(),i={},n=null,s=Ae(e,"timeAlive");$i(s)||(s=1e4),s=qi(s),s=Math.min(s,On);let r=Ae(e,"timeDetect");return $i(r)||(r=50),r=qi(r),r=Math.min(r,On),t.trigger=function(e,o){Ni(e)?(ps(i,e)||setTimeout(()=>{Hn(t,"message",[{eventName:"enter",key:e,data:o,now:wt(i)}],{tag:"alive"})},1),i[e]={data:o,time:Date.now()},null===n&&(n=setInterval(()=>{ms(i,(e,n)=>{if(Date.now()-e.time>s){let e=vo(i[n]);delete i[n],Hn(t,"message",[{eventName:"leave",key:n,data:e.data,now:wt(i)}],{tag:"alive"})}}),Ai(i)||(clearInterval(n),n=null)},r))):console.log("trigger need key")},t.get=function(){let e=[];return ms(i,(t,i)=>{e.push({key:i,data:t.data})}),e=vo(e),e},t}function bo(e,t={}){let i={};if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let n=(t,...i)=>{setTimeout(()=>{e.emit(t,...i)},1)},s=Io(),r=setInterval(()=>{let e=ks(s.get(),"key"),t={};ms(e,e=>{t[e]=Ae(i,e,[])}),i=t},1e3);s.on("message",function({eventName:e,key:t,data:i,now:s}){"enter"===e?n("clientEnter",t,i):"leave"===e&&n("clientLeave",t,i),n("clientChange",s)}),e.on("execute",function(e,t,r){if("[sys:polling]"===e)try{let e=Ae(t,"clientId",""),n=Ae(i,e,[]);n=vo(n),i[e]=[],s.trigger(e,t),r.resolve(n)}catch(e){n("error",e),r.reject("[sys:polling] error")}});return e.getClients=s.get,e.getMessages=()=>vo(i),e.broadcast=e=>{if(!Ai(i))return;let t={};ms(i,(i,n)=>{i.push({mode:"broadcast",data:e}),t[n]=i}),i=t},e.clearBroadcast=()=>{clearInterval(r)},e}let Co=(e,t)=>{let i={};return ms(e,e=>{let n=e,s=Ae(t,e,"");Ni(s)&&(i[n]=s)}),i};function Eo(e,t,i,n={}){if(!Ai(e))throw new Error("invalid instWConverServer");if(0===wt(t))return e;if(!Ai(i))return e;let s=Ae(n,"genTag");wn(s)||(s=()=>Yn()+"|"+Un(6));let r={};return ms(t,e=>{r[e]=s()}),e.initTableTags(r,"useInputOnly"),ms(t,t=>{let n=i[t];if(!n)throw new Error(`invalid kpOrm[${t}]`);try{n.on("change",()=>{e.updateTableTag(t)})}catch(e){throw new Error(`kpOrm[${t}] can not listen to change events`)}}),e.on("changeTableTags",i=>{e.broadcast({mode:"syncKpTable",data:Co(t,i)})}),e}function To(e,t,i,n){for(var s=i-1,r=e.length;++s<r;)if(n(e[s],t))return s;return-1}var Ao=Array.prototype.splice;function So(e,t){return e&&e.length&&t&&t.length?function(e,t,i,n){var s=n?To:zs,r=-1,o=t.length,a=e;for(e===t&&(t=Yr(t)),i&&(a=xe(e,Zt(i)));++r<o;)for(var c=0,l=t[r],u=i?i(l):l;(c=s(a,u,c,n))>-1;)a!==e&&Ao.call(a,c,1),Ao.call(e,c,1);return e}(e,t):e}function No(e,t={}){if(!Ai(e))throw new Error("invalid instWConverServer");let i=Ae(t,"getUserIdByToken",null);wn(i)||(i=async()=>"");let n=Ae(t,"useDbOrm",null);Oi(n)||(n=!1);let s=null;if(n&&(s=Ae(t,"operOrm",null),!wn(s)))throw new Error("invalid opt.operOrm when useDbOrm=true");let r=[];if(n&&(r=Ae(t,"tableNames",null),!en(r)))throw new Error("invalid opt.tableNames when useDbOrm=true");let o=[];n&&(o=Ae(t,"methods",null),en(o)||(o=["select","insert","save","del"]));let a=Ae(t,"kpFunExt",null);let c={};async function l(e,t,n){if(!Ni(e))return n.resolve({state:"error",msg:"invalid func"}),n;let s="";if(!ps(t,"__sysToken__"))return n.resolve({state:"error",msg:"invalid token"}),n;if(s=is(t.__sysToken__),!ps(t,"__sysInputArgs__"))return n.resolve({state:"error",msg:"invalid input"}),n;t=t.__sysInputArgs__;let r="";if(r=i(s),vn(r)&&(r=await r),Ni(r)||(r=""),"[sys:getFuncList]"===e){let e=Ot(c);e=function(e,t){if(!on(e))return[];if((Ti(t)||Wi(t)||Si(t)||Oi(t))&&(t=[t]),!on(t))return e;let i=vo(e);return So(i,t),i}(e,"[sys:getTableTags]");let t={state:"success",msg:e};return n.resolve(t),n}if(!ps(c,e))return n.resolve({state:"error",msg:`invalid func[${e}]`}),n;let o=c[e];try{let e=await In(o)(r,...t);n.resolve(e)}catch(t){n.resolve({state:"error",msg:`call func[${e}] has an error: ${t.message}`})}return n}return n&&(r=vo(r),c=function(e,t,i){let n={};return ms(e,e=>{ms(t,t=>{n[`${e}.${t}`]=async function(n,s){return await i(n,e,t,s)}})}),n}(r,o,s)),Ai(a)&&ms(a,(e,t)=>{c[t]=e}),e.on("execute",async function(t,i,n){await l(t,i,n).catch(i=>{e.emit("error",i),n.resolve({state:"error",msg:`execFun func[${t}] has an error: ${i.message}`})})}),e}function ko(e,t={}){if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let i=Ae(t,"fpTableTags",null);Ni(i)||(i="./tableTags.json");let n=Ae(t,"genTag");wn(n)||(n=()=>Yn()+"|"+Un(6)),e=new bo(e=new ro(e,{fpTableTags:i,genTag:n}));let s=Ae(t,"useDbOrm",null);Oi(s)||(s=!0);let r=Ae(t,"kpOrm",null),o=Ae(t,"operOrm",null),a=Ae(t,"tableNamesExec",null),c=Ae(t,"methodsExec",null),l=Ae(t,"tableNamesSync",null),u=Ae(t,"getUserIdByToken",null),p=Ae(t,"kpFunExt",null);if(Ai(p)||(p={}),p={...p,"[sys:getTableTags]":()=>{let t=e.getTableTags();return{mode:"syncKpTable",data:Co(l,t)}}},e=new No(e,{getUserIdByToken:u,useDbOrm:s,operOrm:o,tableNames:a,methods:c,kpFunExt:p}),s){if(!Ti(r))return e.emit("error","invalid opt.kpOrm when useDbOrm=true"),e;e=new Eo(e,l,r,{genTag:n})}return e}function jo(e={}){let t=Kn(),s=null,r=null,o=Ae(e,"port");Bi(o)||(o=8080);let a=Ae(e,"corsOrigins",[]);on(a)||(a=["http://localhost"]);let c=Ae(e,"delayForSlice","");Mn(c)||(c=100),c=qi(c);let l=Ae(e,"useInert");Oi(l)||(l=!0);let u=Ae(e,"pathStaticFiles");Ni(u)||(u="dist");let p=Ae(e,"apis");on(p)||(p=[]);let d=Ae(e,"apiName");Ni(d)||(d="api");let m=Ae(e,"pathUploadTemp");Ni(m)||(m="./uploadTemp"),En(m)||Wn(m);let h=Ae(e,"tokenType");Ni(h)||(h="Bearer");let f=Ae(e,"sizeSlice");$i(f)||(f=1048576);let g=Ae(e,"sizeMsg");$i(g)||(g=104857600);let w=Ae(e,"verifyConn");wn(w)||(w=()=>!0);let M=Ae(e,"getUserIdByToken",null),y=Ae(e,"useDbOrm",null);Oi(y)||(y=!0);let D=Ae(e,"kpOrm",null),x=Ae(e,"operOrm",null),L=Ae(e,"tableNamesExec",null),v=Ae(e,"methodsExec",null),I=Ae(e,"tableNamesSync",null),b=Ae(e,"kpFunExt",null),C=Ae(e,"fpTableTags",null);Ni(C)||(C=Ae(e,"fnTableTags",null));let E=Ae(e,"genTag");wn(E)||(E=()=>Yn()+"|"+Un(6));let T=Ae(e,"useShowLog");Oi(T)||(T=!0);(async()=>{await(async()=>{s=new i.Server({port:o,routes:{timeout:{server:!1,socket:!1},cors:{origin:a,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}}}),l&&await s.register(n);let e=[];l&&(e=[{method:"GET",path:"/{file*}",handler:{directory:{path:`${u}/`}}}]),e=[...e,...p],s.route(e)})(),await(async()=>{r=new Dr({serverHapi:s,apiName:d,pathUploadTemp:m,tokenType:h,sizeSlice:f,sizeMsg:g,verifyConn:w,corsOrigins:a,delayForSlice:c}),r.on("clientChange",function(e){T&&console.log(`Server[port:${o}]: now clients: ${e}`)})})(),await(async()=>{r=new ko(r,{getUserIdByToken:M,useDbOrm:y,kpOrm:D,operOrm:x,tableNamesExec:L,tableNamesSync:I,methodsExec:v,kpFunExt:b,fpTableTags:C,genTag:E}),r.on("error",e=>{t.emit("error",e)})})(),await s.start(),T&&console.log(`Server running at: ${s.info.uri}`)})().catch(e=>{t.emit("error",e)}),process.on("unhandledRejection",e=>{console.log("unhandledRejection",e),t.emit("error",{mode:"unhandledRejection",err:e})}),process.on("uncaughtException",e=>{console.log("uncaughtException",e),t.emit("error",{mode:"uncaughtException",err:e})});return t.getServer=async()=>(await _n(()=>null!==s),s),t.getInstWConverServer=async()=>(await _n(()=>null!==r),r),t}function Zo(e,t){let i=Ln();if(!en(e)&&!Ti(e))return i.reject("rs is not an array or object"),i;let n=!1;if(Ti(e)){n=!0;let t=[];ms(e,(e,i)=>{t.push({k:i,v:e})}),e=t}wn(t)||(t=function(e){return e});let s=-1,r=[];return e.reduce(function(e,i){return e.then(function(e){r.push(e),s+=1;let o=s,a=i;return n&&(o=i.k,a=i.v),wn(t)?t(a,o):a})},Promise.resolve()).then(function(e){var t,n,s,o;r.push(e),o=null==(t=r)?0:t.length,r=o?js(t,(n=s||void 0===n?1:Ki(n))<0?0:n,o):[],i.resolve(r)}).catch(function(e){i.reject(e)}),i}let zo={backup:async function(e){return await Zo(e,async(e,t)=>(console.log("backup...",t),{name:t,data:await e.select()}))},recover:async function(e,i,n,s=!1){if(!An(e))throw console.log("fp",e),new Error("fp is not exist");if(!Ai(i))throw console.log("woItems",i),new Error("invalid woItems");wn(n)||(n=null),Oi(s)||(s=!1);let r=t.readFileSync(e,"utf8");r=Qs(r);let o=so(r);wn(n)&&n(),await Zo(o,async e=>{console.log("recover...",e.name),s&&(console.log("needCreateStorage"),await i[e.name].createStorage());let t=null;return wt(e.data)>0&&(t=await i[e.name].insert(e.data)),t})}};function Yo(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}var Xo={exports:{}},Fo={},Uo={exports:{}},Go={};function Po(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Ko=/javascript\s*\:/gim;Go.whiteList=Po(),Go.getDefaultWhiteList=Po,Go.onAttr=function(e,t,i){},Go.onIgnoreAttr=function(e,t,i){},Go.safeAttrValue=function(e,t){return Ko.test(t)?"":t};var Oo={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,s;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,s=e.length;n<s;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},_o=Oo;var Wo=function(e,t){";"!==(e=_o.trimRight(e))[e.length-1]&&(e+=";");var i=e.length,n=!1,s=0,r=0,o="";function a(){if(!n){var i=_o.trim(e.slice(s,r)),a=i.indexOf(":");if(-1!==a){var c=_o.trim(i.slice(0,a)),l=_o.trim(i.slice(a+1));if(c){var u=t(s,o.length,c,l,i);u&&(o+=u+"; ")}}}s=r+1}for(;r<i;r++){var c=e[r];if("/"===c&&"*"===e[r+1]){var l=e.indexOf("*/",r+2);if(-1===l)break;s=(r=l+1)+1,n=!1}else"("===c?n=!0:")"===c?n=!1:";"===c?n||a():"\n"===c&&a()}return _o.trim(o)},Ho=Go,Bo=Wo;function Vo(e){return null==e}function Qo(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).whiteList=e.whiteList||Ho.whiteList,e.onAttr=e.onAttr||Ho.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Ho.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Ho.safeAttrValue,this.options=e}Qo.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,i=t.whiteList,n=t.onAttr,s=t.onIgnoreAttr,r=t.safeAttrValue;return Bo(e,function(e,t,o,a,c){var l=i[o],u=!1;if(!0===l?u=l:"function"==typeof l?u=l(a):l instanceof RegExp&&(u=l.test(a)),!0!==u&&(u=!1),a=r(o,a)){var p,d={position:t,sourcePosition:e,source:c,isWhite:u};return u?Vo(p=n(o,a,d))?o+":"+a:p:Vo(p=s(o,a,d))?void 0:p}})};var Ro=Qo;!function(e,t){var i=Go,n=Ro;for(var s in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,i)t[s]=i[s];"undefined"!=typeof window&&(window.filterCSS=e.exports)}(Uo,Uo.exports);var Jo=Uo.exports,qo={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,s;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,s=e.length;n<s;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},$o=Jo.FilterCSS,ea=Jo.getDefaultWhiteList,ta=qo;function ia(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var na=new $o;function sa(e){return e.replace(ra,"<").replace(oa,">")}var ra=/</g,oa=/>/g,aa=/"/g,ca=/"/g,la=/&#([a-zA-Z0-9]*);?/gim,ua=/:?/gim,pa=/&newline;?/gim,da=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ma=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ha=/u\s*r\s*l\s*\(.*/gi;function fa(e){return e.replace(aa,""")}function ga(e){return e.replace(ca,'"')}function wa(e){return e.replace(la,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function Ma(e){return e.replace(ua,":").replace(pa," ")}function ya(e){for(var t="",i=0,n=e.length;i<n;i++)t+=e.charCodeAt(i)<32?" ":e.charAt(i);return ta.trim(t)}function Da(e){return e=ya(e=Ma(e=wa(e=ga(e))))}function xa(e){return e=sa(e=fa(e))}Fo.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Fo.getDefaultWhiteList=ia,Fo.onTag=function(e,t,i){},Fo.onIgnoreTag=function(e,t,i){},Fo.onTagAttr=function(e,t,i){},Fo.onIgnoreTagAttr=function(e,t,i){},Fo.safeAttrValue=function(e,t,i,n){if(i=Da(i),"href"===t||"src"===t){if("#"===(i=ta.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(da.lastIndex=0,da.test(i))return""}else if("style"===t){if(ma.lastIndex=0,ma.test(i))return"";if(ha.lastIndex=0,ha.test(i)&&(da.lastIndex=0,da.test(i)))return"";!1!==n&&(i=(n=n||na).process(i))}return i=xa(i)},Fo.escapeHtml=sa,Fo.escapeQuote=fa,Fo.unescapeQuote=ga,Fo.escapeHtmlEntities=wa,Fo.escapeDangerHtml5Entities=Ma,Fo.clearNonPrintableCharacter=ya,Fo.friendlyAttrValue=Da,Fo.escapeAttrValue=xa,Fo.onIgnoreTagStripAll=function(){return""},Fo.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var i=!Array.isArray(e),n=[],s=!1;return{onIgnoreTag:function(r,o,a){if(function(t){return!!i||-1!==ta.indexOf(e,t)}(r)){if(a.isClosing){var c="[/removed]",l=a.position+10;return n.push([!1!==s?s:a.position,l]),s=!1,c}return s||(s=a.position),"[removed]"}return t(r,o,a)},remove:function(e){var t="",i=0;return ta.forEach(n,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}},Fo.stripCommentTag=function(e){for(var t="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var s=e.indexOf("--\x3e",n);if(-1===s)break;i=s+3}return t},Fo.stripBlankChar=function(e){var t=e.split("");return(t=t.filter(function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})).join("")},Fo.attributeWrapSign='"',Fo.cssFilter=na,Fo.getDefaultCSSWhiteList=ea;var La={},va=qo;function Ia(e){var t,i=va.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=va.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}function ba(e){return"</"===e.slice(0,2)}var Ca=/[^a-zA-Z0-9\\_:.-]/gim;function Ea(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Ta(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}}function Aa(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Sa(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}La.parseTag=function(e,t,i){var n="",s=0,r=!1,o=!1,a=0,c=e.length,l="",u="";e:for(a=0;a<c;a++){var p=e.charAt(a);if(!1===r){if("<"===p){r=a;continue}}else if(!1===o){if("<"===p){n+=i(e.slice(s,a)),r=a,s=a;continue}if(">"===p||a===c-1){n+=i(e.slice(s,r)),l=Ia(u=e.slice(r,a+1)),n+=t(r,n.length,l,u,ba(u)),s=a+1,r=!1;continue}if('"'===p||"'"===p)for(var d=1,m=e.charAt(a-d);""===m.trim()||"="===m;){if("="===m){o=p;continue e}m=e.charAt(a-++d)}}else if(p===o){o=!1;continue}}return s<c&&(n+=i(e.substr(s))),n},La.parseAttr=function(e,t){var i=0,n=0,s=[],r=!1,o=e.length;function a(e,i){if(!((e=(e=va.trim(e)).replace(Ca,"").toLowerCase()).length<1)){var n=t(e,i||"");n&&s.push(n)}}for(var c=0;c<o;c++){var l,u=e.charAt(c);if(!1!==r||"="!==u)if(!1===r||c!==n)if(/\s|\n|\t/.test(u)){if(e=e.replace(/\s|\n|\t/g," "),!1===r){if(-1===(l=Ea(e,c))){a(va.trim(e.slice(i,c))),r=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=Aa(e,c-1))){a(r,Sa(va.trim(e.slice(i,c)))),r=!1,i=c+1;continue}}else;else{if(-1===(l=e.indexOf(u,c+1)))break;a(r,va.trim(e.slice(n+1,l))),r=!1,i=(c=l)+1}else r=e.slice(i,c),i=c+1,n='"'===e.charAt(i)||"'"===e.charAt(i)?i:Ta(e,c+1)}return i<e.length&&(!1===r?a(e.slice(i)):a(r,Sa(va.trim(e.slice(i))))),va.trim(s.join(" "))};var Na=Jo.FilterCSS,ka=Fo,ja=La,Za=ja.parseTag,za=ja.parseAttr,Ya=qo;function Xa(e){return null==e}function Fa(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=ka.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=function(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(e){return e.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}(e.whiteList||e.allowList):e.whiteList=ka.whiteList,this.attributeWrapSign=!0===e.singleQuotedAttributeValue?"'":ka.attributeWrapSign,e.onTag=e.onTag||ka.onTag,e.onTagAttr=e.onTagAttr||ka.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||ka.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||ka.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||ka.safeAttrValue,e.escapeHtml=e.escapeHtml||ka.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Na(e.css))}Fa.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this,i=t.options,n=i.whiteList,s=i.onTag,r=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,c=i.safeAttrValue,l=i.escapeHtml,u=t.attributeWrapSign,p=t.cssFilter;i.stripBlankChar&&(e=ka.stripBlankChar(e)),i.allowCommentTag||(e=ka.stripCommentTag(e));var d=!1;i.stripIgnoreTagBody&&(d=ka.StripTagBody(i.stripIgnoreTagBody,r),r=d.onIgnoreTag);var m=Za(e,function(e,t,i,d,m){var h={sourcePosition:e,position:t,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(n,i)},f=s(i,d,h);if(!Xa(f))return f;if(h.isWhite){if(h.isClosing)return"</"+i+">";var g=function(e){var t=Ya.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=Ya.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=Ya.trim(e.slice(0,-1))),{html:e,closing:i}}(d),w=n[i],M=za(g.html,function(e,t){var n=-1!==Ya.indexOf(w,e),s=o(i,e,t,n);return Xa(s)?n?(t=c(i,e,t,p))?e+"="+u+t+u:e:Xa(s=a(i,e,t,n))?void 0:s:s});return d="<"+i,M&&(d+=" "+M),g.closing&&(d+=" /"),d+=">"}return Xa(f=r(i,d,h))?l(d):f},l);return d&&(m=d.remove(m)),m};var Ua=Fa;!function(e,t){var i=Fo,n=La,s=Ua;function r(e,t){return new s(t).process(e)}(t=e.exports=r).filterXSS=r,t.FilterXSS=s,function(){for(var e in i)t[e]=i[e];for(var s in n)t[s]=n[s]}(),"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(Xo,Xo.exports);var Ga=kn(Xo.exports);function Pa(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}function Ka(e){let t=function(){let e=Pa();return Ga||e.xss}();let i=function e(i){return en(i)||Ti(i)?(ms(i,function(t,n){i[n]=e(t)}),i):Ni(i)?t(i,{onIgnoreTagAttr:function(e,i,n,s){if("style"===i)return i+'="'+t.escapeAttrValue(n)+'"'}}):i}(vo(e));return i}let Oa=null,_a=null;function Wa(e,t,i,n="save"){if(!Ai(Oa))throw console.log("ds",Oa),new Error("invalid ds");let s=Oa[e].keys,r=!1;en(i)||(r=!0,i=[i]);let o=Yo();return n.indexOf("insert")>=0&&(s.indexOf("userId")>=0&&ms(i,(e,n)=>{i[n].userId=t}),s.indexOf("timeCreate")>=0&&ms(i,(e,t)=>{i[t].timeCreate=o}),s.indexOf("userIdUpdate")>=0&&ms(i,(e,n)=>{i[n].userIdUpdate=t}),s.indexOf("timeUpdate")>=0&&ms(i,(e,t)=>{i[t].timeUpdate=o})),(n.indexOf("insert")>=0||n.indexOf("save")>=0)&&(s.indexOf("userIdUpdate")>=0&&ms(i,(e,n)=>{i[n].userIdUpdate=t}),s.indexOf("timeUpdate")>=0&&ms(i,(e,t)=>{i[t].timeUpdate=o})),i=ks(i,(e,t)=>{let i={};return ms(e,(e,t)=>{e=Ka(e),i[t]=e}),i}),i=r?i[0]:i}async function Ha(e,t,i,n){let s,r=null;if(!Ai(_a))return Promise.reject("無有效woItems");let o=Ae(_a,t,null);if(null===o)return Promise.reject(`ORM找不到表名稱: ${t}`);if("select"===i){if(s=await o.select(n).catch(e=>{console.log(`${t}.select catch`,e),r="取得資料失敗"}),Ni(r))return Promise.reject(r)}else if("insert"===i||"save"===i){try{n=Wa(t,e,n,i)}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if("insert"===i?s=await o.insert(n).catch(e=>{console.log(`${t}.save catch`,e),r="新增資料失敗"}):"save"===i&&(s=await o.save(n).catch(e=>{console.log(`${t}.save catch`,e),r="儲存資料失敗"})),Ni(r))return Promise.reject(r);s=en(n)?ks(n,e=>({id:e.id})):{id:n.id}}else if("del"===i)s=await o.del(n).catch(e=>{console.log(`${t}.del catch`,e),r="刪除資料失敗"});else if("delAll"===i)s=await o.delAll(n).catch(e=>{console.log(`${t}.delAll catch`,e),r="刪除資料失敗"});else if("mix"===i){if(!Ai(n))return Promise.reject("mix僅支援輸入ltdtDiffByKey結果物件");let i;s=[];let a=Ae(n,"add",[]);if(wt(a)>0){try{a=Wa(t,e,a,"insert+save")}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if(await o.insert(a).catch(e=>{console.log(`${t}.save catch`,e),r="新增資料失敗"}),Ni(r))return Promise.reject(r);i=ks(a,e=>({id:e.id})),s=[...s,...i]}let c=Ae(n,"del",[]);if(wt(c)>0){if(await o.del(c).catch(e=>{console.log(`${t}.save catch`,e),r="刪除資料失敗"}),Ni(r))return Promise.reject(r);i=ks(c,e=>({id:e.id})),s=[...s,...i]}let l=Ae(n,"diff",[]);if(wt(l)>0){try{l=Wa(t,e,l)}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if(await o.save(l).catch(e=>{console.log(`${t}.save catch`,e),r="變更資料失敗"}),Ni(r))return Promise.reject(r);i=ks(l,e=>({id:e.id})),s=[...s,...i]}}else r=`invalid mode: ${i}`;return Ni(r)?Promise.reject(r):s}function Ba(e,t){return Oa=e,_a=t,Ha}function Va(e,t){var i=[];return Ht(e,function(e,n,s){t(e,n,s)&&i.push(e)}),i}function Qa(e,t){return(E(e)?oi:Va)(e,Ci(t))}function Ra(e,t=null){if(!en(e)){let e=Ln();return e.reject("pms is not an array"),e}return e.reduce((e,t)=>e.then(t),Promise.resolve(t))}let Ja=[],qa=[],$a=[],ec=null,tc=null,ic=!0,nc=!0;function sc(e){setTimeout(()=>{Ja.push(e)},1)}function rc(e){setTimeout(()=>{qa.push(e)},1)}function oc(e){setTimeout(()=>{$a.push(e)},1)}async function ac(e,t,i,n){if(!wn(ec))return Promise.reject("invalid mapOrm");if(ic&&!Ni(e))return console.log("userId",e),console.log("找不到使用者主鍵"),Promise.reject("找不到使用者主鍵");let s="n";if(ic){if(!wn(tc))return Promise.reject("invalid getUserById");let t=await tc(e);if(!t)return console.log("userId",e),console.log("找不到使用者資訊"),Promise.reject("找不到使用者資訊");s=Ae(t,"isAdmin"),"y"!==s&&"n"!==s&&(s="n");let i=Ae(t,"isActive");if("y"!==i&&"n"!==i&&(i="n"),"y"!==i)return console.log("userId",e),console.log("oSelf",t),console.log("使用者被停權或無有效使用者資訊"),Promise.reject("使用者被停權或無有效使用者資訊")}if(await Zo(Ja,r=>r({woName:t,userId:e,isAdmin:s,mode:i,input:n})),wt(qa)>0){let r={woName:t,userId:e,isAdmin:s,mode:i,input:n},o=await Ra(qa,r);n=o.input}let r=await ec(e,t,i,n);return nc&&"n"===s&&"select"===i&&en(r)&&(r=Qa(r,e=>!ps(e,"isActive")||!("n"===e.isActive))),wt($a)>0&&(r=await Ra($a,{woName:t,userId:e,isAdmin:s,mode:i,input:n,output:r})),r}function cc(e,t,i,n,s={}){let r=function(e,t,i,n){if(!Ai(e))throw console.log("ds",e),new Error("invalid ds");if(!wn(t))throw console.log("WOrm",t),new Error("invalid WOrm");if(!Ni(i))throw console.log("url",i),new Error("invalid url");if(!Ni(n))throw console.log("db",n),new Error("invalid db");let s={};return ms(Ot(e),e=>{let r=new t({url:i,db:n,cl:e});s[e]=r}),s}(e,t,i,n),o=function(e,t={}){return wn(e)?(ec=e,ic=Ae(t,"useCheckUser"),Oi(ic)||(ic=!0),tc=Ae(t,"getUserById"),nc=Ae(t,"useExcludeWhenNotAdmin"),Oi(nc)||(nc=!0),{addFunCheck:sc,addFunPreProcessing:rc,addFunPostProcessing:oc,procOrm:ac}):Promise.reject("invalid mapOrm")}(Ba(e,r),s);return{...zo,woItems:r,closeAll:async()=>{await Zo(r,async e=>{e&&wn(e.close)&&await e.close()})},...o}}const lc=[];for(let e=0;e<256;++e)lc.push((e+256).toString(16).slice(1));const uc=new Uint8Array(16);function pc(){return crypto.getRandomValues(uc)}const dc={};function mc(e,t,i){let n;if(e)n=hc(e.random??e.rng?.()??pc(),e.msecs,e.seq,t,i);else{const e=Date.now(),s=pc();!function(e,t,i){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=fc(i),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(dc,e,s),n=hc(s,dc.msecs,dc.seq,t,i)}return t??function(e,t=0){return(lc[e[t+0]]+lc[e[t+1]]+lc[e[t+2]]+lc[e[t+3]]+"-"+lc[e[t+4]]+lc[e[t+5]]+"-"+lc[e[t+6]]+lc[e[t+7]]+"-"+lc[e[t+8]]+lc[e[t+9]]+"-"+lc[e[t+10]]+lc[e[t+11]]+lc[e[t+12]]+lc[e[t+13]]+lc[e[t+14]]+lc[e[t+15]]).toLowerCase()}(n)}function hc(e,t,i,n,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(s<0||s+16>n.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else n=new Uint8Array(16),s=0;return t??=Date.now(),i??=fc(e),n[s++]=t/1099511627776&255,n[s++]=t/4294967296&255,n[s++]=t/16777216&255,n[s++]=t/65536&255,n[s++]=t/256&255,n[s++]=255&t,n[s++]=112|i>>>28&15,n[s++]=i>>>20&255,n[s++]=128|i>>>14&63,n[s++]=i>>>6&255,n[s++]=i<<2&255|3&e[10],n[s++]=e[11],n[s++]=e[12],n[s++]=e[13],n[s++]=e[14],n[s++]=e[15],n}function fc(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function gc(){return mc()}function wc(e,t,i=""){if(!on(t))return{};let n={};return ms(t,function(t){n[t]=Ae(e,t,i)}),n}let Mc={id:{pk:!0,name:"主鍵",type:"STRING"},ip:{name:"IP",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"}},yc={id:{pk:!0,name:"主鍵",type:"STRING"},token:{name:"金鑰",type:"STRING"},userId:{name:"使用者主鍵",type:"STRING"},isApp:{name:"是否為應用系統",type:"STRING"},perms:{name:"應用系統權限",type:"TEXT"},timeCreate:{name:"創建時間",type:"STRING"},timeEnd:{name:"到期時間",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"}},Dc={id:{pk:!0,name:"主鍵",type:"STRING"},order:{name:"順序",type:"INTEGER"},account:{name:"帳號",type:"STRING"},password:{name:"密碼",type:"STRING"},name:{name:"姓名",type:"STRING"},email:{name:"電子郵件",type:"STRING"},description:{name:"描述",type:"TEXT"},from:{name:"來源",type:"STRING"},redir:{name:"登入後轉址",type:"STRING"},isAdmin:{name:"是否為系統管理員",type:"STRING"},tokenVerify:{name:"註冊後驗證用token",type:"STRING"},timeVerified:{name:"驗證時間",type:"STRING"},timeExpired:{name:"過期時間",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"},isForceChangePw:{name:"是否須強制變更密碼",type:"STRING"},userId:{name:"創建使用者主鍵",type:"STRING"},timeCreate:{name:"創建時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"},isActive:{name:"是否有效",type:"STRING"}};function xc(e,t={}){let i=Ae(t,"useCreateStorage");Oi(i)||(i=!1);let{keyTable:n,tableNameCht:s,tableNameEng:r,settings:o,parser:a,funNew:c,funTest:l,ext:u}=e;if(!Ni(n))throw new Error(`invalid keyTable[${n}]`);if(Ni(s)||(s=n),Ni(r)||(r=n),!Ai(o))throw new Error("invalid settings");Ai(u)||(u=null),Ai(a)||(a=null),wn(c)||(c=null);let p=null;wn(l)&&(p=async e=>{if(!Ai(e))throw new Error("invalid wo");if(!ps(e,n))throw console.log(e),new Error(`keyTable[${n}] is not in wo`);let t=[];try{t=l(),vn(t)&&(t=await t)}catch(e){throw console.log(`keyTable[${n}] funTest catch`,e),new Error(e)}if(0!==wt(t))return i&&await e[n].createStorage(),await e[n].save(t),t});let d={},m={};return ms(Ot(o),e=>{let t=Ae(o,`${e}.name`,"");Ni(t)&&(d[e]=t);let i=Ae(o,`${e}.type`,"");Ni(i)&&(m[e]=i)}),{...e,keyTable:n,tableNameCht:s,tableNameEng:r,settings:o,keys:Ot(o),kpType:m,kpHead:d,parser:a,funNew:c,funTest:l,funTestAndSave:p,ext:u}}let Lc={ips:{keyTable:"ips",tableNameCht:"IP使用者",tableNameEng:"IPs",settings:Mc,funNew:(e={})=>{let t=wc(e,Ot(Mc));return t.id=`${gc()}`,t},funTest:()=>[]},tokens:{keyTable:"tokens",tableNameCht:"金鑰",tableNameEng:"Tokens",settings:yc,funNew:(e={})=>{let t=wc(e,Ot(yc));return t.id=`${gc()}`,t.token=`${gc()}`,en(t.perms)||(t.perms=[]),t.timeCreate=Yo(),t.timeEnd=zn().add(30,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),t.timeUpdate=t.timeCreate,t},funTest:()=>[]},users:{keyTable:"users",tableNameCht:"使用者",tableNameEng:"Users",settings:Dc,funNew:(e={})=>{let t=wc(e,Ot(Dc));return t.id=`${gc()}`,t.timeCreate=Yo(),t.userIdUpdate=t.userId,t.timeUpdate=t.timeCreate,t.isActive="y","y"!==t.isForceChangePw&&"n"!==t.isForceChangePw&&(t.isForceChangePw="n"),t},funTest:()=>[]}},vc={};for(let e in Lc)vc[e]=xc(Lc[e],{useCreateStorage:!1});function Ic(e){let t;return t=Dn(e,1),"Z"===t?`${e=xn(e,1)}+00:00`:e}let bc={checkTZ:function(e){let t;return t=Dn(e,1),"Z"===t||(t=Dn(e,6),!!/[+|-]\d\d:\d\d/.test(t))},delTZ:function(e){let t;return t=Dn(e,1),xn(e,"Z"===t?1:6)},normTZ:Ic,sepTZ:function(e){let t=Ic(e);return{t:xn(t,6),tz:Dn(t,6)}}};function Cc(e){if(!Ni(e))return!1;if(!bc.checkTZ(e))return!1;let t=bc.delTZ(e),i="YYYY-MM-DDTHH:mm:ss.SSS";return t===zn(t,i).format(i)}function Ec(e){let t=Ae(e,"timeExpired","");return!!Cc(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=t}function Tc(e){let t=Ae(e,"timeBlocked","");return!!Cc(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}function Ac(e){return"y"===Ae(e,"isActive","")}function Sc(e){let t=Cc(Ae(e,"timeVerified",""));let i=!Ec(e),n=!Tc(e),s=function(e){return"y"===Ae(e,"isAdmin","")}(e),r=Ac(e);return t&&i&&n&&s&&r}let Nc=a.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(lp).href:"undefined"==typeof document?location.href:C&&"SCRIPT"===C.tagName.toUpperCase()&&C.src||new URL("w-web-sso.umd.js",document.baseURI).href),kc=e.dirname(Nc);function jc(e){if(en(e))return e.map(jc);if(null==e||""===e)return"";if(!Ni(e))return`(${typeof e})`;let t=null;try{t=new URL(e)}catch(e){return"(invalid-url)"}return"http:"!==t.protocol&&"https:"!==t.protocol?t.protocol:`${t.origin}${t.pathname}`}let Zc=(i={})=>{let n=Ae(i,"logFd","");Ni(n)||(n="./logs");let s=Ae(i,"logInterval","");Ni(s)||(s="hr");let r=Ae(i,"logNumKeep",null),o={fdLog:n,interval:s};if(null!=r&&""!==r){if(!$i(r))throw new Error(`invalid logNumKeep[${r}], must be positive integer`);o.numKeep=qi(r)}let a=function(i={}){let n=Kn(),s=Ae(i,"timeZone",null),r=Ae(i,"fdLog");Ni(r)||(r="./_logs");let o=Ae(i,"interval");"day"!==o&&"hr"!==o&&(o="day");let a=Ae(i,"numKeep");$i(a)||(a="day"===o?365:8760),a=qi(a);let l=c.transport({targets:[{level:"info",target:e.resolve(kc,"./formatter.mjs"),options:{interval:o,fdLog:r,timeZone:s}}]}),u=c(l),p=()=>{try{if(!En(r))return;let i="hr"===o?/^\d{4}-\d{2}-\d{2}T\d{2}\.log$/:/^\d{4}-\d{2}-\d{2}\.log$/,s=t.readdirSync(r).filter(e=>i.test(e));s.sort();let c=s.length-a;if(c<=0)return;let l=s.slice(0,c);for(let i of l){let s=e.join(r,i);try{t.unlinkSync(s),n.emit("delete",{fp:s,fn:i})}catch(e){}}}catch(e){console.error("WSyslog cleanLogs error:",e)}};p();let d=setInterval(p,36e5);d.unref();let m=null,h=e=>{let t=u[e].bind(u);return(...i)=>{try{n.emit(e,{args:i})}catch(e){}t(...i)}};return n.fatal=h("fatal"),n.error=h("error"),n.warn=h("warn"),n.info=h("info"),n.debug=h("debug"),n.trace=h("trace"),n.cleanLogs=p,n.clear=(e={})=>{if(null!==m)return m;let t=Ae(e,"timeLimit");$i(t)||(t=6e4),m=Ln();let i=!1,n=()=>{i||(i=!0,clearInterval(d),m.resolve())},s=setTimeout(()=>{try{l.worker.terminate()}catch(e){}n()},t);try{u.flush(e=>{if(e||l.closed)return clearTimeout(s),void n();l.once("close",()=>{clearTimeout(s),n()}),l.end()})}catch(e){clearTimeout(s),n()}return m},n}(o);return a};function zc(e){if(en(e))return e.map(zc);if(null==e||""===e)return"";if(!Ni(e))return`(${typeof e})`;let t=e.length,i=Math.min(4,Math.floor(t/8));if(0===i)return`(len=${t})`;let n=e=>Array.from(e,e=>{let t=e.charCodeAt(0);return t<32||127===t?"?":e}).join("");return`${n(e.slice(0,i))}...${n(e.slice(-i))}(len=${t})`}let Yc=["id","account","email","name"];function Xc(e,t){return Ni(e)&&Yc.includes(e)?t:zc(t)}var Fc,Uc,Gc={exports:{}},Pc={},Kc={exports:{}},Oc={},_c={},Wc={};function Hc(){if(Fc)return Wc;Fc=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.toUnicode=Wc.toASCII=Wc.encode=Wc.decode=Wc.ucs2=Wc.version=void 0;const e=2147483647,t=36,i=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,r={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=Math.floor,a=String.fromCharCode;function c(e){throw new RangeError(r[e])}function l(e,t){const i=e.split("@");let n="";i.length>1&&(n=i[0]+"@",e=i[1]);const r=function(e,t){const i=[];let n=e.length;for(;n--;)i[n]=t(e[n]);return i}((e=e.replace(s,".")).split("."),t).join(".");return n+r}function u(e){const t=[];let i=0;const n=e.length;for(;i<n;){const s=e.charCodeAt(i++);if(s>=55296&&s<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&s)<<10)+(1023&n)+65536):(t.push(s),i--)}else t.push(s)}return t}const p=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},d=function(e,t){return e+22+75*Number(e<26)-(Number(0!=t)<<5)},m=function(e,i,n){let s=0;for(e=n?o(e/700):e>>1,e+=o(e/i);e>455;s+=t)e=o(e/35);return o(s+36*e/(e+38))},h=function(i){const n=[],s=i.length;let r=0,a=128,l=72,u=i.lastIndexOf("-");u<0&&(u=0);for(let e=0;e<u;++e)i.charCodeAt(e)>=128&&c("not-basic"),n.push(i.charCodeAt(e));for(let d=u>0?u+1:0;d<s;){const u=r;for(let n=1,a=t;;a+=t){d>=s&&c("invalid-input");const u=p(i.charCodeAt(d++));u>=t&&c("invalid-input"),u>o((e-r)/n)&&c("overflow"),r+=u*n;const m=a<=l?1:a>=l+26?26:a-l;if(u<m)break;const h=t-m;n>o(e/h)&&c("overflow"),n*=h}const h=n.length+1;l=m(r-u,h,0==u),o(r/h)>e-a&&c("overflow"),a+=o(r/h),r%=h,n.splice(r++,0,a)}return String.fromCodePoint(...n)};Wc.decode=h;const f=function(i){const n=[],s=u(i),r=s.length;let l=128,p=0,h=72;for(const e of s)e<128&&n.push(a(e));const f=n.length;let g=f;for(f&&n.push("-");g<r;){let i=e;for(const e of s)e>=l&&e<i&&(i=e);const r=g+1;i-l>o((e-p)/r)&&c("overflow"),p+=(i-l)*r,l=i;for(const i of s)if(i<l&&++p>e&&c("overflow"),i===l){let e=p;for(let i=t;;i+=t){const s=i<=h?1:i>=h+26?26:i-h;if(e<s)break;const r=e-s,c=t-s;n.push(a(d(s+r%c,0))),e=o(r/c)}n.push(a(d(e,0))),h=m(p,r,g===f),p=0,++g}++p,++l}return n.join("")};Wc.encode=f;Wc.toUnicode=function(e){return l(e,function(e){return i.test(e)?h(e.slice(4).toLowerCase()):e})};return Wc.toASCII=function(e){return l(e,function(e){return n.test(e)?"xn--"+f(e):e})},Wc.version="2.3.1",Wc.ucs2={decode:u,encode:e=>String.fromCodePoint(...e)},Wc}function Bc(){if(Uc)return _c;Uc=1;var e,t=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Nn&&Nn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var s={};if(null!=n)for(var r=e(n),o=0;o<r.length;o++)"default"!==r[o]&&t(s,n,r[o]);return i(s,n),s}),s=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_c,"__esModule",{value:!0}),_c.resolve=_c.parse=void 0;const r=s(u),o=s(p),a=n(Hc()),c=/^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/,l=/^[\x00-\x20]+|[\x00-\x20]+$/g,d=/^[\x00-\x20\u00a0\ufeff]+/,m=/^([a-zA-Z0-9+.-]+:)?[\\/]{2}([^\\/?#]*)/,h=/[\x00-\x20#/:<>?@[\\\]^|\x7f]/,f=/[\x00-\x1f\x7f]/;function g(e,t,i,n){const s=o.default.parse(e,t,n),c=m.exec(e.replace(d,""));if(c&&(c[1]||null!==s.hostname)){const e=c[2].slice(c[2].lastIndexOf("@")+1);if(!e||f.test(e)||(s.host||"").toLowerCase()!==a.toASCII(e.toLowerCase()))throw i;if("["===e.charAt(0)&&!r.default.isIPv6(e.slice(1,e.indexOf("]"))))throw i}else if(null!==s.hostname)throw i;const l=null===s.auth||void 0===s.auth?null:s.auth.split(":"),u=s;return u.username=l?l.shift():null,u.password=l&&l.length?l.join(":"):null,u}function w(e){try{return decodeURIComponent(e)}catch(t){return e}}function M(e,t){const i=e||"";if(!i)return"";if("["===i.charAt(0)&&"]"===i.charAt(i.length-1))return i.slice(1,-1);const n=w(i),s=h.test(n)?"":o.default.domainToASCII(n);if(!s)throw function(e){const t=new TypeError("Invalid URL");return t.code="ERR_INVALID_URL",t.input=e,t}(t);return s}_c.parse=(e,t)=>{e=(e||"").replace(l,"");const i=c.exec(e),n=i?i[1]+"//"+i[2]:e;let s;try{s=new URL(n)}catch(e){return g(n,t,e)}const r=M(s.hostname,s.href),o=s.port||null,a=s.pathname||null,u=s.search||null;let p,d=null,m=null,h=null;if((s.username||s.password)&&(m=w(s.username),h=s.password?w(s.password):null,d=m+(null!==h?":"+h:"")),t){const e=Object.create(null);s.searchParams.forEach((t,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];Array.isArray(n)?n.push(t):e[i]=[n,t]}else e[i]=t}),p=e}else p=u?u.slice(1):null;return{protocol:s.protocol||null,host:s.host||null,hostname:r,port:o,pathname:a,search:u,path:(a||"")+(u||"")||null,href:s.href,auth:d,username:m,password:h,query:p}};return _c.resolve=(e,t)=>{try{return new URL(t,e).href}catch(i){return g(e,!1,i,!0),g(t,!1,i,!0),o.default.resolve(e,t)}},_c}var Vc,Qc={exports:{}},Rc={exports:{}};var Jc,qc={};function $c(){return Jc||(Jc=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.homepage=qc.version=qc.name=void 0,qc.name="nodemailer",qc.version="10.0.13",qc.homepage="https://nodemailer.com/"),qc}var el,tl={};function il(){return el||(el=1,Object.defineProperty(tl,"__esModule",{value:!0}),tl.EFETCH=tl.EURLACCESS=tl.EFILEACCESS=tl.EPROXY=tl.ECONFIG=tl.ESES=tl.ESENDMAIL=tl.EMAXRECIPIENTS=tl.EMAXLIMIT=tl.EOAUTH2=tl.ENOAUTH=tl.EAUTH=tl.ESTREAM=tl.EMESSAGE=tl.EENVELOPE=tl.EPROTOCOL=tl.EREQUIRETLS=tl.ETLS=tl.EDNS=tl.ESOCKET=tl.ETIMEDOUT=tl.ECONNECTION=tl.ERROR_CODES=void 0,tl.ERROR_CODES={ECONNECTION:"Connection closed unexpectedly",ETIMEDOUT:"Connection or operation timed out",ESOCKET:"Socket-level error",EDNS:"DNS resolution failed",ETLS:"TLS handshake or STARTTLS failed",EREQUIRETLS:"REQUIRETLS not supported by server (RFC 8689)",EPROTOCOL:"Invalid SMTP server response",EENVELOPE:"Invalid mail envelope (sender or recipients)",EMESSAGE:"Message delivery error",ESTREAM:"Stream processing error",EAUTH:"Authentication failed",ENOAUTH:"Authentication credentials not provided",EOAUTH2:"OAuth2 token generation or refresh error",EMAXLIMIT:"Pool resource limit reached (max messages per connection)",EMAXRECIPIENTS:"Recipient count exceeds maxRecipients",ESENDMAIL:"Sendmail command error",ESES:"AWS SES transport error",ECONFIG:"Invalid configuration",EPROXY:"Proxy connection error",EFILEACCESS:"File access rejected (disableFileAccess is set)",EURLACCESS:"URL access rejected (disableUrlAccess is set)",EFETCH:"HTTP fetch error"},tl.ECONNECTION="ECONNECTION",tl.ETIMEDOUT="ETIMEDOUT",tl.ESOCKET="ESOCKET",tl.EDNS="EDNS",tl.ETLS="ETLS",tl.EREQUIRETLS="EREQUIRETLS",tl.EPROTOCOL="EPROTOCOL",tl.EENVELOPE="EENVELOPE",tl.EMESSAGE="EMESSAGE",tl.ESTREAM="ESTREAM",tl.EAUTH="EAUTH",tl.ENOAUTH="ENOAUTH",tl.EOAUTH2="EOAUTH2",tl.EMAXLIMIT="EMAXLIMIT",tl.EMAXRECIPIENTS="EMAXRECIPIENTS",tl.ESENDMAIL="ESENDMAIL",tl.ESES="ESES",tl.ECONFIG="ECONFIG",tl.EPROXY="EPROXY",tl.EFILEACCESS="EFILEACCESS",tl.EURLACCESS="EURLACCESS",tl.EFETCH="EFETCH"),tl}var nl,sl,rl,ol={};function al(){return nl||(nl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.copyOwnKeys=e.isProtoKey=void 0;e.isProtoKey=e=>"__proto__"===e;e.copyOwnKeys=(t,i,n)=>(Object.keys(i||{}).forEach(s=>{(0,e.isProtoKey)(s)||n&&n(s)||(t[s]=i[s])}),t)}(ol)),ol}function cl(){return sl||(sl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(h),c=o(f),l=r(Bc()),p=o(g),d=w,m=o((Vc||(Vc=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(u),c=r(Bc());t.default=class{constructor(e){this.options=e||{},this.cookies=[]}set(e,t){const i=c.parse(t||""),n=this.parse(e);let s;return n.domain?(s=n.domain.replace(/^\./,""),(i.hostname.length<s.length||s.indexOf(".")<0||s.endsWith(".")||a.default.isIP(i.hostname)||!("."+i.hostname).endsWith("."+s))&&(n.domain=i.hostname)):n.domain=i.hostname,n.path||(n.path=this.getPath(i.pathname)),n.expires||(n.expires=new Date(Date.now()+1e3*(Number(this.options.sessionTimeout||1800)||1800))),this.add(n)}get(e){return this.list(e).map(e=>e.name+"="+e.value).join("; ")}list(e){const t=[];for(let i=this.cookies.length-1;i>=0;i--){const n=this.cookies[i];this.isExpired(n)?this.cookies.splice(i,1):this.match(n,e)&&t.unshift(n)}return t}parse(e){const t={};return(e||"").toString().split(";").forEach(e=>{const i=e.split("="),n=i.shift().trim().toLowerCase();let s,r=i.join("=").trim();if(n)switch(n){case"expires":{const e=new Date(r);"Invalid Date"!==e.toString()&&(t.expires=e);break}case"path":t.path=r;break;case"domain":s=r.toLowerCase(),s.length&&"."!==s.charAt(0)&&(s="."+s),t.domain=s;break;case"max-age":t.expires=new Date(Date.now()+1e3*(Number(r)||0));break;case"secure":t.secure=!0;break;case"httponly":t.httponly=!0;break;default:t.name||(t.name=n,t.value=r)}}),t}match(e,t){const i=c.parse(t||"");if(i.hostname!==e.domain&&("."!==e.domain.charAt(0)||("."+i.hostname).substr(-e.domain.length)!==e.domain))return!1;const n=i.pathname||"/",s=e.path;return!(n!==s&&(!n.startsWith(s)||!s.endsWith("/")&&"/"!==n.charAt(s.length))||e.secure&&"https:"!==i.protocol)}add(e){if(!e||!e.name)return!1;for(let t=0,i=this.cookies.length;t<i;t++)if(this.compare(this.cookies[t],e))return this.isExpired(e)?(this.cookies.splice(t,1),!1):(this.cookies[t]=e,!0);return this.isExpired(e)||this.cookies.push(e),!0}compare(e,t){return e.name===t.name&&e.path===t.path&&e.domain===t.domain&&e.secure===t.secure&&e.httponly===t.httponly}isExpired(e){return e.expires&&e.expires<new Date||!e.value}getPath(e){const t=(e||"/").split("/");t.pop();const i=t.join("/").trim();return"/"!==i.charAt(0)?"/":i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Rc,Rc.exports)),Rc.exports)),M=r($c()),y=o(u),D=r(il()),x=al(),L=["ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","dhparam","ecdhCurve","honorCipherOrder","key","maxVersion","minVersion","passphrase","pfx","rejectUnauthorized","secureContext","secureOptions","secureProtocol","servername","sessionIdContext","sigalgs"];function v(e){let t;try{t=l.parse(e)}catch(e){return!1}return("http:"===t.protocol||"https:"===t.protocol)&&t}function I(e,t){(t=t||{}).fetchRes=t.fetchRes||new d.PassThrough,t.cookies=t.cookies||new m.default,t.redirects=t.redirects||0,t.maxRedirects=isNaN(t.maxRedirects)?5:t.maxRedirects;const i=t.fetchRes,n=v(e);if(!n)return t.body&&"function"==typeof t.body.destroy&&(t.body.on("error",()=>!1),t.body.destroy()),setImmediate(()=>{const t=new Error("Unsupported protocol for URL "+e);t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i;t.cookie&&([].concat(t.cookie||[]).forEach(i=>{t.cookies.set(i,e)}),t.cookie=!1);let s,r,o=(t.method||"").toString().trim().toUpperCase()||"GET",u=!1;const h="https:"===n.protocol?c.default:a.default,f={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+M.version};if(Object.keys(t.headers||{}).forEach(e=>{(0,x.isProtoKey)(e.toLowerCase().trim())||(f[e.toLowerCase().trim()]=t.headers[e])}),t.userAgent&&(f["user-agent"]=t.userAgent),n.auth&&(f.Authorization="Basic "+Buffer.from(n.auth).toString("base64")),(s=t.cookies.get(e))&&(f.cookie=s),t.body){if(!1!==t.contentType&&(f["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"),"function"==typeof t.body.pipe)f["Transfer-Encoding"]="chunked",r=t.body,r.on("error",t=>{u||(u=!0,t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t))});else{if(t.body instanceof Buffer)r=t.body;else if("object"==typeof t.body)try{r=Buffer.from(Object.keys(t.body).map(e=>{const i=t.body[e].toString().trim();return encodeURIComponent(e)+"="+encodeURIComponent(i)}).join("&"))}catch(t){return u=!0,t.code=D.EFETCH,t.sourceUrl=e,setImmediate(()=>i.emit("error",t)),i}else r=Buffer.from(t.body.toString().trim());f["Content-Type"]=t.contentType||"application/x-www-form-urlencoded",f["Content-Length"]=r.length}o=(t.method||"").toString().trim().toUpperCase()||"POST"}let g;const w={method:o,host:n.hostname,path:n.path,port:n.port?n.port:"https:"===n.protocol?443:80,headers:f,rejectUnauthorized:!0,agent:!1};t.tls&&Object.keys(t.tls).forEach(e=>{L.includes(e)&&(w[e]=t.tls[e])}),"https:"!==n.protocol||!n.hostname||n.hostname===w.host||y.default.isIP(n.hostname)||w.servername||(w.servername=n.hostname);try{g=h.request(w)}catch(t){return u=!0,setImmediate(()=>{t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i}const b=(t,n=e)=>{u||(u=!0,t.code=D.EFETCH,t.sourceUrl=n,i.emit("error",t),g.abort())},C="number"==typeof t.timeout&&t.timeout>=0?t.timeout:6e4;return C&&g.setTimeout(C,()=>b(new Error("Request Timeout"))),g.on("error",e=>b(e)),g.on("response",s=>{let r;if(u)return;switch(s.headers["content-encoding"]){case"gzip":case"deflate":r=p.default.createUnzip()}if(s.headers["set-cookie"]&&[].concat(s.headers["set-cookie"]||[]).forEach(i=>{t.cookies.set(i,e)}),[301,302,303,307,308].includes(s.statusCode)&&s.headers.location){if(t.redirects++,t.redirects>t.maxRedirects)return b(new Error("Maximum redirect count exceeded"));let i;t.method="GET",t.body=!1;try{i=l.resolve(e,s.headers.location)}catch(e){i=s.headers.location}const r=v(i);if(!r)return b(new Error("Unsupported protocol for URL "+i),i);const o=r.hostname!==n.hostname,a="https:"===n.protocol&&"http:"===r.protocol;if(t.headers&&(o||a)){const e=["authorization","cookie","proxy-authorization"];Object.keys(t.headers).forEach(i=>{e.includes(i.toLowerCase())&&delete t.headers[i]})}return u=!0,s.resume(),g.abort(),I(i,t)}if(i.statusCode=s.statusCode,i.headers=s.headers,s.statusCode>=300&&!t.allowErrorResponse)return b(new Error("Invalid status code "+s.statusCode));s.on("error",e=>b(e));const o="number"==typeof t.maxBytes&&t.maxBytes>0?t.maxBytes:67108864,a=r||s;let c=0;a.on("data",e=>{c+=e.length,c<=o||u||(a.unpipe(i),b(new Error("Response size exceeds the allowed "+o+" bytes")))}),r?(s.pipe(r).pipe(i),r.on("error",e=>b(e))):s.pipe(i)}),setImmediate(()=>{if(r)try{if("function"==typeof r.pipe)return r.pipe(g);g.write(r)}catch(e){return b(e)}g.end()}),i}I.Cookies=m.default,I.DEFAULT_TIMEOUT=6e4,t.default=I,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Qc,Qc.exports)),Qc.exports}function ll(){return rl||(rl=1,function(e){var t,i=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=Nn&&Nn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var r=t(e),o=0;o<r.length;o++)"default"!==r[o]&&i(s,e,r[o]);return n(s,e),s}),r=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeXText=e.assign=e.parseDataURI=e.callbackPromise=e.getLogger=e._logFunc=e.parseConnectionUrl=e.resolveHostname=e.dnsCache=e.networkInterfaces=e._resetCacheCleanup=e._lastCacheCleanup=e.copyOwnKeys=e.isProtoKey=void 0,e.resolveContent=function(t,i,n,s){s||"function"!=typeof n||(s=n,n=!1);let r;n=n||{},s||(r=new Promise((t,i)=>{s=(0,e.callbackPromise)(t,i)}));return function(t,i,n,s){let r=t&&t[i]&&t[i].content||t[i];const o=("object"==typeof t[i]&&t[i].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!r)return s(null,r);if("object"==typeof r){if("function"==typeof r.pipe)return b(r,(e,n)=>{if(e)return s(e);t[i].content?t[i].content=n:t[i]=n,s(null,n)});if(/^data:/i.test(r.path||r.href)){const t=(0,e.parseDataURI)(r.path||r.href);return s(null,t&&t.data?t.data:Buffer.alloc(0))}if(r.href||/^https?:\/\//i.test(r.path)){const e=r.href||r.path;return n.disableUrlAccess?void setImmediate(()=>{const t=new Error("Url access rejected for "+e);t.code=p.EURLACCESS,s(t)}):b((0,l.default)(e,{headers:r.httpHeaders,tls:r.tls}),s)}if(r.path)return n.disableFileAccess?void setImmediate(()=>{const e=new Error("File access rejected for "+r.path);e.code=p.EFILEACCESS,s(e)}):b(c.default.createReadStream(r.path),s)}"string"!=typeof t[i].content||["utf8","usascii","ascii"].includes(o)||(r=Buffer.from(t[i].content,o));setImmediate(()=>s(null,r))}(t,i,n,s),r};const o=s(Bc()),a=r(d),c=r(m),l=r(cl()),p=s(il()),h=al();Object.defineProperty(e,"isProtoKey",{enumerable:!0,get:function(){return h.isProtoKey}}),Object.defineProperty(e,"copyOwnKeys",{enumerable:!0,get:function(){return h.copyOwnKeys}});const f=r(M),g=r(u),w=r(y),D=3e5;let x=0;e._lastCacheCleanup=()=>x;e._resetCacheCleanup=()=>{x=0};try{e.networkInterfaces=w.default.networkInterfaces()}catch(e){}const L=(t,i)=>{const n=Object.values(e.networkInterfaces||{}).flat();return!n.length||n.filter(e=>!e.internal||i).some(e=>e.family==="IPv"+t||e.family===t)},v=(e,t,i,n)=>{if(!L(e,(i=i||{}).allowInternalNetworkInterfaces))return n(null,[]);(f.default.Resolver?new f.default.Resolver(i):f.default)["resolve"+e](t,(e,t)=>{if(e){switch(e.code){case f.default.NODATA:case f.default.NOTFOUND:case f.default.NOTIMP:case f.default.SERVFAIL:case f.default.CONNREFUSED:case f.default.REFUSED:case"EAI_AGAIN":return n(null,[])}return n(e)}return n(null,Array.isArray(t)?t:[].concat(t||[]))})};e.dnsCache=new Map;const I=(e,t)=>{if(!e)return Object.assign({},t||{});const i=e.addresses||[],n=i.length>0?i[Math.floor(Math.random()*i.length)]:null;return Object.assign({host:n,_addresses:i},t||{})};e.resolveHostname=(t,i)=>{if(!(t=t||{}).host&&t.servername&&(t.host=t.servername),!t.host||g.default.isIP(t.host)){const e={addresses:[t.host]};return i(null,I(e,{servername:t.servername||!1,cached:!1}))}const n=t.host,s=t.servername||n;let r;if(e.dnsCache.has(t.host)){r=e.dnsCache.get(t.host);const n=Date.now();if(n-x>3e4){x=n;for(const[t,i]of e.dnsCache.entries())i.expires&&i.expires<n&&e.dnsCache.delete(t);if(e.dnsCache.size>1e3){const t=Math.floor(100);Array.from(e.dnsCache.keys()).slice(0,t).forEach(t=>e.dnsCache.delete(t))}}if(!r.expires||r.expires>=n)return i(null,I(r.value,{servername:s,cached:!0}))}let o=[],a=[],c=null,l=null;v(4,t.host,t,(u,p)=>{u?c=u:o=p||[],v(6,n,t,(u,p)=>{u?l=u:a=p||[];const d=o.concat(a);if(d.length){const r={addresses:d};return e.dnsCache.set(n,{value:r,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r,{servername:s,cached:!1}))}if(c&&l&&r)return e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:c}));try{f.default.lookup(n,{all:!0},(o,a)=>{if(o)return r?(e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:o}))):i(o);const c=a?a.filter(e=>L(e.family)).map(e=>e.address):[];if(a&&a.length&&!c.length&&console.warn(`Failed to resolve IPv${a[0].family} addresses with current network`),!c.length&&r)return i(null,I(r.value,{servername:s,cached:!0}));const l={addresses:c.length?c:[n]};return e.dnsCache.set(n,{value:l,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(l,{servername:s,cached:!1}))})}catch(o){return r?(e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:o}))):i(c||l||o)}})})};e.parseConnectionUrl=e=>{e=e||"";const t={},i=o.parse(e,!0);switch(i.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0}return!isNaN(i.port)&&Number(i.port)&&(t.port=Number(i.port)),i.hostname&&(t.host=i.hostname),(i.username||i.password)&&(t.auth={user:i.username||"",pass:i.password||""}),Object.keys(i.query||{}).forEach(e=>{let n=t,s=e,r=i.query[e];switch(isNaN(r)||(r=Number(r)),r){case"true":r=!0;break;case"false":r=!1}if(0===e.indexOf("tls."))s=e.substr(4),t.tls||(t.tls={}),n=t.tls;else if(e.indexOf(".")>=0)return;(0,h.isProtoKey)(s)||s in n||(n[s]=r)}),t};e._logFunc=(e,t,i,n,s,...r)=>{const o=Object.assign({},i||{},n||{});delete o.level;let a=t;"function"!=typeof e[a]&&(a=["info","debug","log","trace","warn","error"].find(t=>"function"==typeof e[t])),a&&e[a](o,s,...r)};e.getLogger=(t,i)=>{const n={},s=["trace","debug","info","warn","error","fatal"];if(!(t=t||{}).logger)return s.forEach(e=>{n[e]=()=>!1}),n;const r=!0===t.logger?function(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0),i=new Map;e.forEach(e=>{let n=e.toUpperCase();n.length<t&&(n+=" ".repeat(t-n.length)),i.set(e,n)});const n=(e,t,n,...s)=>{let r="";t&&("server"===t.tnx?r="S: ":"client"===t.tnx&&(r="C: "),t.sid&&(r="["+t.sid+"] "+r),t.cid&&(r="[#"+t.cid+"] "+r)),(n=a.default.format(n,...s)).split(/\r?\n/).forEach(t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),i.get(e),r+t)})},s={};return e.forEach(e=>{s[e]=n.bind(null,e)}),s}(s):t.logger;return s.forEach(t=>{n[t]=(...n)=>{const s="string"==typeof n[0]?void 0:n.shift();(0,e._logFunc)(r,t,i,s,...n)}}),n};e.callbackPromise=(e,t)=>function(...i){const n=i.shift();n?t(n):e(...i)};e.parseDataURI=e=>{if("string"!=typeof e)return null;if(!e.startsWith("data:"))return null;const t=e.indexOf(",");if(-1===t)return null;const i=e.substring(t+1);let n;const s=e.substring(5,t).split(";");if(s.length>0){const e=s[s.length-1].toLowerCase().trim();["base64","utf8","utf-8"].includes(e)&&-1===e.indexOf("=")&&(n=e,s.pop())}const r=s.length>0?s.shift():"application/octet-stream",o={};for(let e=0;e<s.length;e++){const t=s[e],i=t.indexOf("=");if(i>0){const e=t.substring(0,i).trim(),n=t.substring(i+1).trim();e&&!(0,h.isProtoKey)(e)&&(o[e]=n)}}let a;try{if("base64"===n)a=Buffer.from(i,"base64");else try{a=Buffer.from(decodeURIComponent(i))}catch(e){a=Buffer.from(i)}}catch(e){a=Buffer.alloc(0)}return{data:a,encoding:n||null,contentType:r||"application/octet-stream",params:o}};e.assign=function(...e){const t=e.shift()||{};return e.forEach(e=>{Object.keys(e||{}).forEach(i=>{(0,h.isProtoKey)(i)||(["tls","auth"].includes(i)&&e[i]&&"object"==typeof e[i]?t[i]=(0,h.copyOwnKeys)(t[i]||{},e[i]):t[i]=e[i])})}),t};function b(e,t){let i=!1;const n=[];let s=0;e.on("error",e=>{i||(i=!0,t(e))}),e.on("readable",()=>{let t;for(;null!==(t=e.read());)n.push(t),s+=t.length}),e.on("end",()=>{if(i)return;let e;i=!0;try{e=Buffer.concat(n,s)}catch(e){return t(e)}t(null,e)})}e.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e))return e;const t=Buffer.from(e);let i="";for(let e=0,n=t.length;e<n;e++){const n=t[e];i+=n<33||n>126||43===n||61===n?"+"+(n<16?"0":"")+n.toString(16).toUpperCase():String.fromCharCode(n)}return i}}(Oc)),Oc}var ul,pl={};function dl(){if(ul)return pl;ul=1;var e=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pl,"__esModule",{value:!0}),pl.detectMimeType=function(e){if(!e)return i;const n=t.default.parse(e),s=(n.ext.substr(1)||n.name||"").split("?").shift().trim().toLowerCase(),o=r.has(s)?r.get(s):i;if(Array.isArray(o))return o[0];return o},pl.detectExtension=function(e){if(!e)return n;const t=e.toLowerCase().trim().split("/"),i=t.shift().trim(),r=t.join("/").trim();if(s.has(i+"/"+r)){const e=s.get(i+"/"+r);return Array.isArray(e)?e[0]:e}if("text"===i)return"txt";return"bin"};const t=e(D),i="application/octet-stream",n="bin",s=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/geo+json","geojson"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]),r=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);return pl}var ml,hl={exports:{}},fl={exports:{}},gl={},wl={};function Ml(){if(ml)return wl;ml=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.Encoder=void 0,wl.encode=t,wl.wrap=i;const e=w;function t(e){return"string"==typeof e&&(e=Buffer.from(e,"utf-8")),e.toString("base64")}function i(e,t){if(e=(e||"").toString(),t=Math.max(Number(t)||76,1),e.length<=t)return e;const i=[];let n=0;const s=1024*t,r=new RegExp(".{"+t+"}","g");for(;n<e.length;){const t=e.substr(n,s).replace(r,"$&\r\n").trim();i.push(t),n+=s}return i.join("\r\n").trim()}class n extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this._remainingBytes=!1,this.inputBytes=0,this.outputBytes=0}_transform(e,n,s){let r="buffer"!==n?Buffer.from(e,n):e;if(!r||!r.length)return void setImmediate(s);this.inputBytes+=r.length,this._remainingBytes&&this._remainingBytes.length&&(r=Buffer.concat([this._remainingBytes,r],this._remainingBytes.length+r.length),this._remainingBytes=!1),r.length%3?(this._remainingBytes=r.slice(r.length-r.length%3),r=r.slice(0,r.length-r.length%3)):this._remainingBytes=!1;let o=this._curLine+t(r);if(this.options.lineLength){o=i(o,this.options.lineLength);const e=o.lastIndexOf("\n");e<0?(this._curLine=o,o=""):e===o.length-1?this._curLine="":(this._curLine=o.substring(e+1),o=o.substring(0,e+1))}o&&(this.outputBytes+=o.length,this.push(Buffer.from(o,"ascii"))),setImmediate(s)}_flush(e){this._remainingBytes&&this._remainingBytes.length&&(this._curLine+=t(this._remainingBytes)),this._curLine&&(this._curLine=i(this._curLine,this.options.lineLength),this.outputBytes+=this._curLine.length,this.push(Buffer.from(this._curLine,"ascii")),this._curLine=""),e()}}return wl.Encoder=n,wl}var yl,Dl,xl={};function Ll(){if(yl)return xl;yl=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.Encoder=void 0,xl.encode=n,xl.wrap=s;const e=w,t=4,i=[[9],[10],[13],[32,60],[62,126]];function n(e){"string"==typeof e&&(e=Buffer.from(e,"utf-8"));let t,n="";for(let s=0,o=e.length;s<o;s++)t=e[s],r(t,i)&&(32!==t&&9!==t||s!==o-1&&10!==e[s+1]&&13!==e[s+1])?n+=String.fromCharCode(t):n+="="+(t<16?"0":"")+t.toString(16).toUpperCase();return n}function s(e,i){if(e=(e||"").toString(),i=Math.max(Number(i)||76,t),e.length<=i)return e;let n=0;const s=e.length;let r,o,a;const c=Math.floor(i/3);let l="";for(;n<s;)if(a=e.substr(n,i),r=a.match(/\r\n/))a=a.substr(0,r.index+r[0].length),l+=a,n+=a.length;else if("\n"!==a.substr(-1))if(r=a.substr(-c).match(/\n.*?$/))a=a.substr(0,a.length-(r[0].length-1)),l+=a,n+=a.length;else{if(a.length>i-c&&(r=a.substr(-c).match(/[ \t.,!?][^ \t.,!?]*$/)))a=a.substr(0,a.length-(r[0].length-1));else if(a.match(/[=][\da-f]{0,2}$/i))for((r=a.match(/[=][\da-f]{0,1}$/i))&&(a=a.substr(0,a.length-r[0].length));a.length>3&&a.length<s-n&&!a.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(r=a.match(/[=][\da-f]{2}$/gi))&&(o=parseInt(r[0].substr(1,2),16),!(o<128))&&(a=a.substr(0,a.length-3),!(o>=192)););a.length||(a=e.substr(n,i)),n+a.length<s&&"\n"!==a.substr(-1)?(a.length===i&&a.match(/[=][\da-f]{2}$/i)?a=a.substr(0,a.length-3):a.length===i&&(a=a.substr(0,a.length-1)),n+=a.length,a+="=\r\n"):n+=a.length,l+=a}else l+=a,n+=a.length;return l}function r(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.length){if(1===n.length&&e===n[0])return!0;if(2===n.length&&e>=n[0]&&e<=n[1])return!0}}return!1}class o extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(e,t,i){let r;if("buffer"!==t&&(e=Buffer.from(e,t)),!e||!e.length)return i();this.inputBytes+=e.length,this.options.lineLength?(r=this._curLine+n(e),r=s(r,this.options.lineLength),r=r.replace(/(^|\n)([^\n]*)$/,(e,t,i)=>(this._curLine=i,t)),r&&(this.outputBytes+=r.length,this.push(r))):(r=n(e),this.outputBytes+=r.length,this.push(r,"ascii")),i()}_flush(e){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),e()}}return xl.Encoder=o,xl}function vl(){if(Dl)return gl;Dl=1;var e,t=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Nn&&Nn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var s={};if(null!=n)for(var r=e(n),o=0;o<r.length;o++)"default"!==r[o]&&t(s,n,r[o]);return i(s,n),s});Object.defineProperty(gl,"__esModule",{value:!0}),gl.isPlainText=c,gl.quoteString=function(e){return'"'+(e||"").toString().replace(/["\\]/g,"\\$&")+'"'},gl.hasLongerLines=function(e,t){if(e.length>131072)return!0;return new RegExp("^.{"+(t+1)+",}","m").test(e)},gl.encodeWord=l,gl.encodeWords=function(e,t,i,n){i=i||0;const s=e.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!s)return e;if(n)return l(e,t,i);const r=e.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!r)return e;const o=s.index+(s[0].match(/[^\s]/)||{index:0}).index,a=r.index+(r[1]||"").length;return(o?e.substr(0,o):"")+l(e.substring(o,a),t||"Q",i)+(a<e.length?e.substr(a):"")},gl.buildHeaderValue=function(e){const t=[];Object.keys(e.params||{}).forEach(i=>{const n=e.params[i],s=i.replace(/[\x00-\x1f\x7f]/g,"");!c(n,!0)||n.length>=75?u(s,n,50).forEach(e=>{/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(e.value)&&"*"!==e.key.substr(-1)?t.push(e.key+"="+JSON.stringify(e.value)):t.push(e.key+"="+e.value)}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)?t.push(s+"="+JSON.stringify(n)):t.push(s+"="+n)});return("string"==typeof e.value?e.value.replace(/[\x00-\x1f\x7f]/g,""):e.value)+(t.length?"; "+t.join("; "):"")},gl.buildHeaderParam=u,gl.parseHeaderValue=function(e){const t={value:"",params:{}},i=(e,i)=>{(0,a.isProtoKey)(e)||(t.params[e]=i)};let n,s=!1,r="",o="value",c=!1,l=!1;for(let a=0,u=e.length;a<u;a++)if(n=e.charAt(a),"key"===o){if("="===n){s=r.trim().toLowerCase(),o="value",r="";continue}r+=n}else{if(l)r+=n;else{if("\\"===n){l=!0;continue}c&&n===c?c=!1:c||'"'!==n?c||";"!==n?r+=n:(!1===s?t.value=r.trim():i(s,r.trim()),o="key",r=""):c=n}l=!1}"value"===o?!1===s?t.value=r.trim():i(s,r.trim()):r.trim()&&i(r.trim().toLowerCase(),"");return Object.keys(t.params).forEach(e=>{let i,n,s,r;if(s=e.match(/(\*(\d+)|\*(\d+)\*|\*)$/)){if(i=e.substr(0,s.index),n=Number(s[2]||s[3])||0,(0,a.isProtoKey)(i))return void delete t.params[e];t.params[i]&&"object"==typeof t.params[i]||(t.params[i]={charset:!1,values:[]}),r=t.params[e],0===n&&"*"===s[0].substr(-1)&&(s=r.match(/^([^']*)'[^']*'(.*)$/))&&(t.params[i].charset=s[1]||"iso-8859-1",r=s[2]),t.params[i].values[n]=r,delete t.params[e]}}),Object.keys(t.params).forEach(e=>{let i;t.params[e]&&Array.isArray(t.params[e].values)&&(i=t.params[e].values.map(e=>e||"").join(""),t.params[e].charset?t.params[e]="=?"+t.params[e].charset+"?Q?"+i.replace(/[=?_\s]/g,e=>{const t=e.charCodeAt(0).toString(16);return" "===e?"_":"%"+(t.length<2?"0":"")+t}).replace(/%/g,"=")+"?=":t.params[e]=i)}),t},gl.detectExtension=function(e){return o.detectExtension(e)},gl.detectMimeType=function(e){return o.detectMimeType(e)},gl.foldLines=function(e,t,i){e=(e||"").toString(),t=t||76;let n=0;const s=e.length;let r,o,a="";for(;n<s;){if(r=e.substr(n,t),r.length<t){a+=r;break}(o=r.match(/^[^\n\r]*(\r?\n|\r)/))?(r=o[0],a+=r,n+=r.length):((o=r.match(/(\s+)[^\s]*$/))&&o[0].length-(i?(o[1]||"").length:0)<r.length?r=r.substr(0,r.length-(o[0].length-(i?(o[1]||"").length:0))):(o=e.substr(n+r.length).match(/^[^\s]+(\s*)/))&&(r+=o[0].substr(0,o[0].length-(i?0:(o[1]||"").length))),a+=r,n+=r.length,n<s&&(a+="\r\n"))}return a},gl.splitMimeEncodedString=p,gl.encodeURICharComponent=d,gl.safeEncodeURIComponent=m;const s=n(Ml()),r=n(Ll()),o=n(dl()),a=al();function c(e,t){return"string"==typeof e&&!(t?/[\x00-\x1f\x7f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(e)}function l(e,t,i){let n;if((i=i||0)&&i>12&&(i-=12),"Q"===(t=(t||"Q").toString().toUpperCase().trim().charAt(0))?n=r.encode(e).replace(/[^a-z0-9!*+\-/=]/gi,e=>{const t=e.charCodeAt(0).toString(16).toUpperCase();return" "===e?"_":"="+(1===t.length?"0"+t:t)}):"B"===t&&(n="string"==typeof e?e:e.toString("utf-8"),i=i?Math.max(3,(i-i%4)/4*3):0),i&&("B"!==t?n:s.encode(e)).length>i)if("Q"===t)n=p(n,i).join("?= =?UTF-8?"+t+"?");else{const e=[];let r="";for(let t=0,o=n.length;t<o;t++){let o=n.charAt(t);/[\ud800-\udbff]/.test(o)&&/[\udc00-\udfff]/.test(n.charAt(t+1))&&(o+=n.charAt(++t)),Buffer.byteLength(r+o)<=i||0===t?r+=o:(e.push(s.encode(r)),r=o)}r&&e.push(s.encode(r)),n=e.length>1?e.join("?= =?UTF-8?"+t+"?"):e.join("")}else"B"===t&&(n=s.encode(e));return"=?UTF-8?"+t+"?"+n+("?="===n.substr(-2)?"":"?=")}function u(e,t,i){const n=[];let s,r,o,a,l="string"==typeof t?t:(t||"").toString(),u=0;if(i=i||50,c(t,!0)){if(l.length<=i)return[{key:e,value:l}];l=l.replace(new RegExp(".{"+i+"}","g"),e=>(n.push({line:e}),"")),l&&n.push({line:l})}else{if(/[\uD800-\uDBFF]/.test(l)){const e=[];for(o=0,a=l.length;o<a;o++)s=l.charAt(o),/[\ud800-\udbff]/.test(s)&&/[\udc00-\udfff]/.test(l.charAt(o+1))?(s+=l.charAt(o+1),e.push(s),o++):e.push(s);l=e}r="utf-8''";let e=!0;for(u=0,o=0,a=l.length;o<a;o++){if(s=l[o],e)s=m(s);else if(s=" "===s?s:m(s),s!==l[o]){if(!((m(r)+s).length>=i)){e=!0,o=u,r="";continue}n.push({line:r,encoded:e}),r="",e=!0}(r+s).length>=i?(n.push({line:r,encoded:e}),r=s=" "===l[o]?" ":m(l[o]),s===l[o]?(e=!1,u=o-1):e=!0):r+=s}r&&n.push({line:r,encoded:e})}return n.map((t,i)=>({key:e+"*"+i+(t.encoded?"*":""),value:t.line}))}function p(e,t){const i=[];let n,s,r,o,a;for(t=Math.max(t||0,12);e.length;){for(n=e.substr(0,t),(r=n.match(/[=][0-9A-F]?$/i))&&(n=n.substr(0,r.index)),s=n.length?n:e.substr(0,t),a=!1;!a&&n.length;)a=!0,(r=e.substr(n.length).match(/^[=]([0-9A-F]{2})/i))&&(o=parseInt(r[1],16),o<194&&o>127&&(n=n.substr(0,n.length-3),a=!1));n.length||(n=s),i.push(n),e=e.substr(n.length)}return i}function d(e){let t="",i=e.charCodeAt(0).toString(16).toUpperCase();if(i.length%2&&(i="0"+i),i.length>2)for(let e=0,n=i.length/2;e<n;e++)t+="%"+i.substr(e,2);else t+="%"+i;return t}function m(e){e=(e||"").toString();try{e=encodeURIComponent(e)}catch(t){e=encodeURIComponent(Buffer.from(e,"utf-8").toString("utf-8"))}return e.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,e=>d(e))}return gl}var Il,bl={exports:{}};function Cl(){return Il||(Il=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=/\s/,n=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,s=/^[^@\s]+@[^@\s]+$/,r=/^[^@\s]+@\S+$/,o=/\s*\b[^@\s]+@[^\s]+\b\s*/y;function a(e){return 32===e||e>=9&&e<=13||160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||95===e}function l(e,t){return c(e.charCodeAt(t-1))!==c(e.charCodeAt(t))}function u(e,t,i){for(let n=t;n<i;n++)if(64===e.charCodeAt(n))return n;return-1}function p(e){const t=e.length;let i=0;for(;i<t;){for(;i<t&&a(e.charCodeAt(i));)i++;if(i>=t)break;const n=i;let s=i;for(;s<t&&!a(e.charCodeAt(s));)s++;let r=u(e,n,s);if(r>=0){let t=-1;for(let i=s;i>n;i--)if(l(e,i)){t=i;break}let i=n;for(;t>=0&&r>=0;){if(r>i&&s>r+1&&t>r+1)for(let t=i;t<r;t++)if(l(e,t)){if(t>n)return t;let i=n;for(;i>0&&a(e.charCodeAt(i-1));)i--;return i}i=r+1,r=u(e,i,s)}}i=s}return-1}function d(e){const t=[];let i="",n="",s=0,r="",o="";for(let a=0,c=e.length;a<c;a++){const l=e.charAt(a);if(s)"\\"===l&&a<c-1?n+=e.charAt(++a):"("===l?(s++,n+=l):")"!==l||--s?n+=l:(t.push(n.trim()),n="","@"!==o&&"@"!==e.charAt(a+1)&&(i+=" ",o=" "));else{if(r){if("\\"===l&&'"'===r&&a<c-1){i+=l+e.charAt(++a),o=e.charAt(a);continue}l===r&&(r="")}else if('"'===l)r='"';else if("["===l)r="]";else if("("===l){s=1;continue}i+=l,o=l}}return s&&t.push(n.trim()),{address:i.trim(),comments:t.filter(e=>e)}}function m(e,t){let a=!1,c="text";const l=[],u={address:[],comment:[],group:[],text:[],textWasQuoted:[]};let m=!1;const h={address:"",comment:"",group:"",text:""};for(let t=0,i=e.length;t<i;t++){const i=e[t],n=t?e[t-1]:null;if("operator"===i.type)switch(i.value){case"<":c="address",m=!1;break;case"(":c="comment",m=!1;break;case":":c="group",a=!0,m=!1;break;case'"':m=!m,c="text";break;default:c="text",m=!1}else if(i.value){const s=t>1?e[t-2]:null,r="operator"===n?.type&&'"'===n.value&&!!n.noBreak&&"operator"===s?.type&&'"'===s.value;"address"===c&&(i.value=i.value.replace(/^[^<]*<\s*/,""));const o=u[c];n&&n.noBreak&&o.length&&(")"!==n.value||"@"===h[c]||"@"===i.value.charAt(0))?(u[c][u[c].length-1]+=i.value,i.value&&(h[c]=i.value.charAt(i.value.length-1)),"text"===c&&m&&(u.textWasQuoted[u.textWasQuoted.length-1]=!0)):(u[c].push(i.value),h[c]=i.value.charAt(i.value.length-1),"text"===c&&u.textWasQuoted.push(m||r))}}if(!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),a){u.text=u.text.join(" ");let e=[];if(u.group.length){g(u.group.join(","),{_depth:t+1}).forEach(t=>{t.group?e=e.concat(t.group):e.push(t)})}l.push({name:u.text||"",group:e})}else{const e=[],t=[];for(const i of u.address){if(i.indexOf("(")<0){t.push(i);continue}const n=d(i);for(const t of n.comments)e.push(t);n.address&&t.push(n.address)}if(u.address=t,!u.address.length&&u.text.length){for(let e=u.text.length-1;e>=0;e--)if(!u.textWasQuoted[e]&&s.test(u.text[e])){u.address=u.text.splice(e,1),u.textWasQuoted.splice(e,1);break}if(!u.address.length){let e=!1;for(let t=u.text.length-1;t>=0;t--)if(!u.textWasQuoted[t]){const i=u.text[t];let n=i;const s=p(i);if(s>=0){o.lastIndex=s;const t=o.exec(i);t&&(u.address=[t[0].trim()],e=!0,n=i.slice(0,s)+" "+i.slice(s+t[0].length))}if(u.text[t]=n.trim(),e)break}}}!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),u.address.length>1&&(u.text=u.text.concat(u.address.splice(1)));const a=!u.address.length&&u.textWasQuoted.some(e=>e);u.text=u.text.join(" "),u.address=u.address.join(" "),a&&u.text&&(u.address=function(e){const t=e.lastIndexOf("@");if(t<0)return e;const i=e.substr(0,t);return/^[^\s"(),:;<>@[\\\]]+$/.test(i)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(i)?e:'"'+i.replace(/["\\]/g,"\\$&")+'"@'+e.substr(t+1)}(u.text),u.text=""),function(e){if(!i.test(e.address))return;let t,o;const a=e.address.match(n);if(a){if(!a[2])return;t=a[1],o=[a[2]]}else{if(e.address.indexOf('"')>=0)return;const i=e.address.split(/\s+/);let n=i.findIndex(e=>s.test(e));if(n<0&&(n=i.findIndex(e=>r.test(e))),n<0)return;t=i.splice(n,1)[0],o=i}e.address=t,e.text=[e.text].concat(o).filter(e=>e).join(" ")}(u),!u.text&&e.length&&(u.text=e.join(" "));const c={address:u.address||u.text||"",name:u.text||u.address||""};c.address===c.name&&(/@/.test(c.address||"")?c.name="":c.address=""),l.push(c)}return l}class h{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.inDomainLiteral=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){const e=[];for(let e=0,t=this.str.length;e<t;e++){const i=this.str.charAt(e),n=e<t-1?this.str.charAt(e+1):null;this.checkChar(i,n)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(this.escaped||this.operatorExpecting||(this.inDomainLiteral||"["!==e?!this.inDomainLiteral||"]"!==e&&","!==e&&";"!==e||(this.inDomainLiteral=!1):this.inDomainLiteral=!0),this.escaped);else{if(e===this.operatorExpecting)return this.node={type:"operator",value:e},t&&![" ","\t","\r","\n",",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",void(this.escaped=!1);if(!this.operatorExpecting&&!this.inDomainLiteral&&e in this.operators)return this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],void(this.escaped=!1);if(['"',"'"].includes(this.operatorExpecting)&&"\\"===e)return void(this.escaped=!0)}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),"\n"===e&&(e=" "),(e.charCodeAt(0)>=33||[" ","\t"].includes(e))&&(this.node.value+=e),this.escaped=!1}}const f=50;function g(e,t){const i=(t=t||{})._depth||0;if(i>f)return[];const n=new h(e).tokenize(),s=[];let r=[],o=[];n.forEach(e=>{"operator"!==e.type||","!==e.value&&";"!==e.value?r.push(e):(r.length&&s.push(r),r=[])}),r.length&&s.push(r),s.forEach(e=>{const t=m(e,i);for(let e=0;e<t.length;e++)o.push(t[e])});const a=[];for(let e=o.length-1;e>=0;e--){const t=o[e],i=a.length?a[a.length-1]:null;i&&""===t.address&&t.name&&!t.group&&i.address&&i.name?i.name=t.name+", "+i.name:a.push(t)}if(a.reverse(),o=a,t.flatten){const e=[],t=i=>{i.forEach(i=>{if(i.group)return t(i.group);e.push(i)})};return t(o),e}return o}t.default=g,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(bl,bl.exports)),bl.exports}var El,Tl={exports:{}};var Al,Sl={exports:{}};function Nl(){return Al||(Al=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e),this.lastByte=!1}_transform(e,t,i){let n,s=0;for(let t=0,i=e.length;t<i;t++)10===e[t]&&(t&&13!==e[t-1]||!t&&13!==this.lastByte)&&(t>s&&(n=e.slice(s,t),this.push(n)),this.push(Buffer.from("\r\n")),s=t+1);s&&s<e.length?(n=e.slice(s),this.push(n)):s||this.push(e),this.lastByte=e[e.length-1],i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Sl,Sl.exports)),Sl.exports}var kl,jl,Zl,zl={exports:{}};function Yl(){return kl||(kl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e)}_transform(e,t,i){let n,s=0;for(let t=0,i=e.length;t<i;t++)13===e[t]&&(n=e.slice(s,t),s=t+1,this.push(n));s&&s<e.length?(n=e.slice(s),this.push(n)):s||this.push(e),i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(zl,zl.exports)),zl.exports}function Xl(){return jl||(jl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(x),c=o(m),l=r(Hc()),u=w,d=r(ll()),h=o(p),f=r(vl()),g=r(Ll()),M=r(Ml()),y=o(Cl()),D=o(cl()),L=r(il()),v=o((El||(El=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(){super(),this.lastByte=!1}_transform(e,t,i){e.length&&(this.lastByte=e[e.length-1]),this.push(e),i()}_flush(e){return 10===this.lastByte?e():13===this.lastByte?(this.push(Buffer.from("\n")),e()):(this.push(Buffer.from("\r\n")),e())}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Tl,Tl.exports)),Tl.exports)),I=o(Nl()),b=o(Yl()),C=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"],E="[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~\\x80-\\uFFFF]",T=new RegExp("^"+E+"+(?:\\."+E+"+)*$"),A=/^"(?:[^"\\]|\\[\s\S])*"$/,S=/^[^\s"(),:;<>@[\\\]]+@[^\s"(),:;<>@[\\\]]+$/,N=/[/\\?#%\x00-\x20\x7F]/;function k(e){return e.replace(/[\x00-\x1f\x7f]+/g,"")}class j{constructor(e,t){this.nodeCounter=0,t=t||{},this.baseBoundary=k(t.baseBoundary||a.default.randomBytes(8).toString("hex")),this.boundaryPrefix=k(t.boundaryPrefix||"--_NmP"),this.disableFileAccess=!!t.disableFileAccess,this.disableUrlAccess=!!t.disableUrlAccess,this.normalizeHeaderKey=t.normalizeHeaderKey,this.date=t.parentNode?null:new Date,this.rootNode=t.rootNode||this,this.keepBcc=!!t.keepBcc,t.filename&&(this.filename=t.filename,e||(e=f.detectMimeType(this.filename.split(".").pop()))),this.textEncoding=(t.textEncoding||"").toString().trim().charAt(0).toUpperCase(),this.parentNode=t.parentNode,this.hostname=t.hostname,this.newline=t.newline,this.childNodes=[],this._nodeId=++this.rootNode.nodeCounter,this._headers=[],this._isPlainText=!1,this._hasLongLines=!1,this._envelope=!1,this._raw=!1,this._transforms=[],this._processFuncs=[],e&&this.setHeader("Content-Type",e)}createChild(e,t){t||"object"!=typeof e||(t=e,e=void 0);const i=new j(e,t);return this.appendChild(i),i}appendChild(e){return e.parentNode&&e.parentNode!==this&&e.remove(),e.rootNode!==this.rootNode&&(e.rootNode=this.rootNode,e._nodeId=++this.rootNode.nodeCounter),e.parentNode=this,this.childNodes.push(e),e}replace(e){return e===this?this:(this.parentNode.childNodes.forEach((t,i)=>{t===this&&(e.rootNode=this.rootNode,e.parentNode=this.parentNode,e._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,e.parentNode.childNodes[i]=e)}),e)}remove(){if(!this.parentNode)return this;for(let e=this.parentNode.childNodes.length-1;e>=0;e--)if(this.parentNode.childNodes[e]===this)return this.parentNode.childNodes.splice(e,1),this.parentNode=void 0,this.rootNode=this,this}setHeader(e,t){let i=!1;if(!t&&e&&"object"==typeof e)return e.key&&"value"in e?this.setHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.setHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.setHeader(t,e[t])}),this;const n={key:e=this._normalizeHeaderKey(e),value:t};for(let t=0,s=this._headers.length;t<s;t++)this._headers[t].key===e&&(i?(this._headers.splice(t,1),t--,s--):(this._headers[t]=n,i=!0));return i||this._headers.push(n),this}addHeader(e,t){return!t&&e&&"object"==typeof e?(e.key&&e.value?this.addHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.addHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.addHeader(t,e[t])}),this):Array.isArray(t)?(t.forEach(t=>{this.addHeader(e,t)}),this):(this._headers.push({key:this._normalizeHeaderKey(e),value:t}),this)}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,i=this._headers.length;t<i;t++)if(this._headers[t].key===e)return this._headers[t].value}setContent(e){return this.content=e,"function"==typeof this.content.pipe?(this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler),this.content=e},this.content.once("error",this._contentErrorHandler)):"string"==typeof this.content&&(this._isPlainText=f.isPlainText(this.content),this._isPlainText&&f.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=this.createReadStream(),s=[];let r=0,o=!1;return n.on("readable",()=>{let e;for(;null!==(e=n.read());)s.push(e),r+=e.length}),n.once("error",e=>{if(!o)return o=!0,i(e)}),n.once("end",e=>{if(!o)return o=!0,e&&e.length&&(s.push(e),r+=e.length),i(null,Buffer.concat(s,r))}),t}getTransferEncoding(){let e=!1;const t=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();return this.content&&(e=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim(),e&&["base64","quoted-printable"].includes(e)||(/^text\//i.test(t)?e=this._isPlainText&&!this._hasLongLines?"7bit":"string"==typeof this.content||this.content instanceof Buffer?"Q"===this._getTextEncoding(this.content)?"quoted-printable":"base64":"B"===this.textEncoding?"base64":"quoted-printable":/^(multipart|message)\//i.test(t)||(e=e||"base64"))),e}buildHeaders(){const e=this.getTransferEncoding(),t=[];if(e&&this.setHeader("Content-Transfer-Encoding",e),this.filename&&!this.getHeader("Content-Disposition")&&this.setHeader("Content-Disposition","attachment"),this.rootNode===this){this.getHeader("Date")||this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000")),this.messageId(),this.getHeader("MIME-Version")||this.setHeader("MIME-Version","1.0");for(let e=this._headers.length-2;e>=0;e--){const t=this._headers[e];"Content-Type"===t.key&&(this._headers.splice(e,1),this._headers.push(t))}}return this._headers.forEach(e=>{let i,n,s=e.key,r=e.value;const o={};if(!r||"object"!=typeof r||C.includes(s)||(d.copyOwnKeys(o,r,e=>"value"===e),r=(r.value||"").toString(),r.trim()))if(o.prepared)o.foldLines?t.push(f.foldLines(s+": "+r)):t.push(s+": "+r);else{switch(e.key){case"Content-Disposition":i=f.parseHeaderValue(r),this.filename&&(i.params.filename=this.filename),r=f.buildHeaderValue(i);break;case"Content-Type":i=f.parseHeaderValue(r),i.value=(i.value||"").toString().replace(/[\x00-\x1f\x7f]/g,""),this._handleContentType(i),i.value.match(/^text\/plain\b/)&&"string"==typeof this.content&&/[\u0080-\uFFFF]/.test(this.content)&&(i.params.charset="utf-8"),r=f.buildHeaderValue(i),this.filename&&(n=/[\x00-\x1f\x7f]/.test(this.filename)?f.encodeWord(this.filename,this._getTextEncoding(this.filename),52):this._encodeWords(this.filename),(n!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n))&&(n=JSON.stringify(n)),r+="; name="+n);break;case"Bcc":if(!this.keepBcc)return}if(r=this._encodeHeaderValue(s,r),(r||"").toString().trim()){if("function"==typeof this.normalizeHeaderKey){const e=this.normalizeHeaderKey(s,r),t="string"==typeof e?e.replace(/[\x00-\x1f\x7f]/g,""):"";t&&(s=t)}t.push(f.foldLines(s+": "+r,76))}}}),t.join("\r\n")}createReadStream(e){e=e||{};const t=new u.PassThrough(e);let i,n=t;this.stream(t,e,e=>{e?n.emit("error",e):t.end()});for(let e=0,t=this._transforms.length;e<t;e++)i="function"==typeof this._transforms[e]?this._transforms[e]():this._transforms[e],n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);i=new v.default,n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);for(let e=0,t=this._processFuncs.length;e<t;e++)i=this._processFuncs[e],n=i(n);if(this.newline){const e=["win","windows","dos","\r\n"].includes(this.newline.toString().toLowerCase())?new I.default:new b.default,t=n.pipe(e);return n.on("error",e=>t.emit("error",e)),t}return n}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,i){const n=this.getTransferEncoding();let s,r,o=!1;const a=e=>{o||(o=!0,i(e))},c=()=>{let i=0;const n=()=>{if(i>=this.childNodes.length)return e.write("\r\n--"+this.boundary+"--\r\n"),a();const s=this.childNodes[i++];e.write((i>1?"\r\n":"")+"--"+this.boundary+"\r\n"),s.stream(e,t,e=>{if(e)return a(e);setImmediate(n)})};if(!this.multipart)return a();setImmediate(n)},l=()=>{if(this.content){if("[object Error]"===Object.prototype.toString.call(this.content))return a(this.content);"function"==typeof this.content.pipe&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=e=>a(e),this.content.once("error",this._contentErrorHandler));const i=()=>{["quoted-printable","base64"].includes(n)?(s=new("base64"===n?M:g).Encoder(t),s.pipe(e,{end:!1}),s.once("end",c),s.once("error",e=>a(e)),r=this._getStream(this.content),r.pipe(s)):(r=this._getStream(this.content),r.pipe(e,{end:!1}),r.once("end",c)),r.once("error",e=>a(e))};if(this.content._resolve){const e=[];let t=0,n=!1;const s=this._getStream(this.content);s.on("error",e=>{n||(n=!0,a(e))}),s.on("readable",()=>{let i;for(;null!==(i=s.read());)e.push(i),t+=i.length}),s.on("end",()=>{n||(n=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(e,t),setImmediate(i))})}else setImmediate(i);return}return setImmediate(c)};this._raw?setImmediate(()=>{if("[object Error]"===Object.prototype.toString.call(this._raw))return a(this._raw);"function"==typeof this._raw.pipe&&this._raw.removeListener("error",this._contentErrorHandler);const t=this._getStream(this._raw);t.pipe(e,{end:!1}),t.on("error",t=>e.emit("error",t)),t.on("end",c)}):(e.write(this.buildHeaders()+"\r\n\r\n"),setImmediate(l))}setEnvelope(e){let t;this._envelope={from:!1,to:[]},e.from&&(t=[],this._convertAddresses(this._parseEnvelopeAddresses(e.from),t),t=t.filter(e=>e&&e.address),t.length&&t[0]&&(this._envelope.from=t[0].address));const i=new Set,n=[];["to","cc","bcc"].forEach(t=>{e[t]&&this._convertAddresses(this._parseEnvelopeAddresses(e[t]),n,i)}),this._envelope.to=n.map(e=>e.address).filter(e=>e);const s=["to","cc","bcc","from"];return d.copyOwnKeys(this._envelope,e,e=>s.includes(e)),this}getAddresses(){const e={},t=new Map;return this._headers.forEach(i=>{const n=i.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(n)&&(Array.isArray(e[n])||(e[n]=[],t.set(n,new Set)),this._convertAddresses(this._parseAddresses(i.value),e[n],t.get(n)))}),e}getEnvelope(){if(this._envelope)return this._envelope;const e={from:!1,to:[]},t=new Set,i=[];return this._headers.forEach(n=>{const s=[];"From"===n.key||!e.from&&["Reply-To","Sender"].includes(n.key)?(this._convertAddresses(this._parseAddresses(n.value),s),s.length&&s[0]&&(e.from=s[0].address)):["To","Cc","Bcc"].includes(n.key)&&this._convertAddresses(this._parseAddresses(n.value),i,t)}),e.to=i.map(e=>e.address),e}messageId(){let e=this.getHeader("Message-ID");return e||(e=this._generateMessageId(),this.setHeader("Message-ID",e)),e}setRaw(e){return this._raw=e,this._raw&&"function"==typeof this._raw.pipe&&(this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=e},this._raw.once("error",this._contentErrorHandler)),this}_accessDisabled(e){let t=this;for(;t;){if(t[e])return!0;t=t.parentNode}return!1}_getStream(e){let t;return e._resolvedValue?(t=new u.PassThrough,setImmediate(()=>{try{t.end(e._resolvedValue)}catch(e){t.emit("error",e)}}),t):"function"==typeof e.pipe?e:e&&"string"==typeof e.path&&!e.href?this._accessDisabled("disableFileAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("File access rejected for "+e.path);i.code=L.EFILEACCESS,t.emit("error",i)}),t):c.default.createReadStream(e.path):e&&"string"==typeof e.href?this._accessDisabled("disableUrlAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("Url access rejected for "+e.href);i.code=L.EURLACCESS,t.emit("error",i)}),t):(0,D.default)(e.href,{headers:e.httpHeaders,tls:e.tls}):(t=new u.PassThrough,setImmediate(()=>{try{t.end(e||"")}catch(e){t.emit("error",e)}}),t)}_parseAddresses(e){const t=[],i=new WeakSet,n=[],s=e=>{i.has(e)||(i.add(e),n.push({list:e,pos:0}))};for(s(Array.isArray(e)?e:[e]);n.length;){const e=n[n.length-1];if(e.pos>=e.list.length){n.pop();continue}const i=e.list[e.pos++];if(Array.isArray(i)){s(i);continue}if(i&&i.address){const e=this._normalizeAddress(i.address);if(e===i.address&&"string"==typeof i.name){t.push(i);continue}const n=d.copyOwnKeys({},i);n.address=e,n.name=i.name||"",t.push(n);continue}const r=this._normalizeParsedAddresses((0,y.default)(i));for(let e=0;e<r.length;e++)t.push(r[e])}return t}_normalizeParsedAddresses(e){return e.forEach(e=>{e.address?e.address=this._normalizeAddress(e.address):e.group&&this._normalizeParsedAddresses(e.group)}),e}_parseEnvelopeAddresses(e){return this._parseAddresses(e).map(e=>e.address||e.group||!e.name||/[\s@]/.test(e.name)?e:{address:this._normalizeAddress(e.name),name:""})}_normalizeHeaderKey(e){return e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x1f\x7f]/g,"").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,e=>e.toUpperCase()).replace(/^Content-Features$/i,"Content-features")}_handleContentType(e){if(this.contentType=e.value.trim().toLowerCase(),this.multipart=!!/^multipart\//i.test(this.contentType)&&this.contentType.substr(this.contentType.indexOf("/")+1),this.multipart){const t=k(e.params.boundary||this.boundary||"");this.boundary=e.params.boundary=t||k(this._generateBoundary())}else this.boundary=!1}_generateBoundary(){return k(this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary)+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){switch(e=this._normalizeHeaderKey(e)){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(t));case"Message-ID":case"In-Reply-To":case"Content-Id":return"<"!==(t=(t||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")).charAt(0)&&(t="<"+t),">"!==t.charAt(t.length-1)&&(t+=">"),t;case"References":return(t=[].concat.apply([],[].concat(t||"").map(e=>(e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").trim()).replace(/<[^>]*>/g,e=>e.replace(/\s/g,"")).split(/\s+/))).map(e=>("<"!==e.charAt(0)&&(e="<"+e),">"!==e.charAt(e.length-1)&&(e+=">"),e))).join(" ").trim();case"Date":return"[object Date]"===Object.prototype.toString.call(t)?t.toUTCString().replace(/GMT/,"+0000"):(t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t));case"Content-Type":case"Content-Disposition":return(t||"").toString().replace(/\r?\n|\r/g," ");default:return t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t)}}_convertAddresses(e,t,i){const n=[];if(t=t||[],!i){i=new Set;for(let e=0;e<t.length;e++)i.add(t[e].address)}return[].concat(e||[]).forEach(e=>{if(e.address)e.address=this._normalizeAddress(e.address),e.name?n.push(`${this._encodeAddressName(e.name)} <${e.address}>`):n.push(S.test(e.address)?e.address:`<${e.address}>`),i.has(e.address)||(i.add(e.address),t.push(e));else if(e.group){const s=(e.group.length?this._convertAddresses(e.group,t,i):"").trim();n.push(`${this._encodeAddressName(e.name)}:${s};`)}}),n.join(", ")}_normalizeAddress(e){if(!(e=(e||"").toString().replace(/[\x00-\x1F\x7F<>]+/g," ").trim()))return e;const t=e.lastIndexOf("@");if(t<0)return this._normalizeLocalPart(e);const i=e.substr(0,t),n=e.substr(t+1);let s=n;const r=/[\x80-\uFFFF]/.test(i);try{s=function(e,t){const i=t?h.default.domainToUnicode:h.default.domainToASCII;if("function"==typeof i&&!N.test(e)){const t=i(e);if(t)return t}return t?l.toUnicode(e):l.toASCII(e)}(n.toLowerCase(),r)}catch(e){}return`${this._normalizeLocalPart(i)}@${s}`}_normalizeLocalPart(e){return T.test(e)||A.test(e)?e:f.quoteString(e)}_encodeAddressName(e){return/^[\w ]*$/.test(e)?e:/^[\x20-\x7e]*$/.test(e)?f.quoteString(e):f.encodeWord(e,this._getTextEncoding(e),52)}_encodeHeaderText(e){return/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(e)?f.encodeWord(e,this._getTextEncoding(e),52):this._encodeWords(e)}_encodeWords(e){return f.encodeWords(e,this._getTextEncoding(e),52,!0)}_getTextEncoding(e){if(e=(e||"").toString(),this.textEncoding)return this.textEncoding;let t=0,i=0;for(let n=0,s=e.length;n<s;n++){const s=e.charCodeAt(n);s>=0&&s<=8||11===s||12===s||s>=14&&s<=31||s>=128?t++:(s>=65&&s<=90||s>=97&&s<=122)&&i++}return t<i?"Q":"B"}_generateMessageId(){return"<"+[2,2,2,6].reduce((e,t)=>e+"-"+a.default.randomBytes(t).toString("hex"),a.default.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}}t.default=j,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(fl,fl.exports)),fl.exports}var Fl,Ul={exports:{}},Gl={exports:{}};var Pl,Kl={exports:{}};var Ol,_l,Wl={exports:{}};function Hl(){return Ol||(Ol=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(Hc()),c=r(vl()),l=o(x),u=r(il());function p(e){const t=new Error('Unsupported DKIM hash algorithm "'+e+'"');return t.code=u.ECONFIG,t}function d(e,t,i,n){const s=m(e,(n=n||{}).headerFieldNames||"From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive",n.skipFields),r=function(e,t,i,n,s){const r=e=>(e||"").toString().replace(/[\x00-\x1f\x7f;=]/g,""),o=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+a.toASCII(r(e)),"q=dns/txt","s="+r(t),"bh="+s,"h="+r(i)].join("; ");return c.foldLines("DKIM-Signature: "+o,76)+";\r\n b="}(n.domainName,n.keySelector,s.fieldNames,t,i);let o,u;s.headers+="dkim-signature:"+h(r);try{o=l.default.createSign(("rsa-"+t).toUpperCase())}catch(e){throw p(t)}o.update(s.headers,"latin1");try{u=o.sign(n.privateKey,"base64")}catch(e){return!1}return r+u.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,"$&\r\n ").trim()}function m(e,t,i){const n=new Set,s=new Set,r=new Map;(i||"").toLowerCase().split(":").forEach(e=>{s.add(e.trim())}),(t||"").toLowerCase().split(":").filter(e=>!s.has(e.trim())).forEach(e=>{n.add(e.trim())});for(let t=e.length-1;t>=0;t--){const i=e[t];n.has(i.key)&&!r.has(i.key)&&r.set(i.key,h(i.line))}const o=[],a=[];return n.forEach(e=>{r.has(e)&&(a.push(e),o.push(e+":"+r.get(e)))}),{headers:o.join("\r\n")+"\r\n",fieldNames:a.join(":")}}function h(e){return e.substr(e.indexOf(":")+1).replace(/\r?\n/g,"").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}d.relaxedHeaders=m,d.unsupportedHashAlgoError=p,t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Wl,Wl.exports)),Wl.exports}function Bl(){return _l||(_l=1,function(e,t){var i=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i((Fl||(Fl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e),this.lastBytes=Buffer.alloc(4),this.headersParsed=!1,this.headerBytes=0,this.headerChunks=[],this.rawHeaders=!1,this.bodySize=0}updateLastBytes(e){const t=this.lastBytes.length,i=Math.min(e.length,t);for(let e=0,n=t-i;e<n;e++)this.lastBytes[e]=this.lastBytes[e+i];for(let n=1;n<=i;n++)this.lastBytes[t-n]=e[e.length-n]}checkHeaders(e){if(this.headersParsed)return!0;const t=this.lastBytes.length;let i=0;for(let n=0,s=this.lastBytes.length+e.length;n<s;n++){let s;if(s=n<t?this.lastBytes[n]:e[n-t],10===s&&n){const s=n-1<t?this.lastBytes[n-1]:e[n-1-t],r=n>1&&(n-2<t?this.lastBytes[n-2]:e[n-2-t]);if(10===s){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}if(13===s&&10===r){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}}}if(this.headersParsed){if(this.headerChunks.push(e.slice(0,i)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),e.length>i){const t=e.slice(i);this.bodySize+=t.length,setImmediate(()=>this.push(t))}return!1}return this.headerBytes+=e.length,this.headerChunks.push(e),this.updateLastBytes(e),!1}_transform(e,t,i){if(!e||!e.length)return i();let n;"string"==typeof e&&(e=Buffer.from(e,t));try{n=this.checkHeaders(e)}catch(e){return i(e)}n&&(this.bodySize+=e.length,this.push(e)),setImmediate(i)}_flush(e){this.headerChunks&&(this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders())),e()}parseHeaders(){const e=(this.rawHeaders||Buffer.alloc(0)).toString("binary").split(/\r?\n/),t=[];for(const i of e)t.length&&/^[ \t]/.test(i)?t[t.length-1]+="\n"+i:t.push(i);return t.filter(e=>/[^ \t\r]/.test(e)).map(e=>({key:e.substr(0,e.indexOf(":")).replace(/^[ \t]+|[ \t]+$/g,"").toLowerCase(),line:e}))}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Gl,Gl.exports)),Gl.exports)),s=i((Pl||(Pl=1,function(e,t){var i=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=w,s=i(x),r=Buffer.from("\r\n"),o=Buffer.alloc(4096,r);class a extends n.Transform{constructor(e){super(),e=e||{},this.bodyHash=s.default.createHash(e.hashAlgo||"sha256"),this.byteLength=0,this.debug=e.debug,this._debugBody=!!e.debug&&[],this._lineHasContent=!1,this._pendingWsp=!1,this._pendingCr=!1,this._pendingEmptyLines=0}_hashCanonical(e){e.length&&(this.bodyHash.update(e),this._debugBody&&this._debugBody.push(Buffer.from(e)))}_hashEmptyLines(){for(;this._pendingEmptyLines>0;){const e=Math.min(this._pendingEmptyLines,o.length/2);this._hashCanonical(o.subarray(0,2*e)),this._pendingEmptyLines-=e}}_emitContent(e,t,i){return this._lineHasContent||(this._pendingEmptyLines&&(this._hashCanonical(e.subarray(0,t)),t=0,this._hashEmptyLines()),this._lineHasContent=!0),this._pendingWsp&&(e[t++]=32,this._pendingWsp=!1),e[t++]=i,t}updateHash(e,t){const i=Buffer.allocUnsafe(2*e.length+2);let n=0;for(let t=0;t<e.length;t++){const s=e[t];10!==s?(this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),13===s?this._pendingCr=!0:32===s||9===s?this._pendingWsp=!0:n=this._emitContent(i,n,s)):(this._lineHasContent?(i[n++]=13,i[n++]=10,this._lineHasContent=!1):this._pendingEmptyLines++,this._pendingWsp=!1,this._pendingCr=!1)}t&&this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),this._hashCanonical(i.subarray(0,n))}_transform(e,t,i){if(!e||!e.length)return i();"string"==typeof e&&(e=Buffer.from(e,t)),this.updateHash(e),this.byteLength+=e.length,this.push(e),i()}_flush(e){this.updateHash(Buffer.alloc(0),!0),this._lineHasContent&&this._hashCanonical(r),this.emit("hash",this.bodyHash.digest("base64"),!!this.debug&&Buffer.concat(this._debugBody)),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Kl,Kl.exports)),Kl.exports)),r=i(Hl()),o=w,a=i(m),c=i(D),l=i(x),u=al();class p{constructor(e,t,i,n){this.options=e||{},this.keys=t,this.cacheTreshold=Number(this.options.cacheTreshold)||10485760,this.hashAlgo=this.options.hashAlgo||"sha256",this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=!!this.cacheDir&&c.default.join(this.cacheDir,"message."+Date.now()+"-"+l.default.randomBytes(14).toString("hex")),this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=i,this.output=n,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",e=>{this.hasErrored=!0,this.cleanup(),n.emit("error",e)})}cleanup(){this.cache&&this.cachePath&&a.default.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=a.default.createReadStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.output.emit("error",e)}),this.cache.once("close",()=>{this.cleanup()}),this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored)return;if(this.readPos>=this.chunks.length)return this.cache?this.createReadCache():void this.output.end();const e=this.chunks[this.readPos++];!1!==this.output.write(e)?setImmediate(()=>this.sendNextChunk()):this.output.once("drain",()=>{this.sendNextChunk()})}sendSignedOutput(){let e=0;const t=()=>{if(e>=this.keys.length)return this.output.write(this.parser.rawHeaders),void setImmediate(()=>this.sendNextChunk());const i=this.keys[e++];let n;try{n=(0,r.default)(this.headers,this.hashAlgo,this.bodyHash,{domainName:i.domainName,keySelector:i.keySelector,privateKey:i.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields})}catch(e){return this.hasErrored=!0,this.cleanup(),void this.output.emit("error",e)}n&&this.output.write(Buffer.from(n+"\r\n")),setImmediate(t)};if(this.bodyHash&&this.headers)return t();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=a.default.createWriteStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;null!==this.relaxedBody.read(););}),this.hasErrored=!0,this.output.emit("error",e)}),this.cache.once("close",()=>{this.sendSignedOutput()}),this.relaxedBody.removeAllListeners("readable"),this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new n.default,this.relaxedBody=new s.default({hashAlgo:this.hashAlgo}),this.parser.on("headers",e=>{this.headers=e}),this.relaxedBody.on("hash",e=>{this.bodyHash=e}),this.relaxedBody.on("readable",()=>{let e;if(!this.cache)for(;null!==(e=this.relaxedBody.read());)if(this.chunks.push(e),this.chunklen+=e.length,this.chunklen>=this.cacheTreshold&&this.cachePath)return this.createWriteCache()}),this.relaxedBody.on("end",()=>{this.cache||this.sendSignedOutput()}),this.parser.pipe(this.relaxedBody),setImmediate(()=>this.input.pipe(this.parser))}}t.default=class{constructor(e){this.options=e||{},this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){const i=new o.PassThrough;let n=e,s=!1;Buffer.isBuffer(e)?(s=e,n=new o.PassThrough):"string"==typeof e&&(s=Buffer.from(e),n=new o.PassThrough);let a=this.options;t&&Object.keys(t).length&&(a=(0,u.copyOwnKeys)({},t),(0,u.copyOwnKeys)(a,this.options));const c=new p(a,this.keys,n,i);return setImmediate(()=>{try{c.signStream()}catch(e){return void i.emit("error",r.default.unsupportedHashAlgoError(c.hashAlgo))}s&&setImmediate(()=>{n.end(s)})}),i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ul,Ul.exports)),Ul.exports}var Vl,Ql={exports:{}};var Rl,Jl,ql={exports:{}};function $l(){return Jl||(Jl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=r(ll()),p=r(dl()),m=o((Zl||(Zl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(Xl()),c=r(vl()),l=ll();function u(e){const t=e;return"object"==typeof e&&!!(t.content||t.path||t.href||t.raw)}t.default=class{constructor(e){this.mail=e||{},this.message=!1}compile(){return this._alternatives=this.getAlternatives(),this._htmlNode=this._alternatives.filter(e=>/^text\/html\b/i.test(e.contentType)).pop(),this._attachments=this.getAttachments(!!this._htmlNode),this._useRelated=!(!this._htmlNode||!this._attachments.related.length),this._useAlternative=this._alternatives.length>1,this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&1===this._attachments.attached.length,this.mail.raw?this.message=new a.default("message/rfc822",{newline:this.mail.newline,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess}).setRaw(this.mail.raw):this._useMixed?this.message=this._createMixed():this._useAlternative?this.message=this._createAlternative():this._useRelated?this.message=this._createRelated():this.message=this._createContentNode(!1,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""}),this.mail.headers&&this.message.addHeader(this.mail.headers),["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach(e=>{const t=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase());this.mail[t]&&this.message.setHeader(e,this.mail[t])}),this.mail.envelope&&this.message.setEnvelope(this.mail.envelope),this.message.messageId(),this.message}getAttachments(e){let t;const i=[].concat(this.mail.attachments||[]).map((e,t)=>{/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e));const i=e.contentType||c.detectMimeType(e.filename||e.path||e.href||"bin"),n=/^image\//i.test(i),s=/^message\//i.test(i),r=e.contentDisposition||(s||n&&e.cid?"inline":"attachment");let o;o="contentTransferEncoding"in e?e.contentTransferEncoding:s?"8bit":"base64";const a={contentType:i,contentDisposition:r,contentTransferEncoding:o};return e.filename?a.filename=e.filename:s||!1===e.filename||(a.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(t+1),a.filename.indexOf(".")<0&&(a.filename+="."+c.detectExtension(a.contentType))),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.cid&&(a.cid=e.cid),e.raw?a.raw=e.raw:e.path?a.content={path:e.path}:e.href?a.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls}:a.content=e.content||"",e.encoding&&(a.encoding=e.encoding),e.headers&&(a.headers=e.headers),a});return this.mail.icalEvent&&(t=Object.assign({},this._getIcalEvent()),t.contentType="application/ics",t.headers||(t.headers={}),t.filename=t.filename||"invite.ics",t.headers["Content-Disposition"]="attachment",t.headers["Content-Transfer-Encoding"]="base64"),e?{attached:i.filter(e=>!e.cid).concat(t||[]),related:i.filter(e=>!!e.cid)}:{attached:i.concat(t||[]),related:[]}}_getIcalEvent(){if(!this._icalEvent){let e;e=u(this.mail.icalEvent)?(0,l.copyOwnKeys)({},this.mail.icalEvent):{content:this.mail.icalEvent},/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e)),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.raw||(e.path?(e.content={path:e.path},e.path=void 0):e.href&&(e.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls},e.href=void 0)),e.content&&"object"==typeof e.content&&(e.content._resolve=!0),this._icalEvent=e}return this._icalEvent}getAlternatives(){const e=[];let t,i,n,s,r;return this.mail.text&&(t=u(this.mail.text)?this.mail.text:{content:this.mail.text},t.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(n=u(this.mail.watchHtml)?this.mail.watchHtml:{content:this.mail.watchHtml},n.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(s=u(this.mail.amp)?this.mail.amp:{content:this.mail.amp},s.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(r=Object.assign({},this._getIcalEvent()),r.filename=!1,r.contentType="text/calendar; charset=utf-8; method="+(r.method||"PUBLISH").toString().trim().toUpperCase(),r.headers||(r.headers={})),this.mail.html&&(i=u(this.mail.html)?this.mail.html:{content:this.mail.html},i.contentType="text/html; charset=utf-8"),[].concat(t||[]).concat(n||[]).concat(s||[]).concat(i||[]).concat(r||[]).concat(this.mail.alternatives||[]).forEach(t=>{/^data:/i.test(t.path||t.href)&&(t=this._processDataUrl(t));const i={contentType:t.contentType||c.detectMimeType(t.filename||t.path||t.href||"txt"),contentTransferEncoding:t.contentTransferEncoding};t.filename&&(i.filename=t.filename),/^https?:\/\//i.test(t.path)&&(t.href=t.path,t.path=void 0),t.raw?i.raw=t.raw:t.path?i.content={path:t.path}:t.href?i.content={href:t.href,httpHeaders:t.httpHeaders,tls:t.tls}:i.content=t.content||"",t.encoding&&(i.encoding=t.encoding),t.headers&&(i.headers=t.headers),e.push(i)}),e}_createMixed(e){const t=e?e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._useAlternative?this._createAlternative(t):this._useRelated&&this._createRelated(t),[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach(e=>{this._useRelated&&e===this._htmlNode||this._createContentNode(t,e)}),t}_createAlternative(e){const t=e?e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._alternatives.forEach(e=>{this._useRelated&&this._htmlNode===e?this._createRelated(t):this._createContentNode(t,e)}),t}_createRelated(e){const t=e?e.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._createContentNode(t,this._htmlNode),this._attachments.related.forEach(e=>this._createContentNode(t,e)),t}_createContentNode(e,t){(t=t||{}).content=t.content||"";const i=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,""),n=e?e.createChild(t.contentType,{filename:t.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default(t.contentType,{filename:t.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return t.headers&&n.addHeader(t.headers),t.cid&&n.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">"),t.contentTransferEncoding?n.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(t.contentType)&&n.setHeader("Content-Transfer-Encoding",this.mail.encoding),/^text\//i.test(t.contentType)&&!t.contentDisposition||n.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment")),"string"!=typeof t.content||["utf8","usascii","ascii"].includes(i)||(t.content=Buffer.from(t.content,i)),t.raw?n.setRaw(t.raw):n.setContent(t.content),n}_processDataUrl(e){const t=e.path||e.href;if(!t||"string"!=typeof t)return e;if(!t.startsWith("data:"))return e;if(t.length>52428800){let i="application/octet-stream";const n=t.indexOf(",");if(n>0&&n<200){const e=t.substring(5,n).split(";");e[0]&&e[0].includes("/")&&(i=e[0].trim())}return Object.assign((0,l.copyOwnKeys)({},e),{path:!1,href:!1,content:Buffer.alloc(0),contentType:e.contentType||i})}let i;try{i=(0,l.parseDataURI)(t)}catch(t){return e}return i?(e.content=i.data,e.contentType=e.contentType||i.contentType,"path"in e&&(e.path=!1),"href"in e&&(e.href=!1),e):e}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(hl,hl.exports)),hl.exports)),h=o(Bl()),f=o((Vl||(Vl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(u),c=o(L),l=r(Bc()),p=r(il());t.default=function e(t,i,n,s,r){"function"==typeof s&&(r=s,s={}),s=s||{};const o=r;if(!(i=Number(i)||0)||/[\r\n]/.test(n)){const e=new Error("Invalid proxy destination");return e.code=p.EPROXY,void setImmediate(()=>o(e))}const u=l.parse(t),d={host:u.hostname,port:Number(u.port)?Number(u.port):"https:"===u.protocol?443:80};let m,h;"https:"===u.protocol?(d.rejectUnauthorized=!1!==s.rejectUnauthorized,m=c.default.connect.bind(c.default)):m=a.default.connect.bind(a.default);let f=!1;const g=e=>{if(!f){f=!0;try{h.destroy()}catch(e){}o(e)}},w=()=>{const e=new Error("Proxy socket timed out");e.code="ETIMEDOUT",g(e)};h=m(d,()=>{if(f)return;const e={Host:n+":"+i,Connection:"close"};u.auth&&(e["Proxy-Authorization"]="Basic "+Buffer.from(u.auth).toString("base64")),h.write("CONNECT "+n+":"+i+" HTTP/1.1\r\n"+Object.keys(e).map(t=>t+": "+e[t]).join("\r\n")+"\r\n\r\n");let t="";const s=e=>{let i,n;if(!f){if(t+=e.toString("binary"),i=t.match(/\r\n\r\n/)){if(h.removeListener("data",s),n=t.substr(i.index+i[0].length),t=t.substr(0,i.index),n&&h.unshift(Buffer.from(n,"binary")),f=!0,i=t.match(/^HTTP\/\d+\.\d+ (\d+)/i),!i||"2"!==(i[1]||"").charAt(0)){try{h.destroy()}catch(e){}const e=new Error("Invalid response from proxy"+(i&&": "+i[1]||""));return e.code=p.EPROXY,o(e)}return h.removeListener("error",g),h.removeListener("timeout",w),h.setTimeout(0),o(null,h)}if(t.length>65536){h.removeListener("data",s);const e=new Error("Proxy response headers too large");return e.code=p.EPROXY,g(e)}}};h.on("data",s)}),h.setTimeout(e.timeout||3e4),h.on("timeout",w),h.once("error",g)},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ql,Ql.exports)),Ql.exports)),g=r(il()),w=o(d),y=r(Bc()),D=r($c()),v=o((Rl||(Rl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(ll()),c=o(Xl()),l=r(vl()),u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.default=class{constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};const i=e.options||{},n=e._defaults||{};a.copyOwnKeys(this.data,t),this.data.headers=this.data.headers||{},a.copyOwnKeys(this.data,n,e=>u(this.data,e)),a.copyOwnKeys(this.data.headers,n.headers,e=>u(this.data.headers,e)),["disableFileAccess","disableUrlAccess","normalizeHeaderKey","maxRecipients"].forEach(e=>{e in i&&(this.data[e]=i[e])}),["disableFileAccess","disableUrlAccess"].forEach(e=>{!(e in i)&&u(n,e)&&(this.data[e]=this.data[e]||n[e])})}resolveContent(e,t,i,n){n||"function"!=typeof i||(n=i,i=!1),i=i||{};const s={disableFileAccess:this.data.disableFileAccess||i.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess||i.disableUrlAccess};return a.resolveContent(e,t,s,n)}resolveAll(e){const t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach((e,i)=>{t.push([this.data.alternatives,i])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((e,i)=>{e.filename||(e.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(i+1),e.filename.indexOf(".")<0&&(e.filename+="."+l.detectExtension(e.contentType))),e.contentType||(e.contentType=l.detectMimeType(e.filename||e.path||e.href||"bin")),t.push([this.data.attachments,i])});const i=new c.default;["from","to","cc","bcc","sender","replyTo"].forEach(e=>{let t;this.message?t=[].concat(i._parseAddresses(this.message.getHeader("replyTo"===e?"reply-to":e))||[]):this.data[e]&&(t=[].concat(i._parseAddresses(this.data[e])||[])),t&&t.length?this.data[e]=t:e in this.data&&(this.data[e]=null)}),["from","sender"].forEach(e=>{this.data[e]&&(this.data[e]=this.data[e].shift())});let n=0;const s=()=>{if(n>=t.length)return e(null,this.data);const i=t[n++];if(!i[0]||!i[0][i[1]])return s();a.resolveContent(...i,{disableFileAccess:this.data.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess},(t,n)=>{if(t)return e(t);const r={content:n};i[0][i[1]]&&"object"==typeof i[0][i[1]]&&!Buffer.isBuffer(i[0][i[1]])&&a.copyOwnKeys(r,i[0][i[1]],e=>e in r||["content","path","href","raw"].includes(e)),i[0][i[1]]=r,s()})};setImmediate(()=>s())}normalize(e){const t=this.message.getEnvelope(),i=this.message.messageId();this.resolveAll((n,s)=>n?e(n):(s.envelope=t,s.messageId=i,["html","text","watchHtml","amp"].forEach(e=>{s[e]&&s[e].content&&("string"==typeof s[e].content?s[e]=s[e].content:Buffer.isBuffer(s[e].content)&&(s[e]=s[e].content.toString()))}),s.icalEvent&&Buffer.isBuffer(s.icalEvent.content)&&(s.icalEvent.content=s.icalEvent.content.toString("base64"),s.icalEvent.encoding="base64"),s.alternatives&&s.alternatives.length&&s.alternatives.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),s.attachments&&s.attachments.length&&s.attachments.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),s.normalizedHeaders={},Object.keys(s.headers||{}).forEach(e=>{if(a.isProtoKey(e))return;let t=[].concat(s.headers[e]||[]).shift();t=t&&t.value||t,t&&(["references","in-reply-to","message-id","content-id"].includes(e)&&(t=this.message._encodeHeaderValue(e,t)),s.normalizedHeaders[e]=t)}),s.list&&"object"==typeof s.list&&this._getListHeaders(s.list).forEach(e=>{s.normalizedHeaders[e.key]=e.value.map(e=>e&&e.value||e).join(", ")}),s.references&&(s.normalizedHeaders.references=this.message._encodeHeaderValue("references",s.references)),s.inReplyTo&&(s.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",s.inReplyTo)),e(null,s)))}setMailerHeader(){this.message&&this.data.xMailer&&this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(this.message&&this.data.priority)switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low")}}setListHeaders(){this.message&&this.data.list&&"object"==typeof this.data.list&&this._getListHeaders(this.data.list).forEach(e=>{e.value.forEach(t=>{this.message.addHeader(e.key,t)})})}_getListHeaders(e){return Object.keys(e).map(t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map(e=>({prepared:!0,foldLines:!0,value:[].concat(e||[]).map(e=>{if("string"==typeof e&&(e={url:e}),e&&e.url){let i=(e.comment||"").toString().replace(/\r?\n|\r/g," ");const n=!l.isPlainText(i)||/\x7f/.test(i);return"id"===t.toLowerCase().trim()?(i=n?l.encodeWord(i):l.quoteString(i),(e.comment?i+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+:\/{0,2}/,"<")):(i=n?l.encodeWord(i):i.replace(/[()\\]/g,"\\$&"),this._formatListUrl(e.url)+(e.comment?" ("+i+")":""))}return""}).filter(e=>e).join(", ")}))}))}_formatListUrl(e){return e=e.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ql,ql.exports)),ql.exports)),I=o(u),b=o(M),C=o(x);class E extends a.EventEmitter{constructor(e,t,i){super(),this.options=t||{},this._defaults=i||{},this._defaultPlugins={compile:[(...e)=>this._convertDataImages(...e)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=!!this.options.dkim&&new h.default(this.options.dkim),this.transporter=e,this.transporter.mailer=this,this.logger=c.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),"function"==typeof this.transporter.on&&(this.transporter.on("log",e=>{this.logger.debug({tnx:"transport"},"%s: %s",e.type,e.message)}),this.transporter.on("error",e=>{this.logger.error({err:e,tnx:"transport"},"Transport Error: %s",e.message),this.emit("error",e)}),this.transporter.on("idle",(...e)=>{this.emit("idle",...e)}),this.transporter.on("clear",(...e)=>{this.emit("clear",...e)})),["close","isIdle","verify"].forEach(e=>{this[e]=(...t)=>"function"==typeof this.transporter[e]?("verify"===e&&"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[e](...t)):(this.logger.warn({tnx:"transport",methodName:e},"Non existing method %s called for transport",e),!1)}),this.options.proxy&&"string"==typeof this.options.proxy&&this.setupProxy(this.options.proxy)}use(e,t){return e=(e||"").toString(),this._userPlugins.hasOwnProperty(e)?this._userPlugins[e].push(t):this._userPlugins[e]=[t],this}sendMail(e,t=null){let i;t||(i=new Promise((e,i)=>{t=c.callbackPromise(e,i)}));const n=t;"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);const s=new v.default(this,e);return this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version),this._processPlugins("compile",s,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",e.message),n(e);let t;try{s.message=new m.default(s.data).compile(),s.setMailerHeader(),s.setPriorityHeaders(),s.setListHeaders(),t=s.message.getEnvelope().to.length}catch(e){return this.logger.error({err:e,tnx:"transport",action:"send"},"Compile Error: %s",e.message),n(e)}const i=void 0===s.data.maxRecipients?1e5:s.data.maxRecipients;if(i&&t>i){const e=new Error(`Message has ${t} recipients, which is over the ${i} allowed by maxRecipients`);return e.code=g.EMAXRECIPIENTS,this.logger.error({err:e,tnx:"transport",action:"send"},"Send Error: %s",e.message),n(e)}this._processPlugins("stream",s,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"stream"},"PluginStream Error: %s",e.message),n(e);(s.data.dkim||this.dkim)&&s.message.processFunc(e=>{const t=s.data.dkim?new h.default(s.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:s.message.messageId(),dkimDomains:t.keys.map(e=>e.keySelector+"."+e.domainName).join(", ")},"Signing outgoing message with %s keys",t.keys.length),t.sign(e,s.data._dkim)}),this.transporter.send(s,(...e)=>{e[0]&&this.logger.error({err:e[0],tnx:"transport",action:"send"},"Send Error: %s",e[0].message),n(...e)})})}),i}getVersionString(){return w.default.format("%s (%s; +%s; %s/%s)",D.name,D.version,D.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,i){if(e=(e||"").toString(),!this._userPlugins.hasOwnProperty(e))return i();const n=this._userPlugins[e]||[],s=this._defaultPlugins[e]||[];if(n.length&&this.logger.debug({tnx:"transaction",pluginCount:n.length,step:e},"Using %s plugins for %s",n.length,e),n.length+s.length===0)return i();let r=0,o="default";const a=()=>{let e="default"===o?s:n;if(r>=e.length){if("default"!==o||!n.length)return i();o="user",r=0,e=n}(0,e[r++])(t,e=>{if(e)return i(e);a()})};a()}setupProxy(e){const t=y.parse(e);this.getSocket=(e,i)=>{const n=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+n))return this.meta.get("proxy_handler_"+n)(t,e,i);switch(n){case"http":case"https":return void(0,f.default)(t.href,e.port,e.host,this.options.tls||{},(e,t)=>e?i(e):i(null,{connection:t}));case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){let e=new Error("Socks module not loaded");return e.code=g.EPROXY,i(e)}const n=n=>{const s=!!this.meta.get("proxy_socks_module").SocksClient,r=s?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),o=Number(t.protocol.replace(/\D/g,""))||5,a={proxy:{ipaddress:n,port:Number(t.port),type:o},[s?"destination":"target"]:{host:e.host,port:e.port},command:"connect"};if(t.username||t.password){const e=t.username||"",i=t.password||"";s?(a.proxy.userId=e,a.proxy.password=i):4===o?a.userid=e:a.authentication={username:e,password:i}}r.createConnection(a,(e,t)=>e?i(e):i(null,{connection:t.socket||t}))};return I.default.isIP(t.hostname)?n(t.hostname):b.default.resolve(t.hostname,(e,t)=>{if(e)return i(e);n(Array.isArray(t)?t[0]:t)})}}let s=new Error("Unknown proxy configuration");s.code=g.EPROXY,i(s)}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html)return t();e.resolveContent(e.data,"html",{disableFileAccess:e.data.disableFileAccess,disableUrlAccess:e.data.disableUrlAccess},(i,n)=>{if(i)return t(i);let s=0;n=(n||"").toString().replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi,(t,i,n,r)=>{const o=C.default.randomBytes(10).toString("hex")+"@localhost";return e.data.attachments||(e.data.attachments=[]),Array.isArray(e.data.attachments)||(e.data.attachments=[].concat(e.data.attachments||[])),e.data.attachments.push({path:n,cid:o,filename:"image-"+ ++s+"."+p.detectExtension(r)}),i+"cid:"+o}),e.data.html=n,t()})}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}}t.default=E,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Kc,Kc.exports)),Kc.exports}var eu,tu,iu={exports:{}},nu={exports:{}},su={exports:{}},ru={exports:{}};function ou(){return tu||(tu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r($c()),c=l,p=o(u),d=o(L),m=o(y),h=o(x),f=o((eu||(eu=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w,n=Buffer.from("\n"),s=Buffer.from("\n."),r=Buffer.from("\r"),o=Buffer.from(".");class a extends i.Transform{constructor(e){super(e),this.options=e||{},this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(e,t,i){const a=[];let c,l,u,p=0,d=0;if(!e||!e.length)return i();for("string"==typeof e&&(e=Buffer.from(e)),this.inByteCount+=e.length,c=0,l=e.length;c<l;c++){const t=e[c],i=c?e[c-1]:this.lastByte;let l=!1;13===i&&10!==t?l=46===t?s:n:10===t&&13!==i?l=r:46!==t||10!==i&&!1!==i||(l=o),l&&(c>d&&(u=e.slice(d,c),a.push(u),p+=u.length),a.push(l),p+=l.length,d=c)}a.length?(d<e.length&&(u=e.slice(d),a.push(u),p+=u.length),this.outByteCount+=p,this.push(Buffer.concat(a,p))):(this.outByteCount+=e.length,this.push(e)),this.lastByte=e[e.length-1],i()}_flush(e){let t;t=10===this.lastByte?Buffer.from(".\r\n"):13===this.lastByte?Buffer.from("\n.\r\n"):Buffer.from("\r\n.\r\n"),this.outByteCount+=t.length,this.push(t),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ru,ru.exports)),ru.exports)),g=w,M=r(ll()),D=6e5,v=()=>{};function I(e){if(!e)return e;const t=Buffer.from(e,"binary").toString("utf8");return t.includes("�")?e:t}function b(e){return/^\d+-/.test(e)}class C extends c.EventEmitter{constructor(e){super(e),this.id=h.default.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=e||{},this.options.requireTLS&&(this.options.ignoreTLS||this.options.opportunisticTLS)&&(this.options=Object.assign({},this.options,{ignoreTLS:!1,opportunisticTLS:!1})),this.secureConnection=!!this.options.secure,this.alreadySecured=!!this.options.secured,this.port=Number(this.options.port)||(this.secureConnection?465:587),this.host=this.options.host||"localhost",this.servername=this.options.servername?this.options.servername:!p.default.isIP(this.host)&&this.host,this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,void 0===this.options.secure&&465===this.port&&(this.secureConnection=!0),this.name=(this.options.name||this._getHostname()).toString().replace(/[\r\n]+/g,""),this.logger=M.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map;for(const e of Object.keys(this.options.customAuth||{})){const t=(e||"").toString().trim().toUpperCase();t&&this.customAuth.set(t,this.options.customAuth[e])}this.version=a.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],this._responsePartial=!1,this.lastServerResponse=!1,this._socket=!1,this._supportedAuth=[],this.allowsAuth=!1,this._envelope=!1,this._supportedExtensions=[],this._maxAllowedSize=0,this._responseActions=[],this._recipientQueue=[],this._greetingTimeout=!1,this._connectionTimeout=!1,this._destroyed=!1,this._closing=!1,this._currentDataStream=!1,this._pendingSend=!1,this._connectCallback=!1,this._onSocketData=e=>this._onData(e),this._onSocketError=e=>this._onError(e,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout(),this._onConnectionSocketError=e=>this._onConnectionError(e,"ESOCKET"),this._connectionAttemptId=0}connect(e){if("function"==typeof e){this._connectCallback=e,this.once("connect",()=>{this._connectCallback=!1,this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),e()});const t=this._isDestroyedMessage("connect");if(t)return e(this._formatError(t,"ECONNECTION",!1,"CONN"))}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||3e4};return this.options.localAddress&&(t.localAddress=this.options.localAddress),this.options.connection?(this._socket=this.options.connection,this._setupConnectionHandlers(),void(this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()})):setImmediate(()=>this._onConnect()))):this.options.socket?(this._socket=this.options.socket,this._resolveAndConnect(t,e=>{try{this._socket.connect(this.port,this.host,()=>{if(this._socket.setKeepAlive(!0),this.secureConnection&&!this.alreadySecured)return this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()});this._onConnect()}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}})):(this.secureConnection&&(Object.assign(t,this.options.tls||{}),this.servername&&!t.servername&&(t.servername=this.servername)),this._resolveAndConnect(t,e=>{this._fallbackAddresses=(e._addresses||[]).filter(e=>e!==t.host),this._connectOpts=Object.assign({},t),this._connectToHost(t,this.secureConnection)}))}_resolveAndConnect(e,t){return M.resolveHostname(e,(i,n)=>{if(i)return setImmediate(()=>this._onError(i,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:n.host,cached:!!n.cached},"Resolved %s as %s [cache %s]",e.host,n.host,n.cached?"hit":"miss");for(const t of Object.keys(n))"_"!==t.charAt(0)&&n[t]&&(e[t]=n[t]);t(n)})}_connectToHost(e,t){if(this._destroyed||this._closing)return;this._connectionAttemptId++;const i=this._connectionAttemptId,n=t?d.default.connect:p.default.connect;try{this._socket=n(e,()=>{this._connectionAttemptId===i&&(this._socket.setKeepAlive(!0),this._onConnect())}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}}_setupConnectionHandlers(){this._connectionTimeout=setTimeout(()=>{this._onConnectionError("Connection timeout","ETIMEDOUT")},this.options.connectionTimeout||12e4),this._socket.on("error",this._onConnectionSocketError)}_onConnectionError(e,t){clearTimeout(this._connectionTimeout);if(!(this._fallbackAddresses&&this._fallbackAddresses.length&&"init"===this.stage&&!this._destroyed))return void this._onError(e,t,!1,"CONN");const i=this._fallbackAddresses.shift();if(this.logger.info({tnx:"network",failedHost:this._connectOpts.host,nextHost:i,error:e.message||e},"Connection to %s failed, trying %s",this._connectOpts.host,i),this._socket){try{this._socket.removeListener("error",this._onConnectionSocketError),this._socket.on("error",v),this._socket.destroy()}catch(e){}this._socket=null}this._connectOpts.host=i,this._connectToHost(this._connectOpts,this.secureConnection)}quit(){this._sendCommand("QUIT"),this._responseActions.push(this.close)}close(){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._responseActions=[],this._closing)return;this._closing=!0;const e="init"===this.stage?"destroy":"end";this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);const t=this._socket&&this._socket.socket||this._socket;if(this._currentDataStream){try{this._currentDataStream.unpipe(this._socket)}catch(e){}this._currentDataStream=!1}if(this._pendingSend){const{stream:e,onStreamError:t}=this._pendingSend;e&&(e.removeListener("error",t),e.on("error",v)),this._pendingSend=!1}if(t&&!t.destroyed)try{t.setTimeout(0),t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout),t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError),t.on("error",v),t[e]()}catch(e){}this._destroy()}login(e,t){const i=this._isDestroyedMessage("login");if(i)return t(this._formatError(i,"ECONNECTION",!1,"API"));this._auth=e||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1;const n=!!this._auth.oauth2||this.customAuth.has("XOAUTH2");if(this._authMethod||!this._auth.oauth2||this._auth.credentials){if(!this._authMethod||"XOAUTH2"===this._authMethod&&!this._auth.oauth2){const e=this._supportedAuth.find(e=>"XOAUTH2"!==e||n);this._authMethod=(e||"PLAIN").toUpperCase().trim()}}else this._authMethod="XOAUTH2";if(("XOAUTH2"!==this._authMethod||this.customAuth.has("XOAUTH2"))&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass)){if(!(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod)))return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options}}if(this.customAuth.has(this._authMethod)){const e=this.customAuth.get(this._authMethod);let i,n=!1;const s=()=>{n||(n=!0,this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0))},r=e=>{n||(n=!0,t(this._formatError(e,"EAUTH",i,"AUTH "+this._authMethod)))},o=(e,t)=>{let n;return t||(n=new Promise((e,i)=>{t=M.callbackPromise(e,i)})),this._responseActions.push(n=>{i=n;let s=n.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),r={command:e,response:n};s?(r.status=Number(s[1])||0,s[2]&&(r.code=s[2]),r.text=n.substr(s[0].length)):(r.text=n,r.status=0),t(null,r)}),setImmediate(()=>this._sendCommand(e)),n},a=e({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:o,resolve:s,reject:r});return void(a&&"function"==typeof a.catch&&a.then(s).catch(r))}switch(this._authMethod){case"XOAUTH2":return void this._handleXOauth2Token(!1,t);case"LOGIN":return this._responseActions.push(e=>{this._actionAUTH_LOGIN_USER(e,t)}),void this._sendCommand("AUTH LOGIN");case"PLAIN":return this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),void this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0/* secret */","utf-8").toString("base64"));case"CRAM-MD5":return this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5(e,t)}),void this._sendCommand("AUTH CRAM-MD5")}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(e,t,i){let n=!1;const s=(e,t)=>{n||(n=!0,this._pendingSend&&this._pendingSend.callback===s&&(this._pendingSend=!1),i(e,t))};if(!t)return s(this._formatError("Empty message","EMESSAGE",!1,"API"));const r=this._isDestroyedMessage("send message");if(r)return s(this._formatError(r,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&e.size>this._maxAllowedSize)return void setImmediate(()=>{s(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});const o={callback:s,stream:!1,onStreamError:e=>s(this._formatError(e,"ESTREAM",!1,"API"))};"function"==typeof t.on&&(o.stream=t,o.stream.on("error",o.onStreamError)),this._pendingSend=o;const a=Date.now();this._setEnvelope(e,(e,i)=>{if(e){const i=new g.PassThrough;return"function"==typeof t.pipe?t.pipe(i):(i.write(t),i.end()),s(e)}const n=Date.now(),r=this._createSendStream((e,t)=>{if(e)return s(e);const o=i;return o.envelopeTime=n-a,o.messageTime=Date.now()-n,o.messageSize=r.outByteCount,o.response=t,s(null,o)});"function"==typeof t.pipe?t.pipe(r):(r.write(t),r.end())})}reset(e){const t=this._isDestroyedMessage("reset");if(t)return e(this._formatError(t,"ECONNECTION",!1,"API"));this._sendCommand("RSET"),this._responseActions.push(t=>"2"!==t.charAt(0)?e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET")):(this._envelope=!1,e(null,!0)))}_onConnect(){const e=this._socket;clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",e.remoteAddress,e.remotePort),this._destroyed?this.close():(this.stage="connected",e.removeListener("data",this._onSocketData),e.removeListener("timeout",this._onSocketTimeout),e.removeListener("close",this._onSocketClose),e.removeListener("end",this._onSocketEnd),e.removeListener("error",this._onConnectionSocketError),e.removeListener("error",this._onSocketError),e.on("error",this._onSocketError),e.on("data",this._onSocketData),e.once("close",this._onSocketClose),e.once("end",this._onSocketEnd),e.setTimeout(this.options.socketTimeout||D),e.on("timeout",this._onSocketTimeout),this._greetingTimeout=setTimeout(()=>{this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting&&this._onError("Greeting never received","ETIMEDOUT",!1,"CONN")},this.options.greetingTimeout||3e4),this._responseActions.push(this._actionGreeting),e.resume())}_onData(e){if(this._destroyed||!e||!e.length)return;const t=this.options.maxResponseSize||1048576,i=e.toString("binary");if(!i.includes("\n"))return this._remainder+=i,this._remainder.length>t?this._onResponseTooLarge():void 0;const n=(this._remainder+i).split(/\r?\n/);this._remainder=n.pop();for(let e=0,i=n.length;e<i;e++)if(this._responsePartial?this._responseQueue[this._responseQueue.length-1]+="\n"+n[e]:this._responseQueue.push(n[e]),this._responsePartial=b(n[e]),this._responsePartial&&this._responseQueue[this._responseQueue.length-1].length>t)return this._onResponseTooLarge();if(this._remainder.length>t)return this._onResponseTooLarge();this._responsePartial||this._processResponse()}_onResponseTooLarge(){this._remainder="",this._responseQueue=[],this._responsePartial=!1,this._onError(new Error("Server response exceeds maximum allowed size"),"EPROTOCOL",!1,"CONN")}_onError(e,t,i,n){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._destroyed)return;e=this._formatError(e,t,i,n);["ETIMEDOUT","ESOCKET","ECONNECTION"].includes(e.code)?this.logger.warn(i,e.message):this.logger.error(i,e.message);const s=this._pendingSend;this.emit("error",e),this.close(),s&&s.callback(e)}_formatError(e,t,i,n){let s;s=/Error\]$/i.test(Object.prototype.toString.call(e))?e:new Error(e),t&&"Error"!==t&&(s.code=t),i&&(s.response=i,s.message+=": "+i);const r="string"==typeof i&&Number((i.match(/^\d+/)||[])[0])||!1;return r&&(s.responseCode=r),n&&(s.command=n),s}_onClose(){let e=!1;this._remainder&&this._remainder.trim()&&(this.lastServerResponse=e=I(this._remainder.trim()),(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e)),this.logger.info({tnx:"network"},"Connection closed");const t=!("string"!=typeof e||!/^[45]\d{2}[ -]/.test(e))&&e;if(this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",t,"CONN");if(!t&&this._responseActions[0]===this._actionGreeting&&this._connectCallback&&!this._destroyed){const e=this._connectCallback;this._connectCallback=!1;const t=this._formatError(new Error("Connection closed unexpectedly"),"ECONNECTION",!1,"CONN");return this.logger.warn({tnx:"network"},t.message),e(t),void this.close()}if(t||this._responseActions[0]!==this.close&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.end()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.destroyed=!0,clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._connectionTimeout=!1,this._greetingTimeout=!1,this.emit("end"))}_upgradeConnection(e){this._remainder="",this._responseQueue=[],this._responsePartial=!1;const t=this._socket;t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout);const i=Object.assign({socket:t,host:this.host},this.options.tls||{});this.servername&&!i.servername&&(i.servername=this.servername);const n=()=>{t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError)};this.upgrading=!0;try{this._socket=d.default.connect(i,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),n(),e(null,!0)))}catch(t){return n(),e(t)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||D),this._socket.on("timeout",this._onSocketTimeout),t.resume()}_processResponse(){if(!this._responseQueue.length)return!1;const e=(this._responseQueue.shift()||"").toString();if(!e.trim())return void setImmediate(()=>this._processResponse());if(function(e){return b(e.slice(e.lastIndexOf("\n")+1))}(e))return void this._responseQueue.unshift(e);const t=this.lastServerResponse=I(e);(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},t.replace(/\r?\n$/,""));const i=this._responseActions.shift();if("function"!=typeof i)return this._onError(new Error("Unexpected Response"),"EPROTOCOL",t,"CONN");i.call(this,t),setImmediate(()=>this._processResponse())}_sendCommand(e,t){if(this._destroyed)return;const i=this._socket;if(i.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,"")),i.write(Buffer.from(e+"\r\n","utf-8"))}_setEnvelope(e,t){const i=[];let n=!1;if(this._envelope=e||{},this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim(),this._envelope.to=[].concat(this._envelope.to||[]).map(e=>(e&&e.address||e||"").toString().trim()),!this._envelope.to.length)return t(this._formatError("No recipients defined","EENVELOPE",!1,"API"));if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from))return t(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.from)&&(n=!0);for(let e=0,i=this._envelope.to.length;e<i;e++){if(!this._envelope.to[e]||/[\r\n<>]/.test(this._envelope.to[e]))return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[e]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[e])&&(n=!0)}if(this._envelope.rcptQueue=[].concat(this._envelope.to||[]),this._envelope.rejected=[],this._envelope.rejectedErrors=[],this._envelope.accepted=[],this._envelope.dsn)try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(e){return t(this._formatError("Invalid DSN "+e.message,"EENVELOPE",!1,"API"))}if(this._envelope.requireTLSExtensionEnabled){if(!this.secure)return t(this._formatError("REQUIRETLS can only be used over TLS connections (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"));if(!this._supportedExtensions.includes("REQUIRETLS"))return t(this._formatError("Server does not support REQUIRETLS extension (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"))}if(this._responseActions.push(e=>{this._actionMAIL(e,t)}),n&&this._supportedExtensions.includes("SMTPUTF8")&&(i.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(i.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")){const e=Number(this._envelope.size)||0;e>0&&i.push("SIZE="+e)}this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&i.push("RET="+M.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&i.push("ENVID="+M.encodeXText(this._envelope.dsn.envid))),this._envelope.requireTLSExtensionEnabled&&i.push("REQUIRETLS"),this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(e){let t=(e.ret||e.return||"").toString().toUpperCase()||null;if(t)switch(t){case"HDRS":case"HEADERS":t="HDRS";break;case"FULL":case"BODY":t="FULL"}if(t&&!["FULL","HDRS"].includes(t))throw new Error("ret: "+JSON.stringify(t));const i=(e.envid||e.id||"").toString()||null;let n=e.notify||null;if(n){"string"==typeof n&&(n=n.split(",")),n=n.map(e=>e.trim().toUpperCase());const e=["NEVER","SUCCESS","FAILURE","DELAY"];if(n.filter(t=>!e.includes(t)).length||n.length>1&&n.includes("NEVER"))throw new Error("notify: "+JSON.stringify(n.join(",")));n=n.join(",")}let s=(e.recipient||e.orcpt||"").toString()||null;return s&&s.indexOf(";")<0&&(s="rfc822;"+s),{ret:t,envid:i,notify:n,orcpt:s}}_getDsnRcptToArgs(){const e=this._envelope,t=[];return e.dsn&&this._supportedExtensions.includes("DSN")&&(e.dsn.notify&&t.push("NOTIFY="+M.encodeXText(e.dsn.notify)),e.dsn.orcpt&&t.push("ORCPT="+M.encodeXText(e.dsn.orcpt))),t.length?" "+t.join(" "):""}_createSendStream(e){const t=this._envelope,i=new f.default;if(this.options.lmtp?t.accepted.forEach((i,n)=>{const s=n===t.accepted.length-1;this._responseActions.push(t=>{this._actionLMTPStream(i,s,t,e)})}):this._responseActions.push(t=>{this._actionSMTPStream(t,e)}),this._currentDataStream=i,i.pipe(this._socket,{end:!1}),this.options.debug){const e=new g.PassThrough;e.on("readable",()=>{let t;for(;t=e.read();)this.logger.debug({tnx:"message"},t.toString("binary").replace(/\r?\n$/,""))}),i.pipe(e)}return i.once("end",()=>{this._currentDataStream===i&&(this._currentDataStream=!1),this.logger.info({tnx:"message",inByteCount:i.inByteCount,outByteCount:i.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",i.outByteCount,i.inByteCount)}),i}_actionGreeting(e){clearTimeout(this._greetingTimeout),"220"===e.substr(0,3)?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN")}_actionLHLO(e){"2"===e.charAt(0)?this._actionEHLO(e):this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO")}_actionEHLO(e){let t;if("421"===e.substr(0,3))return void this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");if("2"!==e.charAt(0))return this.options.requireTLS?void this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO"):(this._responseActions.push(this._actionHELO),void this._sendCommand("HELO "+this.name));if(this._ehloLines=e.split(/\r?\n/).map(e=>e.replace(/^\d+[ -]/,"").trim()).filter(e=>e).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS))return this._sendCommand("STARTTLS"),void this._responseActions.push(this._actionSTARTTLS);/[ -]SMTPUTF8\b/im.test(e)&&this._supportedExtensions.push("SMTPUTF8"),/[ -]DSN\b/im.test(e)&&this._supportedExtensions.push("DSN"),/[ -]8BITMIME\b/im.test(e)&&this._supportedExtensions.push("8BITMIME"),/[ -]REQUIRETLS\b/im.test(e)&&this._supportedExtensions.push("REQUIRETLS"),/[ -]PIPELINING\b/im.test(e)&&this._supportedExtensions.push("PIPELINING"),/[ -]AUTH\b/i.test(e)&&(this.allowsAuth=!0);const i=new Set;for(const e of this._ehloLines){const t=/^AUTH[\s=](.*)/i.exec(e);if(t)for(const e of t[1].split(/[\s=]+/))i.add(e.toUpperCase())}for(const e of["PLAIN","LOGIN","CRAM-MD5","XOAUTH2"])i.has(e)&&this._supportedAuth.push(e);(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(t[1])||0),this.emit("connect")}_actionHELO(e){"2"===e.charAt(0)?(this.allowsAuth=!0,this.emit("connect")):this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO")}_actionSTARTTLS(e){if("2"!==e.charAt(0))return this.options.opportunisticTLS?(this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),void this.emit("connect")):void this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");this._upgradeConnection((e,t)=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"STARTTLS"):(this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),t?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this.emit("connect"))})}_actionAUTH_LOGIN_USER(e,t){/^334[ -]/.test(e)?(this._responseActions.push(e=>{this._actionAUTH_LOGIN_PASS(e,t)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))):t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"))}_actionAUTH_CRAM_MD5(e,t){const i=e.match(/^334\s+(.+)$/);if(!i)return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"));const n=Buffer.from(i[1],"base64").toString("ascii"),s=h.default.createHmac("md5",this._auth.credentials.pass);s.update(n);const r=this._auth.credentials.user+" "+s.digest("hex");this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5_PASS(e,t)}),this._sendCommand(Buffer.from(r).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(e,t){if(!e.match(/^235\s+/))return t(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",e,"AUTH CRAM-MD5"));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0)}_actionAUTH_LOGIN_PASS(e,t){if(!/^334[ -]/.test(e))return t(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",e,"AUTH LOGIN"));this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,i){return i||"function"!=typeof t||(i=t,t=!1),"334"===e.substr(0,3)?(this._responseActions.push(e=>{t||"XOAUTH2"!==this._authMethod?this._actionAUTHComplete(e,!0,i):setImmediate(()=>this._handleXOauth2Token(!0,i))}),void this._sendCommand("")):"2"!==e.charAt(0)?(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),i(this._formatError("Invalid login","EAUTH",e,"AUTH "+this._authMethod))):(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,void i(null,!0))}_actionMAIL(e,t){const i=this._envelope;if(2!==Number(e.charAt(0))){const n=this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(i.from)?"Internationalized mailbox name not allowed":"Mail command failed";return t(this._formatError(n,"EENVELOPE",e,"MAIL FROM"))}if(!i.rcptQueue.length)return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"));this._recipientQueue=[];const n=this._supportedExtensions.includes("PIPELINING");do{const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}while(n&&i.rcptQueue.length)}_actionRCPT(e,t){const i=this._envelope;let n;const s=this._recipientQueue.shift();if(2!==Number(e.charAt(0))){const t=this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(s)?"Internationalized mailbox name not allowed":"Recipient command failed";i.rejected.push(s),n=this._formatError(t,"EENVELOPE",e,"RCPT TO"),n.recipient=s,i.rejectedErrors.push(n)}else i.accepted.push(s);if(i.rcptQueue.length||this._recipientQueue.length){if(i.rcptQueue.length){const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}}else{if(!(i.rejected.length<i.to.length)){const s=i.rejectedErrors.find(e=>e.responseCode&&e.responseCode<500),r=s?.response??e;return n=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",r,"RCPT TO"),n.rejected=i.rejected,n.rejectedErrors=i.rejectedErrors,t(n)}this._responseActions.push(e=>{this._actionDATA(e,t)}),this._sendCommand("DATA")}}_actionDATA(e,t){const i=this._envelope;if(!/^[23]/.test(e))return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"));const n={accepted:i.accepted,rejected:i.rejected};this._ehloLines&&this._ehloLines.length&&(n.ehlo=this._ehloLines),i.rejectedErrors.length&&(n.rejectedErrors=i.rejectedErrors),t(null,n)}_actionSMTPStream(e,t){return 2!==Number(e.charAt(0))?t(this._formatError("Message failed","EMESSAGE",e,"DATA")):t(null,e)}_actionLMTPStream(e,t,i,n){const s=this._envelope;let r;if(2!==Number(i.charAt(0))){r=this._formatError("Message failed for recipient "+e,"EMESSAGE",i,"DATA"),r.recipient=e,s.rejected.push(e),s.rejectedErrors.push(r);for(let t=0,i=s.accepted.length;t<i;t++)s.accepted[t]===e&&s.accepted.splice(t,1)}if(t)return n(null,i)}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,(i,n)=>{if(i)return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),t(this._formatError(i,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(i=>{this._actionAUTHComplete(i,e,t)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(n),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))})}_isDestroyedMessage(e){if(this._destroyed)return"Cannot "+e+" - smtp connection is already destroyed.";if(this._socket){if(this._socket.destroyed)return"Cannot "+e+" - smtp connection socket is already destroyed.";if(!this._socket.writable)return"Cannot "+e+" - smtp connection socket is already half-closed."}}_getHostname(){let e;try{e=m.default.hostname()||""}catch(t){e="localhost"}return(!e||e.indexOf(".")<0)&&(e="[127.0.0.1]"),e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(e="["+e+"]"),e}}t.default=C,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(su,su.exports)),su.exports}var au,cu,lu={exports:{}};function uu(){return au||(au=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=w,c=o(cl()),l=o(x),u=r(ll()),p=r(il());class d extends a.Stream{constructor(e,t){if(super(),this.options=e||{},this.configError=!1,e&&e.serviceClient){if(!e.privateKey||!e.user){const e=new Error('Options "privateKey" and "user" are required for service account!');e.code=p.EOAUTH2,this.configError=e}const t=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=t||300}if(this.logger=u.getLogger({logger:t},{component:this.options.component||"OAuth2"}),this.provisionCallback="function"==typeof this.options.provisionCallback&&this.options.provisionCallback,this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token",this.options.customHeaders=this.options.customHeaders||{},this.options.customParams=this.options.customParams||{},this.accessToken=this.options.accessToken||!1,this.options.expires&&Number(this.options.expires))this.expires=this.options.expires;else{const e=Math.max(Number(this.options.timeout)||0,0);this.expires=e&&Date.now()+1e3*e||0}this.renewing=!1,this.renewalQueue=[]}getToken(e,t){const i=t;if(this.configError)return i(this.configError);if(!e&&this.accessToken&&(!this.expires||this.expires>Date.now()))return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token for %s",this.options.user),t(null,this.accessToken);if(!this.provisionCallback&&!this.options.refreshToken&&!this.options.serviceClient){if(this.accessToken)return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token (no refresh capability) for %s",this.options.user),t(null,this.accessToken);this.logger.error({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Cannot renew access token for %s: No refresh mechanism available",this.options.user);const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,i(e)}if(this.renewing)return void this.renewalQueue.push({renew:e,callback:i});this.renewing=!0;const n=(e,t)=>{this.renewalQueue.forEach(i=>i.callback(e,t)),this.renewalQueue=[],this.renewing=!1,e?this.logger.error({err:e,tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user):this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user),i(e,t)};this.provisionCallback?this.provisionCallback(this.options.user,!!e,(e,t,i)=>{!e&&t&&(this.accessToken=t,this.expires=i||0),n(e,t)}):this.generateToken(n)}updateToken(e,t){this.accessToken=e,t=Math.max(Number(t)||0,0),this.expires=t&&Date.now()+1e3*t||0,this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){const t=e;let i,n;if(this.options.serviceClient){const e=Math.floor(Date.now()/1e3),s={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:e,exp:e+this.options.serviceRequestTimeout};let r;try{r=this.jwtSignRS256(s)}catch(e){const i=new Error("Can't generate token. Check your auth options");return i.code=p.EOAUTH2,t(i)}i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r},n={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:s}}else{if(!this.options.refreshToken){const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,t(e)}i={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"},n={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.assign(i,this.options.customParams),Object.assign(n,this.options.customParams),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(n)),this.postRequest(this.options.accessUrl,i,this.options,(i,n)=>{let s;if(i)return t(i);try{s=JSON.parse(n.toString())}catch(e){return t(e)}if(!s||"object"!=typeof s){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(n||"").toString());const e=new Error("Invalid authentication response");return e.code=p.EOAUTH2,t(e)}const r=Object.assign({},s);if(r.access_token&&(r.access_token=(r.access_token||"").toString().substr(0,6)+"..."),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(r)),s.error){let e=s.error;s.error_description&&(e+=": "+s.error_description),s.error_uri&&(e+=" ("+s.error_uri+")");const i=new Error(e);return i.code=p.EOAUTH2,t(i)}if(s.access_token)return this.updateToken(s.access_token,s.expires_in),e(null,this.accessToken);const o=new Error("No access token");return o.code=p.EOAUTH2,t(o)})}buildXOAuth2Token(e){const t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,i,n){let s=!1;const r=[];let o=0;const a={method:"post",headers:i.customHeaders,body:t,allowErrorResponse:!0,timeout:i.requestTimeout};/^https:/i.test(e)&&(a.tls=Object.assign({rejectUnauthorized:!0},i.tls||{}));const l=(0,c.default)(e,a);l.on("readable",()=>{let e;for(;null!==(e=l.read());)r.push(e),o+=e.length}),l.once("error",e=>{if(!s)return s=!0,n(e)}),l.once("end",()=>{if(!s)return s=!0,n(null,Buffer.concat(r,o))})}toBase64URL(e){return"string"==typeof e&&(e=Buffer.from(e)),e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){const t=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map(e=>this.toBase64URL(e)).join("."),i=l.default.createSign("RSA-SHA256").update(t).sign(this.options.privateKey);return t+"."+this.toBase64URL(i)}}t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(lu,lu.exports)),lu.exports}var pu,du,mu,hu={exports:{}},fu={};function gu(){return du||(du=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e=s(e.split("@").pop()),n[e]||!1};const i=(pu||(pu=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.services=void 0,fu.services={126:{description:"126 Mail (NetEase)",host:"smtp.126.com",port:465,secure:!0},163:{description:"163 Mail (NetEase)",host:"smtp.163.com",port:465,secure:!0},"1und1":{description:"1&1 Mail (German hosting provider)",host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},Aliyun:{description:"Alibaba Cloud Mail",domains:["aliyun.com"],host:"smtp.aliyun.com",port:465,secure:!0},AliyunQiye:{description:"Alibaba Cloud Enterprise Mail",host:"smtp.qiye.aliyun.com",port:465,secure:!0},AOL:{description:"AOL Mail",domains:["aol.com"],host:"smtp.aol.com",port:587},Aruba:{description:"Aruba PEC (Italian email provider)",domains:["aruba.it","pec.aruba.it"],aliases:["Aruba PEC"],host:"smtps.aruba.it",port:465,secure:!0,authMethod:"LOGIN"},Bluewin:{description:"Bluewin (Swiss email provider)",host:"smtpauths.bluewin.ch",domains:["bluewin.ch"],port:465},BOL:{description:"BOL Mail (Brazilian provider)",domains:["bol.com.br"],host:"smtp.bol.com.br",port:587,requireTLS:!0},DebugMail:{description:"DebugMail (email testing service)",host:"debugmail.io",port:25},Disroot:{description:"Disroot (privacy-focused provider)",domains:["disroot.org"],host:"disroot.org",port:587,secure:!1,authMethod:"LOGIN"},DynectEmail:{description:"Dyn Email Delivery",aliases:["Dynect"],host:"smtp.dynect.net",port:25},ElasticEmail:{description:"Elastic Email",aliases:["Elastic Email"],host:"smtp.elasticemail.com",port:465,secure:!0},Ethereal:{description:"Ethereal Email (email testing service)",aliases:["ethereal.email"],host:"smtp.ethereal.email",port:587},FastMail:{description:"FastMail",domains:["fastmail.com","fastmail.fm"],host:"smtp.fastmail.com",port:465,secure:!0},"Feishu Mail":{description:"Feishu Mail (Lark)",aliases:["Feishu","FeishuMail"],domains:["www.feishu.cn"],host:"smtp.feishu.cn",port:465,secure:!0},"Forward Email":{description:"Forward Email (email forwarding service)",aliases:["FE","ForwardEmail"],domains:["forwardemail.net"],host:"smtp.forwardemail.net",port:465,secure:!0},GandiMail:{description:"Gandi Mail",aliases:["Gandi","Gandi Mail"],host:"mail.gandi.net",port:587},Gmail:{description:"Gmail",aliases:["Google Mail"],domains:["gmail.com","googlemail.com"],host:"smtp.gmail.com",port:465,secure:!0},GmailWorkspace:{description:"Gmail Workspace",aliases:["Google Workspace Mail"],host:"smtp-relay.gmail.com",port:465,secure:!0},GMX:{description:"GMX Mail",domains:["gmx.com","gmx.net","gmx.de"],host:"mail.gmx.com",port:587},Godaddy:{description:"GoDaddy Email (US)",host:"smtpout.secureserver.net",port:25},GodaddyAsia:{description:"GoDaddy Email (Asia)",host:"smtp.asia.secureserver.net",port:25},GodaddyEurope:{description:"GoDaddy Email (Europe)",host:"smtp.europe.secureserver.net",port:25},"hot.ee":{description:"Hot.ee (Estonian email provider)",host:"mail.hot.ee"},Hotmail:{description:"Outlook.com / Hotmail",aliases:["Outlook","Outlook.com","Hotmail.com"],domains:["hotmail.com","outlook.com"],host:"smtp-mail.outlook.com",port:587},iCloud:{description:"iCloud Mail",aliases:["Me","Mac"],domains:["icloud.com","me.com","mac.com"],host:"smtp.mail.me.com",port:587},Infomaniak:{description:"Infomaniak Mail (Swiss hosting provider)",host:"mail.infomaniak.com",domains:["ik.me","ikmail.com","etik.com"],port:587},KolabNow:{description:"KolabNow (secure email service)",domains:["kolabnow.com"],aliases:["Kolab"],host:"smtp.kolabnow.com",port:465,secure:!0,authMethod:"LOGIN"},Loopia:{description:"Loopia (Swedish hosting provider)",host:"mailcluster.loopia.se",port:465},Loops:{description:"Loops",host:"smtp.loops.so",port:587},"mail.ee":{description:"Mail.ee (Estonian email provider)",host:"smtp.mail.ee"},"Mail.ru":{description:"Mail.ru",host:"smtp.mail.ru",port:465,secure:!0},"Mailcatch.app":{description:"Mailcatch (email testing service)",host:"sandbox-smtp.mailcatch.app",port:2525},Maildev:{description:"MailDev (local email testing)",port:1025,ignoreTLS:!0},MailerSend:{description:"MailerSend",host:"smtp.mailersend.net",port:587},Mailgun:{description:"Mailgun",host:"smtp.mailgun.org",port:465,secure:!0},Mailjet:{description:"Mailjet",host:"in.mailjet.com",port:587},Mailosaur:{description:"Mailosaur (email testing service)",host:"mailosaur.io",port:25},Mailtrap:{description:"Mailtrap",host:"live.smtp.mailtrap.io",port:587},Mandrill:{description:"Mandrill (by Mailchimp)",host:"smtp.mandrillapp.com",port:587},Naver:{description:"Naver Mail (Korean email provider)",host:"smtp.naver.com",port:587},OhMySMTP:{description:"OhMySMTP (email delivery service)",host:"smtp.ohmysmtp.com",port:587,secure:!1},One:{description:"One.com Email",host:"send.one.com",port:465,secure:!0},OpenMailBox:{description:"OpenMailBox",aliases:["OMB","openmailbox.org"],host:"smtp.openmailbox.org",port:465,secure:!0},Outlook365:{description:"Microsoft 365 / Office 365",host:"smtp.office365.com",port:587,secure:!1},Postmark:{description:"Postmark",aliases:["PostmarkApp"],host:"smtp.postmarkapp.com",port:2525},Proton:{description:"Proton Mail",aliases:["ProtonMail","Proton.me","Protonmail.com","Protonmail.ch"],domains:["proton.me","protonmail.com","pm.me","protonmail.ch"],host:"smtp.protonmail.ch",port:587,requireTLS:!0},"qiye.aliyun":{description:"Alibaba Mail Enterprise Edition",host:"smtp.mxhichina.com",port:"465",secure:!0},QQ:{description:"QQ Mail",domains:["qq.com"],host:"smtp.qq.com",port:465,secure:!0},QQex:{description:"QQ Enterprise Mail",aliases:["QQ Enterprise"],domains:["exmail.qq.com"],host:"smtp.exmail.qq.com",port:465,secure:!0},Resend:{description:"Resend",host:"smtp.resend.com",port:465,secure:!0},Runbox:{description:"Runbox (Norwegian email provider)",domains:["runbox.com"],host:"smtp.runbox.com",port:465,secure:!0},SendCloud:{description:"SendCloud (Chinese email delivery)",host:"smtp.sendcloud.net",port:2525},SendGrid:{description:"SendGrid",host:"smtp.sendgrid.net",port:587},SendinBlue:{description:"Brevo (formerly Sendinblue)",aliases:["Brevo"],host:"smtp-relay.brevo.com",port:587},SendPulse:{description:"SendPulse",host:"smtp-pulse.com",port:465,secure:!0},SES:{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-1":{description:"AWS SES Asia Pacific (Tokyo)",host:"email-smtp.ap-northeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-2":{description:"AWS SES Asia Pacific (Seoul)",host:"email-smtp.ap-northeast-2.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-3":{description:"AWS SES Asia Pacific (Osaka)",host:"email-smtp.ap-northeast-3.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTH-1":{description:"AWS SES Asia Pacific (Mumbai)",host:"email-smtp.ap-south-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-1":{description:"AWS SES Asia Pacific (Singapore)",host:"email-smtp.ap-southeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-2":{description:"AWS SES Asia Pacific (Sydney)",host:"email-smtp.ap-southeast-2.amazonaws.com",port:465,secure:!0},"SES-CA-CENTRAL-1":{description:"AWS SES Canada (Central)",host:"email-smtp.ca-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-CENTRAL-1":{description:"AWS SES Europe (Frankfurt)",host:"email-smtp.eu-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-NORTH-1":{description:"AWS SES Europe (Stockholm)",host:"email-smtp.eu-north-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-1":{description:"AWS SES Europe (Ireland)",host:"email-smtp.eu-west-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-2":{description:"AWS SES Europe (London)",host:"email-smtp.eu-west-2.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-3":{description:"AWS SES Europe (Paris)",host:"email-smtp.eu-west-3.amazonaws.com",port:465,secure:!0},"SES-SA-EAST-1":{description:"AWS SES South America (São Paulo)",host:"email-smtp.sa-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-1":{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-2":{description:"AWS SES US East (Ohio)",host:"email-smtp.us-east-2.amazonaws.com",port:465,secure:!0},"SES-US-GOV-EAST-1":{description:"AWS SES GovCloud (US-East)",host:"email-smtp.us-gov-east-1.amazonaws.com",port:465,secure:!0},"SES-US-GOV-WEST-1":{description:"AWS SES GovCloud (US-West)",host:"email-smtp.us-gov-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-1":{description:"AWS SES US West (N. California)",host:"email-smtp.us-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-2":{description:"AWS SES US West (Oregon)",host:"email-smtp.us-west-2.amazonaws.com",port:465,secure:!0},Seznam:{description:"Seznam Email (Czech email provider)",aliases:["Seznam Email"],domains:["seznam.cz","email.cz","post.cz","spoluzaci.cz"],host:"smtp.seznam.cz",port:465,secure:!0},SMTP2GO:{description:"SMTP2GO",host:"mail.smtp2go.com",port:2525},Sparkpost:{description:"SparkPost",aliases:["SparkPost","SparkPost Mail"],domains:["sparkpost.com"],host:"smtp.sparkpostmail.com",port:587,secure:!1},Tipimail:{description:"Tipimail (email delivery service)",host:"smtp.tipimail.com",port:587},TurboSMTP:{description:"TurboSMTP",host:"pro.turbo-smtp.com",port:465,secure:!0},"TurboSMTP-EU":{description:"TurboSMTP (EU region)",host:"pro.eu.turbo-smtp.com",port:465,secure:!0},Tutanota:{description:"Tutanota (Tuta Mail)",domains:["tutanota.com","tuta.com","tutanota.de","tuta.io"],host:"smtp.tutanota.com",port:465,secure:!0},Yahoo:{description:"Yahoo Mail",domains:["yahoo.com"],host:"smtp.mail.yahoo.com",port:465,secure:!0},Yandex:{description:"Yandex Mail",domains:["yandex.ru"],host:"smtp.yandex.ru",port:465,secure:!0},Zimbra:{description:"Zimbra Mail Server",aliases:["Zimbra Collaboration"],host:"smtp.zimbra.com",port:587,requireTLS:!0},Zoho:{description:"Zoho Mail",host:"smtp.zoho.com",port:465,secure:!0,authMethod:"LOGIN"}}),fu),n={};function s(e){return e.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}Object.keys(i.services).forEach(e=>{const t=i.services[e],r=function(e){const t={};return Object.keys(e).forEach(i=>{["domains","aliases"].includes(i)||(t[i]=e[i])}),t}(t);n[s(e)]=r,[].concat(t.aliases||[]).forEach(e=>{n[s(e)]=r}),[].concat(t.domains||[]).forEach(e=>{n[s(e)]=r})}),e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(hu,hu.exports)),hu.exports}function wu(){return mu||(mu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=o((cu||(cu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(ou()),c=ll(),u=o(uu()),p=r(il()),d=l;class m extends d.EventEmitter{constructor(e){if(super(),this.pool=e,this.options=e.options,this.logger=this.pool.logger,this.options.auth)switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{const e=new u.default(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"},e.on("token",e=>this.pool.mailer.emit("token",e)),e.on("error",e=>this._fail(e));break}default:if(!this.options.auth.user&&!this.options.auth.pass)break;this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||!1}}this._connection=!1,this._connected=!1,this.messages=0,this.available=!0,this._failed=!1}_fail(e){this._failed||(this._failed=!0,this.emit("error",e))}connect(e){this.pool.getSocket(this.options,(t,i)=>{if(t)return this._fail(t),e(t);let n=!1,s=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,s.host||"",s.port||""),s=Object.assign((0,c.assign)(!1,s),i)),this.connection=new a.default(s),this.connection.on("error",t=>{if(this._fail(t),!n)return n=!0,e(t)}),this.connection.once("end",()=>{this.close(),n=!0}),this.connection.connect(t=>{if(!n){if(!t)return this.auth&&(this.connection.allowsAuth||s.forceAuth)?void this.connection.login(this.auth,t=>{if(!n){if(n=!0,t)return this.connection.close(),this._fail(t),e(t);this._connected=!0,e(null,!0)}}):(n=!0,this._connected=!0,e(null,!0));n=!0}})})}send(e,t){if(!this._connected)return this.connect(i=>i?t(i):this.send(e,t));const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n,cid:this.id},"Sending message %s using #%s to <%s>",n,this.id,s.join(", ")),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.connection.send(i,e.message.createReadStream(),(e,s)=>{if(this.messages++,e)return this.connection.close(),this._fail(e),t(e);s.envelope={from:i.from,to:i.to},s.messageId=n,setImmediate(()=>{if(this.messages>=this.options.maxMessages){const e=new Error("Resource exhausted");e.code=p.EMAXLIMIT,this.connection.close(),this._fail(e)}else this.pool._checkRateLimit(()=>{this.available=!0,this.emit("available")})}),t(null,s)})}close(){this._connected=!1,this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.connection&&this.connection.close(),this.emit("close")}}t.default=m,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(nu,nu.exports)),nu.exports)),u=o(ou()),p=o(gu()),d=r(ll()),m=r(il()),h=r($c());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=d.parseConnectionUrl(e.url),i=i||t.service),this.options=d.assign(!1,e,t,i&&(0,p.default)(i)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.options.maxRequeues="number"==typeof this.options.maxRequeues?this.options.maxRequeues:5,this.logger=d.getLogger(this.options,{component:this.options.component||"smtp-pool"}),this.name="SMTP (pool)",this.version=h.version+"[client:"+h.version+"]",this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:!1,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0},this._closed=!1,this._queue=[],this._connections=[],this._connectionCounter=0,this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}getSocket(e,t){setImmediate(()=>t(null,!1))}send(e,t){if(this._closed){const e=new Error("Connection pool was closed");return e.code=m.ECONNECTION,setImmediate(()=>t(e)),!1}return this._queue.push({mail:e,requeueAttempts:0,callback:t}),this.idling&&this._queue.length>=this.options.maxConnections&&(this.idling=!1),setImmediate(()=>this._processMessages()),!0}close(){let e;const t=this._connections.length;if(this._closed=!0,this._clearRateLimit(),!t&&!this._queue.length)return;for(let i=t-1;i>=0;i--)this._connections[i]&&this._connections[i].available&&(e=this._connections[i],e.close(),this.logger.info({tnx:"connection",cid:e.id,action:"removed"},"Connection #%s removed",e.id));if(t&&!this._connections.length&&this.logger.debug({tnx:"connection"},"All connections removed"),!this._queue.length)return;const i=()=>{if(!this._queue.length)return void this.logger.debug({tnx:"connection"},"Pending queue entries cleared");const e=this._queue.shift();if(e&&"function"==typeof e.callback)try{e.callback(new Error("Connection pool was closed"))}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error: %s",e.message)}setImmediate(i)};setImmediate(i)}_processMessages(){if(this._closed)return;if(!this._queue.length)return void(this.idling||(this.idling=!0,this.emit("idle")));let e=this._connections.find(e=>e.available);if(!e&&this._connections.length<this.options.maxConnections&&(e=this._createConnection()),!e)return void(this.idling=!1);!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));const t=e.queueEntry=this._queue.shift();t.messageId=(e.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,""),e.available=!1,this.logger.debug({tnx:"pool",cid:e.id,messageId:t.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",t.messageId,e.id,e.messages+1),this._rateLimit.limit&&(this._rateLimit.counter++,this._rateLimit.checkpoint||(this._rateLimit.checkpoint=Date.now())),e.send(t.mail,(i,n)=>{if(t===e.queueEntry){try{t.callback(i,n)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}})}_createConnection(){const e=new c.default(this);return e.id=++this._connectionCounter,this.logger.info({tnx:"pool",cid:e.id,action:"conection"},"Created new pool resource #%s",e.id),e.on("available",()=>{this.logger.debug({tnx:"connection",cid:e.id,action:"available"},"Connection #%s became available",e.id),this._closed?this.close():this._processMessages()}),e.once("error",t=>{if(t.code!==m.EMAXLIMIT?this.logger.warn({err:t,tnx:"pool",cid:e.id},"Pool Error for #%s: %s",e.id,t.message):this.logger.debug({tnx:"pool",cid:e.id,action:"maxlimit"},"Max messages limit exchausted for #%s",e.id),e.queueEntry){try{e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}this._removeConnection(e),this._continueProcessing()}),e.once("close",()=>{this.logger.info({tnx:"connection",cid:e.id,action:"closed"},"Connection #%s was closed",e.id),this._removeConnection(e),e.queueEntry?setTimeout(()=>{let t=0;e.queueEntry&&(this._shouldRequeuOnConnectionClose(e.queueEntry)?t=this._requeueEntryOnConnectionClose(e):this._failDeliveryOnConnectionClose(e)),t?setTimeout(()=>this._continueProcessing(),t):this._continueProcessing()},50):(this._closed||!this.idling||this._connections.length||this.emit("clear"),this._continueProcessing())}),this._connections.push(e),e}_shouldRequeuOnConnectionClose(e){return this.options.maxRequeues<0||e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{const t=new Error("Reached maximum number of retries after connection was closed");t.code=m.ECONNECTION,e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",messageId:e.queueEntry.messageId,cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}}_requeueEntryOnConnectionClose(e){const t=Math.min(50*2**e.queueEntry.requeueAttempts,2e3);return e.queueEntry.requeueAttempts+=1,this.logger.debug({tnx:"pool",cid:e.id,messageId:e.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",e.queueEntry.messageId,e.id,e.queueEntry.requeueAttempts),this._queue.unshift(e.queueEntry),e.queueEntry=!1,t}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(e){const t=this._connections.indexOf(e);-1!==t&&this._connections.splice(t,1)}_checkRateLimit(e){if(!this._rateLimit.limit)return e();const t=Date.now();return this._rateLimit.counter<this._rateLimit.limit?e():(this._rateLimit.waiting.push(e),this._rateLimit.checkpoint<=t-this._rateLimit.delta?this._clearRateLimit():void(this._rateLimit.timeout||(this._rateLimit.timeout=setTimeout(()=>this._clearRateLimit(),this._rateLimit.delta-(t-this._rateLimit.checkpoint)),this._rateLimit.checkpoint=t)))}_clearRateLimit(){for(clearTimeout(this._rateLimit.timeout),this._rateLimit.timeout=null,this._rateLimit.counter=0,this._rateLimit.checkpoint=!1;this._rateLimit.waiting.length;){const e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=new c.default(this).auth;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let s=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,s.host||"",s.port||""),s=Object.assign(d.assign(!1,s),t));const r=new u.default(s);let o=!1;r.once("error",e=>{if(!o)return o=!0,r.close(),i(e)}),r.once("end",()=>{if(!o)return o=!0,i(new Error("Connection closed"))});const a=()=>{if(!o)return o=!0,r.quit(),i(null,!0)};r.connect(e=>{if(!o){if(e)return o=!0,r.close(),i(e);if(n&&(r.allowsAuth||s.forceAuth))r.login(n,e=>{if(!o)return e?(o=!0,r.close(),i(e)):void a()});else{if(!n&&r.allowsAuth&&s.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,r.close(),i(e)}a()}}})}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(iu,iu.exports)),iu.exports}var Mu,yu={exports:{}};var Du,xu={exports:{}};var Lu,vu={exports:{}};var Iu,bu={exports:{}};var Cu,Eu,Tu={exports:{}};function Au(){return Cu||(Cu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(l),c=r($c()),u=r(ll()),p=r(il()),d=o(Nl()),m=o(Xl());function h(e){return e&&"object"==typeof e&&!e.code&&(e.code=p.ESES),e}class f extends a.default{constructor(e){if(super(),!e||!e.SES||!e.SES.sesClient){const e=new Error("Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=p.ECONFIG,e}this.options=e,this.ses=this.options.SES,this.name="SESTransport",this.version=c.version,this.logger=u.getLogger(this.options,{component:this.options.component||"ses-transport"})}getRegion(e){if(!this.ses.sesClient.config||"function"!=typeof this.ses.sesClient.config.region)return e(null,!1);this.ses.sesClient.config.region().then(t=>e(null,t),t=>e(t))}send(e,t){let i=e.message._headers.find(e=>/^from$/i.test(e.key));if(i){const e=new m.default("text/plain");i=e._convertAddresses(e._parseAddresses(i.value))}const n=e.message.getEnvelope(),s=e.message.messageId(),r=[].concat(n.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s},"Sending message %s to <%s>",s,r.join(", "));setImmediate(()=>(t=>{e.data._dkim||(e.data._dkim={}),e.data._dkim.skipFields&&"string"==typeof e.data._dkim.skipFields?e.data._dkim.skipFields+=":date:message-id":e.data._dkim.skipFields="date:message-id";const i=e.message.createReadStream(),n=i.pipe(new d.default),s=[];let r=0;n.on("readable",()=>{let e;for(;null!==(e=n.read());)s.push(e),r+=e.length}),i.once("error",e=>n.emit("error",e)),n.once("error",e=>t(e)),n.once("end",()=>t(null,Buffer.concat(s,r)))})((r,o)=>{if(r)return this.logger.error({err:r,tnx:"send",messageId:s},"Failed creating message for %s. %s",s,r.message),t(r);const a=u.copyOwnKeys({Content:{Raw:{Data:o}},FromEmailAddress:i||n.from,Destination:{ToAddresses:n.to}},e.data.ses);this.getRegion((e,i)=>{let r;!e&&i||(i="us-east-1");try{const e=new this.ses.SendEmailCommand(a);r=this.ses.sesClient.send(e)}catch(e){return h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",s,e.message),void setImmediate(()=>t(e))}r.then(e=>{"us-east-1"===i&&(i="email");const s={envelope:{from:n.from,to:n.to},messageId:"<"+e.MessageId+(/@/.test(e.MessageId)?"":"@"+i+".amazonses.com")+">",response:e.MessageId,raw:o};setImmediate(()=>t(null,s))}).catch(e=>{h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",s,e.message),setImmediate(()=>t(e))})})}))}verify(e){let t;e||(t=new Promise((t,i)=>{e=u.callbackPromise(t,i)}));const i=e,n=e=>e&&!["InvalidParameterValue","MessageRejected"].includes(e.code||e.Code||e.name)?i(h(e)):i(null,!0),s={Content:{Raw:{Data:Buffer.from("From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid")}},FromEmailAddress:"invalid@invalid",Destination:{ToAddresses:["invalid@invalid"]}};return this.getRegion(()=>{let e;try{const t=new this.ses.SendEmailCommand(s);e=this.ses.sesClient.send(t)}catch(e){return void setImmediate(()=>n(e))}e.then(()=>setImmediate(()=>n(null))).catch(e=>setImmediate(()=>n(e)))}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Tu,Tu.exports)),Tu.exports}function Su(){return Eu||(Eu=1,function(e){var t,i=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=Nn&&Nn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var r=t(e),o=0;o<r.length;o++)"default"!==r[o]&&i(s,e,r[o]);return n(s,e),s}),r=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createTransport=I,e.createTestAccount=b,e.getTestMessageUrl=C;const o=r($l()),a=s(ll()),c=r(wu()),u=r((Mu||(Mu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=o(ou()),u=o(gu()),p=r(ll()),d=o(uu()),m=r(il()),h=r($c());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=p.parseConnectionUrl(e.url),i=i||t.service),this.options=p.assign(!1,e,t,i&&(0,u.default)(i)),this.logger=p.getLogger(this.options,{component:this.options.component||"smtp-transport"}),this.name="SMTP",this.version=h.version+"[client:"+h.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){setImmediate(()=>t(null,!1))}getAuth(e){if(!e)return this.auth&&this.auth.oauth2&&this.mailer&&(this.auth.oauth2.provisionCallback=this.mailer.get("oauth2_provision_cb")||this.auth.oauth2.provisionCallback),this.auth;const t=Object.assign({},this.options.auth&&"object"==typeof this.options.auth?this.options.auth:{},"object"==typeof e?e:{});if(0===Object.keys(t).length)return!1;if("OAUTH2"===(t.type||"").toString().toUpperCase()){if(!t.service&&!t.user)return!1;const e=new d.default(t,this.logger);return e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback,e.on("token",e=>this.mailer.emit("token",e)),e.on("error",e=>this.emit("error",e)),{type:"OAUTH2",user:t.user,oauth2:e,method:"XOAUTH2"}}return{type:(t.type||"").toString().toUpperCase()||"LOGIN",user:t.user,credentials:{user:t.user||"",pass:t.pass,options:t.options},method:(t.method||"").trim().toUpperCase()||this.options.authMethod||!1}}send(e,t){this.getSocket(this.options,(i,n)=>{if(i)return t(i);let s=!1,r=this.options;n&&n.connection&&(this.logger.info({tnx:"proxy",remoteAddress:n.connection.remoteAddress,remotePort:n.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",n.connection.remoteAddress,n.connection.remotePort,r.host||"",r.port||""),r=Object.assign(p.assign(!1,r),n));const o=new c.default(r);let a;const l=()=>{a&&a!==this.auth&&a.oauth2&&a.oauth2.removeAllListeners(),a=null};o.once("error",e=>{if(!s)return s=!0,l(),o.close(),t(e)});const u=()=>{const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,r.join(", ")),o.send(i,e.message.createReadStream(),(e,r)=>{if(!s){if(s=!0,l(),o.close(),e)return this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",n,e.message),t(e);r.envelope={from:i.from,to:i.to},r.messageId=n;try{return t(null,r)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",n,e.message)}}})};o.connect(i=>{if(!s){if(i)return s=!0,o.close(),t(i);a=this.getAuth(e.data.auth),a&&(o.allowsAuth||r.forceAuth)?o.login(a,e=>{if(l(),!s)return e?(s=!0,o.close(),t(e)):void u()}):u()}})})}verify(e){let t;e||(t=new Promise((t,i)=>{e=p.callbackPromise(t,i)}));const i=e;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let n=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:n.host||"",destPort:n.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,n.host||"",n.port||""),n=Object.assign(p.assign(!1,n),t));const s=new c.default(n);let r,o=!1;const a=()=>{r&&r!==this.auth&&r.oauth2&&r.oauth2.removeAllListeners(),r=null};s.once("error",e=>{if(!o)return o=!0,a(),s.close(),i(e)}),s.once("end",()=>{if(!o)return o=!0,a(),i(new Error("Connection closed"))});const l=()=>{if(!o)return o=!0,a(),s.quit(),i(null,!0)};s.connect(e=>{if(!o){if(e)return o=!0,s.close(),i(e);if(r=this.getAuth({}),r&&(s.allowsAuth||n.forceAuth))s.login(r,e=>{if(a(),!o)return e?(o=!0,s.close(),i(e)):void l()});else{if(!r&&s.allowsAuth&&n.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,a(),s.close(),i(e)}l()}}})}),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(yu,yu.exports)),yu.exports)),p=r((Du||(Du=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=v,c=r($c()),l=r(ll()),u=r(il()),p=o(Nl()),d=o(Yl());t.default=class{constructor(e){e=e||{},this._spawn=a.spawn,this.options=e,this.name="Sendmail",this.version=c.version,this.path="sendmail",this.args=!1,this.logger=l.getLogger(this.options,{component:this.options.component||"sendmail"}),"string"==typeof e?this.path=e:"object"==typeof e&&(e.path&&(this.path=e.path),Array.isArray(e.args)&&(this.args=e.args)),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId();let s;if([].concat(i.from||[]).concat(i.to||[]).some(e=>/^"?-/.test(e))){const e=new Error("Can not send mail. Invalid envelope addresses.");return e.code=u.ESENDMAIL,t(e)}const r=this.args?["-i"].concat(this.args).concat(i.to):["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to),o=e=>{if(!s)return s=!0,"function"==typeof t?e?t(e):t(null,{envelope:i,messageId:n,response:"Messages queued for delivery"}):void 0};let a;try{a=this._spawn(this.path,r)}catch(e){return this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred while spawning sendmail. %s",e.message),o(e)}if(!a){const e=new Error("sendmail was not found");return e.code=u.ESENDMAIL,o(e)}{a.on("error",e=>{this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred when sending message %s. %s",n,e.message),o(e)}),a.once("exit",e=>{if(!e)return o();const t=new Error(127===e?"Sendmail command not found, process exited with code "+e:"Sendmail exited with code "+e);t.code=u.ESENDMAIL,this.logger.error({err:t,tnx:"stdin",messageId:n},"Error sending message %s to sendmail. %s",n,t.message),o(t)}),a.once("close",o),a.stdin.on("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when piping message %s to sendmail. %s",n,e.message),o(e)});const t=[].concat(i.to||[]);t.length>3&&t.push("...and "+t.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,t.join(", "));const s=e.message.createReadStream();let r=s;this.options.newline&&(r=s.pipe(this.winbreak?new p.default:new d.default),s.once("error",e=>r.emit("error",e))),r.once("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when generating message %s. %s",n,e.message),a.kill("SIGINT"),o(e)}),r.pipe(a.stdin)}}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(xu,xu.exports)),xu.exports)),d=r((Lu||(Lu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r($c()),c=r(ll()),l=o(Nl()),u=o(Yl());t.default=class{constructor(e){e=e||{},this.options=e,this.name="StreamTransport",this.version=a.version,this.logger=c.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s> using %s line breaks",n,s.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let s;try{if(s=e.message.createReadStream(),this.options.newline){const e=s;s=e.pipe(this.winbreak?new l.default:new u.default),e.once("error",e=>s.emit("error",e))}}catch(e){return this.logger.error({err:e,tnx:"send",messageId:n},"Creating send stream failed for %s. %s",n,e.message),t(e)}if(!this.options.buffer)return s.once("error",e=>{this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message)}),t(null,{envelope:i,messageId:n,message:s});const r=[];let o=0;s.on("readable",()=>{let e;for(;null!==(e=s.read());)r.push(e),o+=e.length}),s.once("error",e=>(this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message),t(e))),s.on("end",()=>t(null,{envelope:i,messageId:n,message:Buffer.concat(r,o)}))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(vu,vu.exports)),vu.exports)),m=r((Iu||(Iu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=r($c()),a=r(ll());t.default=class{constructor(e){e=e||{},this.options=e,this.name="JSONTransport",this.version=o.version,this.logger=a.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Composing JSON structure of %s to <%s>",n,s.join(", ")),setImmediate(()=>{e.normalize((e,s)=>e?(this.logger.error({err:e,tnx:"send",messageId:n},"Failed building JSON structure for %s. %s",n,e.message),t(e)):(delete s.envelope,delete s.normalizedHeaders,t(null,{envelope:i,messageId:n,message:this.options.skipEncoding?s:JSON.stringify(s)})))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(bu,bu.exports)),bu.exports)),h=r(Au()),f=s(il()),g=r(cl()),w=s($c()),M=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),y=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),D=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,x=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let L=!1;function I(e,t){let i;if("object"==typeof e&&"function"!=typeof e.send||"string"==typeof e&&/^(smtps?|direct):/i.test(e)){const t="string"==typeof e?e:e.url;if(t){const n=a.parseConnectionUrl(t);i="object"==typeof e?a.assign(!1,a.copyOwnKeys({},e,e=>"url"===e),n):n}else i=e;if(i.pool)e=new c.default(i);else if(i.sendmail)e=new p.default(i);else if(i.streamTransport)e=new d.default(i);else if(i.jsonTransport)e=new m.default(i);else if(i.SES){const t=i.SES;if(t.ses&&t.aws){const e=new Error("Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=f.ECONFIG,e}e=new h.default(i)}else e=new u.default(i)}return new o.default(e,i,t)}function b(e,t){let i;t||"function"!=typeof e||(t=e,e=!1),t||(i=new Promise((e,i)=>{t=a.callbackPromise(e,i)}));const n=t;if(x&&L)return setImmediate(()=>n(null,L)),i;e=e||M;const s=[];let r=0;const o={},c={requestor:w.name,version:w.version};D&&(o.Authorization="Bearer "+D);const l={contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(c))};/^https:/i.test(e)&&(l.tls={rejectUnauthorized:!0});const u=(0,g.default)(e+"/user",l);return u.on("readable",()=>{let e;for(;null!==(e=u.read());)s.push(e),r+=e.length}),u.once("error",e=>n(e)),u.once("end",()=>{const e=Buffer.concat(s,r);let t;try{t=JSON.parse(e.toString())}catch(e){return n(e)}if("success"!==t.status||t.error)return n(new Error(t.error||"Request failed"));delete t.status,L=t,n(null,L)}),i}function C(e){if(!e||!e.response)return!1;const t=new Map,i=e.response.toString();if(i.length>2&&"]"===i.charAt(i.length-1)){const e=i.indexOf("[",i.lastIndexOf("]",i.length-2)+1);if(e>=0&&e<i.length-2){i.substring(e+1,i.length-1).replace(/\b([A-Z0-9]+)=([^\s]+)/g,(e,i,n)=>(t.set(i,n),e))}}return!(!t.has("STATUS")||!t.has("MSGID"))&&(L&&L.web||y)+"/message/"+t.get("MSGID")}const E={createTransport:I,createTestAccount:b,getTestMessageUrl:C};e.default=E,Object.defineProperty(e,"default",{value:e,enumerable:!1,writable:!0,configurable:!0})}(Pc)),Pc}
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("path"),require("fs"),require("@hapi/hapi"),require("@hapi/inert"),require("stream"),require("http"),require("worker_threads"),require("url"),require("pino"),require("node:events"),require("node:net"),require("node:url"),require("node:util"),require("node:fs"),require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:dns"),require("node:os"),require("node:path"),require("node:crypto"),require("node:tls"),require("node:child_process"),require("crypto"),require("readline")):"function"==typeof define&&define.amd?define(["path","fs","@hapi/hapi","@hapi/inert","stream","http","worker_threads","url","pino","node:events","node:net","node:url","node:util","node:fs","node:http","node:https","node:zlib","node:stream","node:dns","node:os","node:path","node:crypto","node:tls","node:child_process","crypto","readline"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-web-sso"]=t(e.path,e.fs,e["@hapi/hapi"],e["@hapi/inert"],e.stream,e.http,e.require$$0$1,e.url,e.pino,e.require$$0$6,e.require$$0$2,e.require$$1,e.require$$1$2,e.require$$2,e.require$$0$3,e.require$$1$1,e.require$$3,e.require$$0$4,e.require$$6,e.require$$8,e.require$$0$5,e.require$$2$1,e.require$$1$3,e.require$$0$7,e.crypto$1,e.readline)}(this,function(e,t,i,n,s,r,o,a,c,l,u,p,d,m,h,f,g,w,M,y,D,x,L,v,I,b){"use strict";var C="undefined"!=typeof document?document.currentScript:null,E=Array.isArray,T="object"==typeof global&&global&&global.Object===Object&&global,A="object"==typeof self&&self&&self.Object===Object&&self,S=T||A||Function("return this")(),N=S.Symbol,k=Object.prototype,j=k.hasOwnProperty,Z=k.toString,z=N?N.toStringTag:void 0;var Y=Object.prototype.toString;var X=N?N.toStringTag:void 0;function F(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":X&&X in Object(e)?function(e){var t=j.call(e,z),i=e[z];try{e[z]=void 0;var n=!0}catch(e){}var s=Z.call(e);return n&&(t?e[z]=i:delete e[z]),s}(e):function(e){return Y.call(e)}(e)}function U(e){return null!=e&&"object"==typeof e}function G(e){return"symbol"==typeof e||U(e)&&"[object Symbol]"==F(e)}var P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/;function O(e,t){if(E(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!G(e))||(K.test(e)||!P.test(e)||null!=t&&e in Object(t))}function _(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function W(e){if(!_(e))return!1;var t=F(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,B=S["__core-js_shared__"],V=(H=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var Q=Function.prototype.toString;function R(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var J=/^\[object .+?Constructor\]$/,q=Function.prototype,$=Object.prototype,ee=q.toString,te=$.hasOwnProperty,ie=RegExp("^"+ee.call(te).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ne(e){return!(!_(e)||(t=e,V&&V in t))&&(W(e)?ie:J).test(R(e));var t}function se(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ne(i)?i:void 0}var re=se(Object,"create");var oe=Object.prototype.hasOwnProperty;var ae=Object.prototype.hasOwnProperty;function ce(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function le(e,t){return e===t||e!=e&&t!=t}function ue(e,t){for(var i=e.length;i--;)if(le(e[i][0],t))return i;return-1}ce.prototype.clear=function(){this.__data__=re?re(null):{},this.size=0},ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce.prototype.get=function(e){var t=this.__data__;if(re){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return oe.call(t,e)?t[e]:void 0},ce.prototype.has=function(e){var t=this.__data__;return re?void 0!==t[e]:ae.call(t,e)},ce.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=re&&void 0===t?"__lodash_hash_undefined__":t,this};var pe=Array.prototype.splice;function de(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}de.prototype.clear=function(){this.__data__=[],this.size=0},de.prototype.delete=function(e){var t=this.__data__,i=ue(t,e);return!(i<0)&&(i==t.length-1?t.pop():pe.call(t,i,1),--this.size,!0)},de.prototype.get=function(e){var t=this.__data__,i=ue(t,e);return i<0?void 0:t[i][1]},de.prototype.has=function(e){return ue(this.__data__,e)>-1},de.prototype.set=function(e,t){var i=this.__data__,n=ue(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var me=se(S,"Map");function he(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(me||de),string:new ce}},fe.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},fe.prototype.get=function(e){return he(this,e).get(e)},fe.prototype.has=function(e){return he(this,e).has(e)},fe.prototype.set=function(e,t){var i=he(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function ge(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var o=e.apply(this,n);return i.cache=r.set(s,o)||r,o};return i.cache=new(ge.Cache||fe),i}ge.Cache=fe;var we=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/\\(\\)?/g,ye=function(e){var t=ge(e,function(e){return 500===i.size&&i.clear(),e}),i=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(we,function(e,i,n,s){t.push(n?s.replace(Me,"$1"):i||e)}),t}),De=ye;function xe(e,t){for(var i=-1,n=null==e?0:e.length,s=Array(n);++i<n;)s[i]=t(e[i],i,e);return s}var Le=N?N.prototype:void 0,ve=Le?Le.toString:void 0;function Ie(e){if("string"==typeof e)return e;if(E(e))return xe(e,Ie)+"";if(G(e))return ve?ve.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function be(e){return null==e?"":Ie(e)}function Ce(e,t){return E(e)?e:O(e,t)?[e]:De(be(e))}function Ee(e){if("string"==typeof e||G(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Te(e,t){for(var i=0,n=(t=Ce(t,e)).length;null!=e&&i<n;)e=e[Ee(t[i++])];return i&&i==n?e:void 0}function Ae(e,t,i){var n=null==e?void 0:Te(e,t);return void 0===n?i:n}var Se=Object.prototype;function Ne(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)}function ke(e,t){return function(i){return e(t(i))}}var je=ke(Object.keys,Object),Ze=Object.prototype.hasOwnProperty;function ze(e){if(!Ne(e))return je(e);var t=[];for(var i in Object(e))Ze.call(e,i)&&"constructor"!=i&&t.push(i);return t}var Ye=se(S,"DataView"),Xe=se(S,"Promise"),Fe=se(S,"Set"),Ue=se(S,"WeakMap"),Ge="[object Map]",Pe="[object Promise]",Ke="[object Set]",Oe="[object WeakMap]",_e="[object DataView]",We=R(Ye),He=R(me),Be=R(Xe),Ve=R(Fe),Qe=R(Ue),Re=F;(Ye&&Re(new Ye(new ArrayBuffer(1)))!=_e||me&&Re(new me)!=Ge||Xe&&Re(Xe.resolve())!=Pe||Fe&&Re(new Fe)!=Ke||Ue&&Re(new Ue)!=Oe)&&(Re=function(e){var t=F(e),i="[object Object]"==t?e.constructor:void 0,n=i?R(i):"";if(n)switch(n){case We:return _e;case He:return Ge;case Be:return Pe;case Ve:return Ke;case Qe:return Oe}return t});var Je=Re;function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $e(e){return null!=e&&qe(e.length)&&!W(e)}function et(e){return function(t){return null==t?void 0:t[e]}}var tt=et("length"),it=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function nt(e){return it.test(e)}var st="\\ud800-\\udfff",rt="["+st+"]",ot="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",at="\\ud83c[\\udffb-\\udfff]",ct="[^"+st+"]",lt="(?:\\ud83c[\\udde6-\\uddff]){2}",ut="[\\ud800-\\udbff][\\udc00-\\udfff]",pt="(?:"+ot+"|"+at+")"+"?",dt="[\\ufe0e\\ufe0f]?",mt=dt+pt+("(?:\\u200d(?:"+[ct,lt,ut].join("|")+")"+dt+pt+")*"),ht="(?:"+[ct+ot+"?",ot,lt,ut,rt].join("|")+")",ft=RegExp(at+"(?="+at+")|"+ht+mt,"g");function gt(e){return nt(e)?function(e){for(var t=ft.lastIndex=0;ft.test(e);)++t;return t}(e):tt(e)}function wt(e){if(null==e)return 0;if($e(e))return"string"==typeof(t=e)||!E(t)&&U(t)&&"[object String]"==F(t)?gt(e):e.length;var t,i=Je(e);return"[object Map]"==i||"[object Set]"==i?e.size:ze(e).length}function Mt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(!t(e[i],i,e))return!1;return!0}var yt,Dt=function(e,t,i){for(var n=-1,s=Object(e),r=i(e),o=r.length;o--;){var a=r[yt?o:++n];if(!1===t(s[a],a,s))break}return e};function xt(e){return U(e)&&"[object Arguments]"==F(e)}var Lt=Object.prototype,vt=Lt.hasOwnProperty,It=Lt.propertyIsEnumerable,bt=xt(function(){return arguments}())?xt:function(e){return U(e)&&vt.call(e,"callee")&&!It.call(e,"callee")},Ct=bt;var Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,At=Tt&&Tt.exports===Et?S.Buffer:void 0,St=(At?At.isBuffer:void 0)||function(){return!1},Nt=/^(?:0|[1-9]\d*)$/;function kt(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Nt.test(e))&&e>-1&&e%1==0&&e<t}var jt={};function Zt(e){return function(t){return e(t)}}jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Arguments]"]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object Boolean]"]=jt["[object DataView]"]=jt["[object Date]"]=jt["[object Error]"]=jt["[object Function]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object WeakMap]"]=!1;var zt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yt=zt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Yt&&Yt.exports===zt&&T.process,Ft=function(){try{var e=Yt&&Yt.require&&Yt.require("util").types;return e||Xt&&Xt.binding&&Xt.binding("util")}catch(e){}}(),Ut=Ft&&Ft.isTypedArray,Gt=Ut?Zt(Ut):function(e){return U(e)&&qe(e.length)&&!!jt[F(e)]},Pt=Object.prototype.hasOwnProperty;function Kt(e,t){var i=E(e),n=!i&&Ct(e),s=!i&&!n&&St(e),r=!i&&!n&&!s&&Gt(e),o=i||n||s||r,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Pt.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||kt(l,c))||a.push(l);return a}function Ot(e){return $e(e)?Kt(e):ze(e)}function _t(e,t){return e&&Dt(e,t,Ot)}var Wt=function(e,t){return function(i,n){if(null==i)return i;if(!$e(i))return e(i,n);for(var s=i.length,r=t?s:-1,o=Object(i);(t?r--:++r<s)&&!1!==n(o[r],r,o););return i}}(_t),Ht=Wt;function Bt(e,t){var i=!0;return Ht(e,function(e,n,s){return i=!!t(e,n,s)}),i}function Vt(e){var t=this.__data__=new de(e);this.size=t.size}Vt.prototype.clear=function(){this.__data__=new de,this.size=0},Vt.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Vt.prototype.get=function(e){return this.__data__.get(e)},Vt.prototype.has=function(e){return this.__data__.has(e)},Vt.prototype.set=function(e,t){var i=this.__data__;if(i instanceof de){var n=i.__data__;if(!me||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new fe(n)}return i.set(e,t),this.size=i.size,this};function Qt(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new fe;++t<i;)this.add(e[t])}function Rt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function Jt(e,t){return e.has(t)}Qt.prototype.add=Qt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Qt.prototype.has=function(e){return this.__data__.has(e)};function qt(e,t,i,n,s,r){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=r.get(e),u=r.get(t);if(l&&u)return l==t&&u==e;var p=-1,d=!0,m=2&i?new Qt:void 0;for(r.set(e,t),r.set(t,e);++p<a;){var h=e[p],f=t[p];if(n)var g=o?n(f,h,p,t,e,r):n(h,f,p,e,t,r);if(void 0!==g){if(g)continue;d=!1;break}if(m){if(!Rt(t,function(e,t){if(!Jt(m,t)&&(h===e||s(h,e,i,n,r)))return m.push(t)})){d=!1;break}}else if(h!==f&&!s(h,f,i,n,r)){d=!1;break}}return r.delete(e),r.delete(t),d}var $t=S.Uint8Array;function ei(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function ti(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var ii=N?N.prototype:void 0,ni=ii?ii.valueOf:void 0;function si(e,t){for(var i=-1,n=t.length,s=e.length;++i<n;)e[s+i]=t[i];return e}function ri(e,t,i){var n=t(e);return E(e)?n:si(n,i(e))}function oi(e,t){for(var i=-1,n=null==e?0:e.length,s=0,r=[];++i<n;){var o=e[i];t(o,i,e)&&(r[s++]=o)}return r}function ai(){return[]}var ci=Object.prototype.propertyIsEnumerable,li=Object.getOwnPropertySymbols,ui=li?function(e){return null==e?[]:(e=Object(e),oi(li(e),function(t){return ci.call(e,t)}))}:ai;function pi(e){return ri(e,Ot,ui)}var di=Object.prototype.hasOwnProperty;var mi="[object Arguments]",hi="[object Array]",fi="[object Object]",gi=Object.prototype.hasOwnProperty;function wi(e,t,i,n,s,r){var o=E(e),a=E(t),c=o?hi:Je(e),l=a?hi:Je(t),u=(c=c==mi?fi:c)==fi,p=(l=l==mi?fi:l)==fi,d=c==l;if(d&&St(e)){if(!St(t))return!1;o=!0,u=!1}if(d&&!u)return r||(r=new Vt),o||Gt(e)?qt(e,t,i,n,s,r):function(e,t,i,n,s,r,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new $t(e),new $t(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return le(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ei;case"[object Set]":var c=1&n;if(a||(a=ti),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=qt(a(e),a(t),n,s,r,o);return o.delete(e),u;case"[object Symbol]":if(ni)return ni.call(e)==ni.call(t)}return!1}(e,t,c,i,n,s,r);if(!(1&i)){var m=u&&gi.call(e,"__wrapped__"),h=p&&gi.call(t,"__wrapped__");if(m||h){var f=m?e.value():e,g=h?t.value():t;return r||(r=new Vt),s(f,g,i,n,r)}}return!!d&&(r||(r=new Vt),function(e,t,i,n,s,r){var o=1&i,a=pi(e),c=a.length;if(c!=pi(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:di.call(t,u)))return!1}var p=r.get(e),d=r.get(t);if(p&&d)return p==t&&d==e;var m=!0;r.set(e,t),r.set(t,e);for(var h=o;++l<c;){var f=e[u=a[l]],g=t[u];if(n)var w=o?n(g,f,u,t,e,r):n(f,g,u,e,t,r);if(!(void 0===w?f===g||s(f,g,i,n,r):w)){m=!1;break}h||(h="constructor"==u)}if(m&&!h){var M=e.constructor,y=t.constructor;M==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof M&&M instanceof M&&"function"==typeof y&&y instanceof y||(m=!1)}return r.delete(e),r.delete(t),m}(e,t,i,n,s,r))}function Mi(e,t,i,n,s){return e===t||(null==e||null==t||!U(e)&&!U(t)?e!=e&&t!=t:wi(e,t,i,n,Mi,s))}function yi(e){return e==e&&!_(e)}function Di(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function xi(e){var t=function(e){for(var t=Ot(e),i=t.length;i--;){var n=t[i],s=e[n];t[i]=[n,s,yi(s)]}return t}(e);return 1==t.length&&t[0][2]?Di(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var s=i.length,r=s,o=!n;if(null==e)return!r;for(e=Object(e);s--;){var a=i[s];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<r;){var c=(a=i[s])[0],l=e[c],u=a[1];if(o&&a[2]){if(void 0===l&&!(c in e))return!1}else{var p=new Vt;if(n)var d=n(l,u,c,e,t,p);if(!(void 0===d?Mi(u,l,3,n,p):d))return!1}}return!0}(i,e,t)}}function Li(e,t){return null!=e&&t in Object(e)}function vi(e,t){return null!=e&&function(e,t,i){for(var n=-1,s=(t=Ce(t,e)).length,r=!1;++n<s;){var o=Ee(t[n]);if(!(r=null!=e&&i(e,o)))break;e=e[o]}return r||++n!=s?r:!!(s=null==e?0:e.length)&&qe(s)&&kt(o,s)&&(E(e)||Ct(e))}(e,t,Li)}function Ii(e){return e}function bi(e){return O(e)?et(Ee(e)):function(e){return function(t){return Te(t,e)}}(e)}function Ci(e){return"function"==typeof e?e:null==e?Ii:"object"==typeof e?E(e)?function(e,t){return O(e)&&yi(t)?Di(Ee(e),t):function(i){var n=Ae(i,e);return void 0===n&&n===t?vi(i,e):Mi(t,n,3)}}(e[0],e[1]):xi(e):bi(e)}function Ei(e,t,i){if(!_(i))return!1;var n=typeof t;return!!("number"==n?$e(i)&&kt(t,i.length):"string"==n&&t in i)&&le(i[t],e)}function Ti(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ai(e){if(Ti(e)){for(let t in e)return!0;return!1}return!1}function Si(e){return"[object String]"===Object.prototype.toString.call(e)}function Ni(e){return!(!Si(e)||""===e)}var ki=/\s/;var ji=/^\s+/;function Zi(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&ki.test(e.charAt(t)););return t}(e)+1).replace(ji,""):e}var zi=/^[-+]0x[0-9a-f]+$/i,Yi=/^0b[01]+$/i,Xi=/^0o[0-7]+$/i,Fi=parseInt;function Ui(e){if("number"==typeof e)return e;if(G(e))return NaN;if(_(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=_(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zi(e);var i=Yi.test(e);return i||Xi.test(e)?Fi(e.slice(2),i?2:8):zi.test(e)?NaN:+e}var Gi=1/0;function Pi(e){return e?(e=Ui(e))===Gi||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ki(e){var t=Pi(e),i=t%1;return t==t?i?t-i:t:0}function Oi(e){return!0===(t=e)||!1===t||U(t)&&"[object Boolean]"==F(t);var t}function _i(e){return e!=e}function Wi(e){let t=!1;if(Ni(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(_i(e))return!1;t=!0}return t}function Hi(e){if(!Wi(e))return 0;return Pi(e)}function Bi(e,t={}){let i=Ae(t,"useLimitSafe",null);return Oi(i)||(i=!1),!!Wi(e)&&(e=Hi(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==Ki(n));var n}var Vi=S.isFinite,Qi=Math.min;var Ri,Ji=(Ri=Math["round"],function(e,t){if(e=Ui(e),(t=null==t?0:Qi(Ki(t),292))&&Vi(e)){var i=(be(e)+"e").split("e");return+((i=(be(Ri(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return Ri(e)});function qi(e,t={}){let i=Ae(t,"useClampSafe",null);Oi(i)||(i=!1);let n=Ae(t,"useLimitSafe",null);Oi(n)||(n=!1);let s=Ae(t,"returnWithStateAndMsg",null);Oi(s)||(s=!1);let r=e=>s?{state:"success",msg:e}:e,o=e=>{if(s)return{state:"error",msg:e};throw new Error(e)};if(!Wi(e))return r(0);let a=null;try{e=Hi(e),a=Ji(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),r(a))}function $i(e,t={}){if(!Bi(e,t))return!1;return qi(e)>0}function en(e){return"[object Array]"===Object.prototype.toString.call(e)}function tn(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function nn(e){if(Ti(e)){for(let t in e)return!1;return!0}return!1}function sn(e){return!!en(e)&&0===e.length}function rn(e){return!!tn(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!nn(e)||(!!function(e){return!(!Si(e)||""!==e)}(e)||(!!sn(e)||!!_i(e)))))}function on(e){return!!en(e)&&(0!==e.length&&(1!==e.length||!rn(e[0])))}function an(e){if(!Wi(e))return!1;return Hi(e)>0}var cn=ke(Object.getPrototypeOf,Object),ln=Function.prototype,un=Object.prototype,pn=ln.toString,dn=un.hasOwnProperty,mn=pn.call(Object);function hn(e){if(!U(e)||"[object Object]"!=F(e))return!1;var t=cn(e);if(null===t)return!0;var i=dn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&pn.call(i)==mn}function fn(e){if(!U(e))return!1;var t=F(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!hn(e)}function gn(e){return fn(e)}function wn(e){return W(e)}function Mn(e,t={}){if(!Bi(e,t))return!1;return qi(e)>=0}function yn(e,t){return Ni(e)&&Mn(t)?0===(t=qi(t))?"":e.substring(0,t):""}function Dn(e,t){if(!Ni(e))return"";if(!Mn(t))return"";if(0===(t=qi(t)))return"";let i=e.length-t;return i<0&&(i=0),e.substring(i,i+t)}function xn(e,t){return Ni(e)&&Mn(t)?0===(t=qi(t))?e:yn(e,e.length-t):""}function Ln(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}function vn(e){let t,i=Object.prototype.toString.call(e);if(t="[object Promise]"===i,t)return!0;if("[object Function]"!==i)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}let In=function(e){if(!wn(e))throw new Error("fn is not a function");return function(){let t=Ln(),i=null,n=null;try{i=e.apply(this,arguments)}catch(e){n=e}return null!==n?t.resolve({state:"error",msg:n}):vn(i)?i.then(e=>{t.resolve({state:"success",msg:e})}).catch(e=>{"cancelled"===Ae(e,"reason")?t.resolve({state:"cancelled",msg:""}):t.resolve({state:"error",msg:e})}):t.resolve({state:"success",msg:i}),t}};function bn(e,t={}){let i=Ae(t,"fs"),n=!1;try{i.statSync(e),n=!0}catch{n=!1}return n}function Cn(e,t={}){let i=Ae(t,"fs");if(!bn(e,{fs:i}))return!1;let n=i.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function En(e){return Cn(e,{fs:t})}function Tn(e,t={}){let i=Ae(t,"fs");return!!bn(e,{fs:i})&&(!i.lstatSync(e).isDirectory()&&!i.lstatSync(e).isSymbolicLink())}function An(e){return Tn(e,{fs:t})}function Sn(e,t,i){if(!Ni(e))return"";if(!Ni(t))return"";if(!Si(i))return"";return String(e).replaceAll(t,i)}var Nn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(t,i))}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),i}var Zn={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",s="second",r="minute",o="hour",a="day",c="week",l="month",u="quarter",p="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},w=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},M={s:w,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),s=i%60;return(t<=0?"+":"-")+w(n,2,"0")+":"+w(s,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),s=t.clone().add(n,l),r=i-s<0,o=t.clone().add(n+(r?-1:1),l);return+(-(n+(i-s)/(r?s-o:o-s))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:p,w:c,d:a,D:d,h:o,m:r,s:s,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",D={};D[y]=g;var x="$isDayjsObject",L=function(e){return e instanceof C||!(!e||!e[x])},v=function e(t,i,n){var s;if(!t)return y;if("string"==typeof t){var r=t.toLowerCase();D[r]&&(s=r),i&&(D[r]=i,s=r);var o=t.split("-");if(!s&&o.length>1)return e(o[0])}else{var a=t.name;D[a]=t,s=a}return!n&&s&&(y=s),s||!n&&y},I=function(e,t){if(L(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new C(i)},b=M;b.l=v,b.i=L,b.w=function(e,t){return I(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function g(e){this.$L=v(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var w=g.prototype;return w.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var s=n[2]-1||0,r=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)}}return new Date(t)}(e),this.init()},w.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},w.$utils=function(){return b},w.isValid=function(){return!(this.$d.toString()===m)},w.isSame=function(e,t){var i=I(e);return this.startOf(t)<=i&&i<=this.endOf(t)},w.isAfter=function(e,t){return I(e)<this.startOf(t)},w.isBefore=function(e,t){return this.endOf(t)<I(e)},w.$g=function(e,t,i){return b.u(e)?this[t]:this.set(i,e)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(e,t){var i=this,n=!!b.u(t)||t,u=b.p(e),m=function(e,t){var s=b.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?s:s.endOf(a)},h=function(e,t){return b.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},f=this.$W,g=this.$M,w=this.$D,M="set"+(this.$u?"UTC":"");switch(u){case p:return n?m(1,0):m(31,11);case l:return n?m(1,g):m(0,g+1);case c:var y=this.$locale().weekStart||0,D=(f<y?f+7:f)-y;return m(n?w-D:w+(6-D),g);case a:case d:return h(M+"Hours",0);case o:return h(M+"Minutes",1);case r:return h(M+"Seconds",2);case s:return h(M+"Milliseconds",3);default:return this.clone()}},w.endOf=function(e){return this.startOf(e,!1)},w.$set=function(e,t){var i,c=b.p(e),u="set"+(this.$u?"UTC":""),m=(i={},i[a]=u+"Date",i[d]=u+"Date",i[l]=u+"Month",i[p]=u+"FullYear",i[o]=u+"Hours",i[r]=u+"Minutes",i[s]=u+"Seconds",i[n]=u+"Milliseconds",i)[c],h=c===a?this.$D+(t-this.$W):t;if(c===l||c===p){var f=this.clone().set(d,1);f.$d[m](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},w.set=function(e,t){return this.clone().$set(e,t)},w.get=function(e){return this[b.p(e)]()},w.add=function(n,u){var d,m=this;n=Number(n);var h=b.p(u),f=function(e){var t=I(m);return b.w(t.date(t.date()+Math.round(e*n)),m)};if(h===l)return this.set(l,this.$M+n);if(h===p)return this.set(p,this.$y+n);if(h===a)return f(1);if(h===c)return f(7);var g=(d={},d[r]=t,d[o]=i,d[s]=e,d)[h]||1,w=this.$d.getTime()+n*g;return b.w(w,this)},w.subtract=function(e,t){return this.add(-1*e,t)},w.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=b.z(this),r=this.$H,o=this.$m,a=this.$M,c=i.weekdays,l=i.months,u=i.meridiem,p=function(e,i,s,r){return e&&(e[i]||e(t,n))||s[i].slice(0,r)},d=function(e){return b.s(r%12||12,e,"0")},h=u||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(f,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return b.s(t.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return p(i.monthsShort,a,l,3);case"MMMM":return p(l,a);case"D":return t.$D;case"DD":return b.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(i.weekdaysMin,t.$W,c,2);case"ddd":return p(i.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(r);case"HH":return b.s(r,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(r,o,!0);case"A":return h(r,o,!1);case"m":return String(o);case"mm":return b.s(o,2,"0");case"s":return String(t.$s);case"ss":return b.s(t.$s,2,"0");case"SSS":return b.s(t.$ms,3,"0");case"Z":return s}return null}(e)||s.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(n,d,m){var h,f=this,g=b.p(d),w=I(n),M=(w.utcOffset()-this.utcOffset())*t,y=this-w,D=function(){return b.m(f,w)};switch(g){case p:h=D()/12;break;case l:h=D();break;case u:h=D()/3;break;case c:h=(y-M)/6048e5;break;case a:h=(y-M)/864e5;break;case o:h=y/i;break;case r:h=y/t;break;case s:h=y/e;break;default:h=y}return m?h:b.a(h)},w.daysInMonth=function(){return this.endOf(l).$D},w.$locale=function(){return D[this.$L]},w.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=v(e,t,!0);return n&&(i.$L=n),i},w.clone=function(){return b.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},g}(),E=C.prototype;return I.prototype=E,[["$ms",n],["$s",s],["$m",r],["$H",o],["$W",a],["$M",l],["$y",p],["$D",d]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),I.extend=function(e,t){return e.$i||(e(t,C,I),e.$i=!0),I},I.locale=v,I.isDayjs=L,I.unix=function(e){return I(1e3*e)},I.en=D[y],I.Ls=D,I.p={},I}()}(Zn);var zn=kn(Zn.exports);function Yn(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYY-MM-DDTHH:mm:ssZ")}let Xn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Fn=Xn.length;function Un(e=32){let t=[];e=$i(e)?qi(e):32;for(let i=0;i<e;i++)t[i]=Xn[0|Math.random()*Fn];return t.join("")}var Gn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(Gn);var Pn=kn(Gn.exports);function Kn(){return new Pn}let On=2147483647;async function _n(e,t={}){let i=null,n=Ln();if(!wn(e))return n.reject("waitfunction需輸入函數f"),n;let s=async()=>{let t=e();return vn(t)&&(t=await t),t};if(i=await s(),!0===i)return n.resolve(),n;let r=Ae(t,"attemptNum",null);$i(r)||(r=200);let o=Ae(t,"timeInterval",null);$i(o)||(o=1e3),o=Math.min(o,On);let a=0,c=setInterval(async()=>{a+=1,i=await s(),!0===i&&(clearInterval(c),n.resolve()),a>r&&(clearInterval(c),n.reject(`exceeded attemptNum[${r}]`))},o);return n}function Wn(e){return function(e,t={}){let i=Ae(t,"fs");if(Cn(e,{fs:i}))return{success:"input folder is already exists: "+e};if(bn(e,{fs:i}))return{error:"input path already exists: "+e};try{i.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}function Hn(e,t,i=[],n={}){let s=n.funSettle,r=n.tag||"evem",o=(t,...i)=>e.emit(t,...i);wn(n.funEmit)&&(o=n.funEmit);try{return o(t,...i)}catch(n){if(wn(s))try{s(n)}catch(e){}try{"error"!==t&&e.listenerCount("error")>0?o("error",{fun:"listener",name:t,msg:n,args:i}):console.error(`[wsemi ${r}] listener of '${String(t)}' threw:`,n)}catch(e){try{console.error(`[wsemi ${r}] listener of '${String(t)}' threw, and reporting it also threw:`,e,n)}catch(e){}}return!1}}function Bn(e,t,i=[],n={}){let s=n.ms;return $i(s)||(s=1),s=qi(s),s=Math.min(s,On),setTimeout(()=>{Hn(e,t,i,n)},s)}function Vn(e){try{let t=e();return"string"==typeof t?t:""}catch(e){return""}}function Qn(e,t){try{let i=new WeakSet,n=[],s=JSON.stringify(e,function(e,s){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.length>=t)return"[Deep]";if("bigint"==typeof s)return String(s);if(null!==s&&"object"==typeof s){if(i.has(s))return"[Circular]";i.add(s),n.push(s)}return s});return"string"==typeof s?s:""}catch(e){return""}}function Rn(e){if(e.length>=2&&'"'===e[0]&&'"'===e[e.length-1]){let t=Vn(()=>JSON.parse(e));if(""!==t)return t}return e}function Jn(e,t){if(void 0===e)return"";if(null===e)return"null";let i=function(e){let t=typeof e;return"string"===t?e:null==e?"":"number"===t||"boolean"===t||"bigint"===t||"symbol"===t?String(e):""}(e);if(""!==i)return i;let n=Qn(e,t);if(""!==n&&"{}"!==n)return Rn(n);let s=Vn(()=>String(e));return""!==s&&"[object Object]"!==s?s:n}function qn(e,t){let i=new WeakSet;null===e||"object"!=typeof e&&"function"!=typeof e||i.add(e);let n=e,s=[];for(let e=0;e<t.levelCauseMax;e++){let e=null;try{e=n.cause}catch(e){break}if(null==e)break;if("object"==typeof e||"function"==typeof e){if(i.has(e))break;i.add(e)}let r=es(e,{...t,useCause:!1,useAggregate:!1});""!==r&&s.push(r),n=e}return s.join(" <- ")}function $n(e,t){let i=null;try{i=e.errors}catch(e){return""}if(!Array.isArray(i)||0===i.length)return"";let n=[];for(let s=0;s<i.length&&s<t.levelCauseMax;s++){if(i[s]===e)continue;let r=es(i[s],{...t,useCause:!1,useAggregate:!1});""!==r&&n.push(r)}return n.join("; ")}function es(e,t){if("string"==typeof e)return e;if(null==e)return"";if("number"==typeof e)return Number.isNaN(e)?"":String(e);if("boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);let i=null,n=!1;try{i=e.message,n=!0}catch(e){n=!1}if(n&&"string"==typeof i){if(""!==i){let n=i;if(t.useCause){let i=qn(e,t);""!==i&&(n=`${n} <- ${i}`)}if(t.useAggregate){let i=$n(e,t);""!==i&&(n=`${n} [${i}]`)}return n}let n=qn(e,t);return""!==n?n:""}if(n){let e=Jn(i,t.levelJsonMax);if(""!==e)return e}let s=qn(e,t);if(""!==s)return s;if(t.useAggregate){let i=$n(e,t);if(""!==i)return i}let r=Qn(e,t.levelJsonMax),o=Rn(r);if(""!==o&&"{}"!==o)return o;let a=Vn(()=>String(e));if(""!==a&&"[object Object]"!==a)return a;let c=Vn(()=>Object.prototype.toString.call(e));return""!==c&&"[object Object]"!==c?c:""!==r?r:""}function ts(e,t={}){let i=Ae(t,"useCause",null);Oi(i)||(i=!1);let n=Ae(t,"useAggregate",null);Oi(n)||(n=!1);let s=Ae(t,"levelCauseMax",null);$i(s,{useLimitSafe:!0})||(s=8),s=qi(s);let r=Ae(t,"levelJsonMax",null);$i(r,{useLimitSafe:!0})||(r=6),r=qi(r);let o=Ae(t,"lengthMessageMax",null);$i(o,{useLimitSafe:!0})||(o=0),o=qi(o);let a={useCause:i,useAggregate:n,levelCauseMax:s,levelJsonMax:r,lengthMessageMax:o},c="";try{c=es(e,a)}catch(e){return c="",c}return Ni(c)?(a.lengthMessageMax>0&&c.length>a.lengthMessageMax&&(c=a.lengthMessageMax>3?c.slice(0,a.lengthMessageMax-3)+"...":c.slice(0,a.lengthMessageMax)),c):(c="",c)}function is(e){if(!(Ni(e)||Wi(e)||G(e)||function(e){return"[object BigInt]"===Object.prototype.toString.call(e)}(e)))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}var ns={exports:{}};var ss,rs={exports:{}},os=jn(Object.freeze({__proto__:null,default:{}}));function as(){return ss||(ss=1,function(e){var t;e.exports=(t=t||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==Nn&&Nn.crypto&&(i=Nn.crypto),!i)try{i=os}catch(e){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),r={},o=r.lib={},a=o.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=a.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,s=e.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++){var o=i[r>>>2]>>>24-r%4*8&255;t[n+r>>>2]|=o<<24-(n+r)%4*8}else for(var a=0;a<s;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new c.init(t,e)}}),l=r.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(i,t/2)}},p=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],s=0;s<i;s++){var r=t[s>>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(r))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(i,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,a=r/(4*o),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*l,r);if(l){for(var p=0;p<l;p+=o)this._doProcessBlock(s,p);i=s.splice(0,l),n.sigBytes-=u}return new c.init(i,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=r.algo={};return r}(Math),t)}(rs)),rs.exports}!function(e){e.exports=as().enc.Utf8}(ns);var cs=kn(ns.exports),ls={exports:{}};!function(e){var t;e.exports=(t=as(),function(){var e=t,i=e.lib.WordArray;function n(e,t,n){for(var s=[],r=0,o=0;o<t;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=a<<24-r%4*8,r++}return i.create(s,r)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var s=[],r=0;r<i;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<i;a++)s.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,i=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<i.length;r++)s[i.charCodeAt(r)]=r}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return n(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(ls);var us=kn(ls.exports);function ps(e,t){return!!Ti(e)&&(!(!Ni(t)&&!Wi(t))&&t in e)}function ds(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}function ms(e,t){var i;return(E(e)?ds:Ht)(e,"function"==typeof(i=t)?i:Ii)}function hs(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function fs(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function gs(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function ws(e){if(!(hs(e)||function(e){let t=Object.prototype.toString.call(e);if("[object Blob]"===t||"[object File]"===t)return!0;try{if("undefined"!=typeof Blob&&e instanceof Blob)return!0}catch(e){}return!1}(e)||fs(e)||gs(e)))return null;try{if(Wi(e.byteLength))return e.byteLength}catch(e){}try{if(Wi(e.length))return e.length}catch(e){}try{if(Wi(e.size))return e.size}catch(e){}return null}let Ms=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function ys(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:new Uint8Array;if(!Ni(e))return n("invalid str");if(!("function"==typeof e.isWellFormed?e.isWellFormed():!Ms.test(e)))return n("invalid str, contains lone surrogates");let s=null;try{s=(new TextEncoder).encode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function Ds(e,t,i=0,n=!0,s=52,r=8){return function(e,t,i,n,s,r){if(!Wi(e))return null;if(!fs(t))return null;if(!Bi(i))return null;if(!Oi(n))return null;if(!Bi(s))return null;if(!Bi(r))return null;let o,a,c;e=Hi(e);let l=8*r-s-1,u=(1<<l)-1,p=u>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?r-1:0,h=n?-1:1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(o++,c/=2),o+p>=u?(a=0,o=u):o+p>=1?(a=(e*c-1)*Math.pow(2,s),o+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;t[i+m]=255&a,m+=h,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;t[i+m]=255&o,m+=h,o/=256,l-=8);return t[i+m-h]|=128*f,null}(e,t,i,n,s,r)}function xs(e){let t=0;ms(e,e=>{t+=ws(e)});let i=new Uint8Array(t),n=0;return ms(e,e=>{let t=function(e){return hs(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0)}(e);i.set(t,n),n+=t.length}),i}function Ls(e,t={}){let i=[],n=new Uint8Array,s=Ae(t,"returnWithStateAndMsg",null);Oi(s)||(s=!1);let r=e=>s?{state:"error",msg:e}:new Uint8Array;if(!(o=e,en(o)&&o.length>=1||Ai(e)))return r("invalid data, data is not an effective object or a non-empty array");var o;let a=[],c=[];function l(e){a.push(ws(e)),c.push(e)}try{let t=function(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{results:"",binarys:[]};if(!Ti(e)&&!en(e))return n("invalid data, data is not an object or array");if(nn(e)||sn(e))return n("invalid data, data is an empty object or empty array");let s=/^(?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,r="",o=[];try{let t=-1;r=JSON.stringify(e,function(e,i){if(fs(i)){t+=1;let e=`[BlazeForUint8Array]::${t}`;return o.push(i),e}if(gs(i)){t+=1;let e=`[BlazeForUint16Array]::${t}`;return o.push(i),e}if(hs(i)){t+=1;let e=`[BlazeForArrayBuffer]::${t}`;return o.push(i),e}return fn(i)&&(i=i.toString()),Ni(i)&&91===i.charCodeAt(0)&&s.test(i)?"[BlazeForPreventEscape]"+i:i})}catch(e){return n(e.toString())}return i?{state:"success",msg:{results:r,binarys:o}}:{results:r,binarys:o}}(e,{returnWithStateAndMsg:!0});if("error"===t.state)return r(`obj2stru8arr: ${t.msg}`);let s=t.msg;l(ys(s.results)),ms(s.binarys,e=>{l(e)});let o=a,u=ys(JSON.stringify(o)),p=new Uint8Array(8);Ds(ws(u),p),i.push(p),i.push(u),ms(c,e=>{i.push(e)}),n=xs(i)}catch(e){return r(e.toString())}return s?{state:"success",msg:n}:n}function vs(e,t=0,i=!0,n=52,s=8){return function(e,t,i,n,s){if(!fs(e))return null;if(!Bi(t))return null;if(!Oi(i))return null;if(!Bi(n))return null;if(!Bi(s))return null;let r,o,a=8*s-n-1,c=(1<<a)-1,l=c>>1,u=-7,p=i?0:s-1,d=i?1:-1,m=e[t+p];for(p+=d,r=m&(1<<-u)-1,m>>=-u,u+=a;u>0;r=256*r+e[t+p],p+=d,u-=8);for(o=r&(1<<-u)-1,r>>=-u,u+=n;u>0;o=256*o+e[t+p],p+=d,u-=8);if(0===r)r=1-l;else{if(r===c)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,n),r-=l}return(m?-1:1)*o*Math.pow(2,r-n)}(e,t,i,n,s)}function Is(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!fs(e))return n("invalid u8a");let s="";try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function bs(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Ai(e))return n("invalid data");let s=null,r=null;try{s=e.results,r=e.binarys}catch(e){return n(e.toString())}if(!Ni(s))return n("invalid results");if(!en(r))return n("invalid binarys");let o=/^\[BlazeFor(Uint8Array|Uint16Array|ArrayBuffer)\]::(\d+)$/,a=/^\[BlazeForPreventEscape\](?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,c={};try{c=JSON.parse(s,function(e,t){if(!Ni(t)||91!==t.charCodeAt(0))return t;let i=o.exec(t);if(null===i)return a.test(t)?t.slice(23):t;let n=Number(i[2]);if(n>=r.length)throw new Error(`binary index out of range[${n}], binarys.length[${r.length}]`);return((e,t,i)=>{if("Uint16Array"===e&&!gs(i)){if(!fs(i))throw new Error(`binarys[${t}] can not be restored to Uint16Array`);if(i.byteLength%2!=0)throw new Error(`binarys[${t}] byteLength[${i.byteLength}] is not even, can not be restored to Uint16Array`);let e=0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i);return new Uint16Array(e.buffer)}if("ArrayBuffer"===e&&!hs(i)){if(!fs(i))throw new Error(`binarys[${t}] can not be restored to ArrayBuffer`);return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}return i})(i[1],n,r[n])})}catch(e){return n(e.toString())}return i?{state:"success",msg:c}:c}function Cs(e,t={}){let i={},n=Ae(t,"returnWithStateAndMsg",null);Oi(n)||(n=!1);let s=e=>n?{state:"error",msg:e}:{};if(!fs(e))return s("invalid u8a");try{let t=8,n=e.slice(0,t),r=e.slice(t,ws(e)),o=vs(n),a=r.slice(0,o),c=r.slice(o,ws(r)),l=Is(a,{returnWithStateAndMsg:!0});if("error"===l.state)return s(`u8arr2str: ${l.msg}`);let u=l.msg,p=function(e,t){let i=0,n=0,s=[];return ms(t,t=>{n=i+t;let r=e.slice(i,n);i=n,s.push(r)}),s}(c,JSON.parse(u)),d=Is(p.shift(),{returnWithStateAndMsg:!0});if("error"===d.state)return s(`u8arr2str: ${d.msg}`);let m=bs({results:d.msg,binarys:p},{returnWithStateAndMsg:!0});if("error"===m.state)return s(`stru8arr2obj: ${m.msg}`);i=m.msg}catch(e){return s(e.toString())}return n?{state:"success",msg:i}:i}function Es(e){return function(e,t={}){let i=Ae(t,"fs");if(!bn(e,{fs:i}))return{success:"file does not exist: "+e};if(!Tn(e,{fs:i}))return{error:"input path is not a file: "+e};try{i.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}function Ts(e){return Ni(e)&&e.length<=128&&/^[A-Za-z0-9]+$/.test(e)}let As={permission:200,param:200,app:200,output:200,packet:200,internal:200},Ss={main:{apiType:"main",api:"apiMain",authFrom:"header",statusOf:As},ulctr:{apiType:"upload-controller",api:"apiUploadCheck",authFrom:"header",statusOf:As},slc:{apiType:"upload-slice",api:"apiUploadSlice",authFrom:"header",statusOf:As},dwgfn:{apiType:"download-get-filename",api:"apiDownloadGetFilename",authFrom:"header",statusOf:As,fields:[{name:"streamRead"},{name:"filename"}]},dwgf:{apiType:"download-get-file",api:"apiDownloadGetFile",authFrom:"query",statusOf:{permission:403,param:400,app:404,output:500,packet:500,internal:500},fields:[{name:"streamRead"},{name:"fileSize"},{name:"fileType"},{name:"filename",optional:!0}]},dw:{apiType:"download",api:"apiDownload",authFrom:"header",statusOf:As,fields:[{name:"streamRead"},{name:"filename"},{name:"fileSize"},{name:"fileType"}]}};function Ns(e,t){var i=-1,n=$e(e)?Array(e.length):[];return Ht(e,function(e,s,r){n[++i]=t(e,s,r)}),n}function ks(e,t){return(E(e)?xe:Ns)(e,Ci(t))}function js(e,t,i){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(i=i>s?s:i)<0&&(i+=s),s=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(s);++n<s;)r[n]=e[n+t];return r}function Zs(e){return e!=e}function zs(e,t,i){return t==t?function(e,t,i){for(var n=i-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var s=e.length,r=i+(n?1:-1);n?r--:++r<s;)if(t(e[r],r,e))return r;return-1}(e,Zs,i)}var Ys="\\ud800-\\udfff",Xs="["+Ys+"]",Fs="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Us="\\ud83c[\\udffb-\\udfff]",Gs="[^"+Ys+"]",Ps="(?:\\ud83c[\\udde6-\\uddff]){2}",Ks="[\\ud800-\\udbff][\\udc00-\\udfff]",Os="(?:"+Fs+"|"+Us+")"+"?",_s="[\\ufe0e\\ufe0f]?",Ws=_s+Os+("(?:\\u200d(?:"+[Gs,Ps,Ks].join("|")+")"+_s+Os+")*"),Hs="(?:"+[Gs+Fs+"?",Fs,Ps,Ks,Xs].join("|")+")",Bs=RegExp(Us+"(?="+Us+")|"+Hs+Ws,"g");function Vs(e){return nt(e)?function(e){return e.match(Bs)||[]}(e):function(e){return e.split("")}(e)}function Qs(e,t,i){if((e=be(e))&&(i||void 0===t))return Zi(e);if(!e||!(t=Ie(t)))return e;var n=Vs(e),s=Vs(t),r=function(e,t){for(var i=-1,n=e.length;++i<n&&zs(t,e[i],0)>-1;);return i}(n,s),o=function(e,t){for(var i=e.length;i--&&zs(t,e[i],0)>-1;);return i}(n,s)+1;return function(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:js(e,t,i)}(n,r,o).join("")}function Rs(e,t){if(!Ni(e))return[];if(!Ni(t))return[];let i=function(e,t){return Ni(e)&&Ni(t)?e.split(t):[]}(e,t);i=ks(i,Qs);let n=[];return ms(i,function(e){Ni(e)&&n.push(e)}),n}const Js=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function qs(e,t={}){let i=Ae(t,"fs"),n=Ae(t,"chunkSize");if(Wi(n)||(n=67108864),n=Hi(n),!Tn(e,{fs:i}))return Promise.reject("fp is not a file");let s=Ln();try{let{create64:t}=await async function(){return function(e){const{exports:{mem:t,xxh32:i,xxh64:n,init32:s,update32:r,digest32:o,init64:a,update64:c,digest64:l}}=e;let u=new Uint8Array(t.buffer);function p(e,i){if(t.buffer.byteLength<e+i){const n=Math.ceil((e+i-t.buffer.byteLength)/65536);t.grow(n),u=new Uint8Array(t.buffer)}}function d(e,t,i,n,s,r){p(e);const o=new Uint8Array(e);return u.set(o),i(0,t),o.set(u.subarray(0,e)),{update(t){let i;return u.set(o),"string"==typeof t?(p(3*t.length,e),i=g.encodeInto(t,u.subarray(e)).written):(p(t.byteLength,e),u.set(t,e),i=t.byteLength),n(0,e,i),o.set(u.subarray(0,e)),this},digest:()=>(u.set(o),r(s(0)))}}function m(e){return e>>>0}const h=2n**64n-1n;function f(e){return e&h}const g=new TextEncoder;function w(e,t=0){return p(3*e.length,0),m(i(0,g.encodeInto(e,u).written,t))}function M(e,t=0n){return p(3*e.length,0),f(n(0,g.encodeInto(e,u).written,t))}return{h32:w,h32ToString:(e,t=0)=>w(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(p(e.byteLength,0),u.set(e),m(i(0,e.byteLength,t))),create32:(e=0)=>d(48,e,s,r,o,m),h64:M,h64ToString:(e,t=0n)=>M(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(p(e.byteLength,0),u.set(e),f(n(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,a,c,l,f)}}((await WebAssembly.instantiate(Js)).instance)}(),r=t(),o=i.createReadStream(e,{highWaterMark:n});o.on("data",e=>{r.update(e)}),o.on("end",()=>{let e=r.digest().toString(16).padStart(16,"0");s.resolve(e)}),o.on("error",s.reject)}catch(e){s.reject(e.toString())}return s}var $s={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcyB3b3JrZXLlhafkvb/nlKjnhKHms5XovYnora/nmoTljp/nlJ/lpZfku7bkvovlpoJmcywg6YG/5YWN5L2/55So6aCC5bGkaW1wb3J05Yqg6LyJ5L2/55SoLCDlm6DnhKHms5XovYnora/mnIPnm7TmjqXkv53nlZkKICAgICAgICAvL+S4puWboGltcG9ydOS9jeaWvHdvcmtlcuWkluWxpOmZkOWumueCunJlcXVpcmXljYAocGFja2FnZS5qc29u5LiN57WmdHlwZT1tb2R1bGUpLCDmlYXlh7rnj77pjK/oqqTnhKHms5XovYnora8KICAgICAgICAKCiJ1c2Ugc3RyaWN0Ijt2YXIgdD1yZXF1aXJlKCJwYXRoIiksZT1yZXF1aXJlKCJmcyIpLHI9cmVxdWlyZSgiZXZlbnRzIiksbj1BcnJheS5pc0FycmF5LGk9Im9iamVjdCI9PXR5cGVvZiBnbG9iY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aXQKICAgIGlmKG1vZGUgPT09ICdpbml0Jyl7CiAgICAgICAgCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy90eXBlCiAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YS50eXBlCgogICAgICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKICAgIAogICAgICAgICAgICAvL2luc3RhbmNlCiAgICAgICAgICAgIGlmKHR5cGUgPT09ICdmdW5jdGlvbicpewogICAgICAgICAgICAgICAgaW5pdCguLi5pbnB1dCkKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmKHR5cGUgPT09ICdvYmplY3QnKXsKICAgICAgICAgICAgICAgIGluc3RhbmNlID0gbWVyZ2VTbGljZXMKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAKICAgICAgICAgICAgLy9zZW5kTWVzc2FnZQogICAgICAgICAgICBsZXQgcmVzID0gewogICAgICAgICAgICAgICAgbW9kZTogJ2VtaXQnLAogICAgICAgICAgICAgICAgZXZOYW1lOiAnZXJyb3InLAogICAgICAgICAgICAgICAgbXNnOiBlcnIsCiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VuZE1lc3NhZ2UocmVzKQoKICAgICAgICB9CiAgICAgICAgICAgIAogICAgfQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgPT09ICdjYWxsJyl7CiAgICAgICAgbGV0IHN0YXRlID0gJycKICAgICAgICBsZXQgbXNnID0gbnVsbAoKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL2Z1bgogICAgICAgICAgICBsZXQgZnVuID0gaW5zdGFuY2VbZGF0YS5mdW5dCgogICAgICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKCiAgICAgICAgICAgIC8vZXhlYwogICAgICAgICAgICBhd2FpdCBmdW4oLi4uaW5wdXQpCiAgICAgICAgICAgICAgICAudGhlbigoc3VjKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU9J3N1Y2Nlc3MnCiAgICAgICAgICAgICAgICAgICAgbXNnPXN1YwogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIC5jYXRjaCgoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgc3RhdGU9J2Vycm9yJwogICAgICAgICAgICAgICAgICAgIG1zZz1lcnIKICAgICAgICAgICAgICAgIH0pCgogICAgICAgIH0KICAgICAgICBjYXRjaChlcnIpewogICAgICAgICAgICBzdGF0ZSA9ICdlcnJvcicKICAgICAgICAgICAgbXNnID0gZXJyCiAgICAgICAgfQogICAgICAgIAogICAgICAgIC8vc2VuZE1lc3NhZ2UKICAgICAgICBsZXQgcmVzID0gewogICAgICAgICAgICBtb2RlOiAncmV0dXJuJywKICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgIGZ1bjogZGF0YS5mdW4sCiAgICAgICAgICAgIHN0YXRlLAogICAgICAgICAgICBtc2csCiAgICAgICAgfQogICAgICAgIHNlbmRNZXNzYWdlKHJlcykKCiAgICB9Cgp9CgpmdW5jdGlvbiByZWN2TWVzc2FnZShkYXRhKSB7CiAgICAvLyBjb25zb2xlLmxvZygnaW5uZXIgd29ya2VyIHJlY3Y6JywgZGF0YSkKCiAgICAvL2RhdGFSZWN2CiAgICBsZXQgZGF0YVJlY3YgPSBkYXRhCgogICAgLy9ydW4KICAgIHJ1bihkYXRhUmVjdikKCn0KCgogICAgICAgIHBhcmVudFBvcnQub24oJ21lc3NhZ2UnLCByZWN2TWVzc2FnZSkKICAgICAgICAKCnRyeXsKCiAgICAvL+WDheS7pXVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcuiomOmMhCwg5LiN5Y+v6Ki75YaKdW5jYXVnaHRFeGNlcHRpb27oiId1bmhhbmRsZWRSZWplY3Rpb27nm6Pogb06CiAgICAvL+aWvHdvcmtlcuWFp+iou+WGiuatpOS6jOebo+iBveacg+mYu+atok5vZGXpoJDoqK3nmoR3b3JrZXLntYLmraLooYzngrosIOS9v3dvcmtlcuW0qea9sOW+jOS7jeWtmOa0u+epuui9iSwKICAgIC8v5aSW5bGk5pS25LiN5YiwZXJyb3IvZXhpdOS6i+S7tiwgcGVuZGluZyBwcm9taXNl5rC45LmF5oe4572uLCDkuJTlrZjmtLvmrq3lsY13b3JrZXLmnIPku6Tlrr/kuLvnqIvluo/nhKHms5XpgIDlh7o7CiAgICAvL+enu+mZpOW+jHdvcmtlcuS+nemgkOioreihjOeCuuatu+S6oSwgZXJyb3Lkuovku7blgrPoh7PlpJblsaQsIOeUseWkluWxpOaVtOaJuXJlamVjdCBwZW5kaW5nCiAgICAvLyBwcm9jZXNzLm9uKCd1bmhhbmRsZWRSZWplY3Rpb24nLCAoZXJyKSA9PiB7CiAgICAvLyAgICAgY29uc29sZS5sb2coJ2lubmVyOnVuaGFuZGxlZFJlamVjdGlvbicsIGVycikKICAgIC8vIH0pCiAgICAvLyBwcm9jZXNzLm9uKCd1bmNhdWdodEV4Y2VwdGlvbicsIChlcnIpID0+IHsKICAgIC8vICAgICBjb25zb2xlLmxvZygnaW5uZXI6dW5jYXVnaHRFeGNlcHRpb24nLCBlcnIpCiAgICAvLyB9KQogICAgcHJvY2Vzcy5vbigndW5jYXVnaHRFeGNlcHRpb25Nb25pdG9yJywgKGVycikgPT4gewogICAgICAgIGNvbnNvbGUubG9nKCdpbm5lcjp1bmNhdWdodEV4Y2VwdGlvbk1vbml0b3InLCBlcnIpCiAgICB9KQoKfQpjYXRjaChlcnIpe30KCg==",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}($s);var er=kn($s.exports);let tr=new Set,ir=new Map,nr=(t,i,n="")=>{let s=e.resolve(i,t);return{fp:s,fpm:`${s}.merging`,fpd:`${s}.done`,fpe:`${s}.error`,fpr:Ni(n)?`${s}.q${n}.ro`:""}},sr=e=>{let t=Es(e);if(An(e))throw new Error(`can not remove ${e}: ${ts(Ae(t,"error"))}`)},rr=async(e,i)=>{tr.add(i.fp);try{let n=await function(e,i={}){return qs(e,{fs:t,...i})}(i.fp);if(n===e)return t.writeFileSync(i.fpd,"","utf8"),{state:"done"};let s=`merged file[${i.fp}] is incomplete: hash[${n}] != fileHash[${e}], merge was interrupted`;try{t.writeFileSync(i.fpe,s,"utf8")}catch(e){console.log(`can not write ${i.fpe}`,e)}return{state:"mismatch",reason:s}}catch(e){return{state:"error",reason:`verify merged file[${i.fp}] error: ${ts(e)}`}}finally{tr.delete(i.fp)}},or=async(e,i,n)=>{let s=`${function(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYYMMDDHHmmss")}()}|${Un(6)}|${e}`,r=nr(e,n);if(tr.has(r.fp))return s;let o=An(r.fpe),a=An(r.fp);if(!o&&a){let t=await rr(e,r);if("done"===t.state)return s;if("error"===t.state)throw new Error(t.reason)}return sr(r.fpd),sr(r.fpe),tr.add(r.fp),setTimeout(()=>{er(e,i,n,r.fpm).then(i=>{let n=Ae(i,"hash","");if(n!==e)throw new Error(`merged file hash[${n}] != fileHash[${e}]`);t.renameSync(r.fpm,r.fp),t.writeFileSync(r.fpd,"","utf8")}).catch(e=>{console.log(e),Es(r.fpm);let i=ts(e);try{t.writeFileSync(r.fpe,i,"utf8")}catch(e){console.log(`can not write ${r.fpe}`,e)}}).finally(()=>{tr.delete(r.fp)})},1),s},ar=async(e,i,n={})=>{let s=Ae(n,"funConsume"),r=Ae(n,"funLog");wn(r)||(r=e=>{console.log(e)});let o=Rs(e,"|"),a=Ae(o,0,""),c=Ae(o,1,""),l=Ae(o,2,"");if(3!==wt(o)||!Ts(a)||!Ts(c)||!Ts(l)){let t=`invalid queueId[${ts(e)}]`;return console.log(t),{state:"error",msg:"invalid queueId",reason:t,path:""}}let u=nr(l,i,`${a}${c}`);if(An(u.fpr)){let e=((e,i)=>{try{let n=Cs(new Uint8Array(t.readFileSync(e.fpr)),{returnWithStateAndMsg:!0});if("success"!==Ae(n,"state"))return i(`stored result ${e.fpr} is corrupted, treat as not stored: ${Ae(n,"msg","unknown error")}`),{ok:!1};let s=n.msg;return Ti(s)&&ps(s,"ro")?{ok:!0,ro:s.ro}:(i(`stored result ${e.fpr} has no own 'ro' key, treat as not stored`),{ok:!1})}catch(t){return i(`can not read stored result ${e.fpr}: ${ts(t)}`),{ok:!1}}})(u,r);if(e.ok)return{state:"success",msg:e.ro,path:u.fp,from:"stored"}}if(An(u.fpe)){let e="";try{e=t.readFileSync(u.fpe,"utf8")}catch(e){}return{state:"error",msg:"merge slices failed",reason:e,path:u.fp}}if(tr.has(u.fp))return{state:"merging",msg:"",path:u.fp};let p=An(u.fp),d=An(u.fpd);if(p&&!d){let e=await rr(l,u);if("done"!==e.state)return{state:"error",msg:"merge slices failed",reason:e.reason,path:u.fp};d=!0}if(p&&d){if(!wn(s))return{state:"success",msg:"",path:u.fp};let i=await((e,i,n,s)=>{let r=ir.get(e);return r||(r=Promise.resolve().then(()=>n(i.fp)).then(e=>{e=void 0===e?null:e;try{let n=Ls({ro:e},{returnWithStateAndMsg:!0});if("success"!==Ae(n,"state"))return e;t.writeFileSync(i.fpr,Buffer.from(n.msg));let s=Cs(n.msg,{returnWithStateAndMsg:!0});if("success"===Ae(s,"state")&&Ti(s.msg)&&ps(s.msg,"ro"))return s.msg.ro}catch(e){s(`can not store consumed result to ${i.fpr}: ${ts(e)}`)}return e}).finally(()=>{ir.delete(e)}),ir.set(e,r),r)})(e,u,s,r);return{state:"success",msg:i,path:u.fp,from:"consumed"}}return!p&&d?{state:"error",msg:"merged file already consumed",reason:`merged file[${u.fp}] no longer exists and no stored result for queueId[${e}]`,path:u.fp}:{state:"error",msg:"no merge task",reason:`no merge task for fileHash[${l}] (never pushed, or artifacts removed)`,path:u.fp}};var cr={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcyB3b3JrZXLlhafkvb/nlKjnhKHms5XovYnora/nmoTljp/nlJ/lpZfku7bkvovlpoJmcywg6YG/5YWN5L2/55So6aCC5bGkaW1wb3J05Yqg6LyJ5L2/55SoLCDlm6DnhKHms5XovYnora/mnIPnm7TmjqXkv53nlZkKICAgICAgICAvL+S4puWboGltcG9ydOS9jeaWvHdvcmtlcuWkluWxpOmZkOWumueCunJlcXVpcmXljYAocGFja2FnZS5qc29u5LiN57WmdHlwZT1tb2R1bGUpLCDmlYXlh7rnj77pjK/oqqTnhKHms5XovYnora8KICAgICAgICAKCiJ1c2Ugc3RyaWN0Ijt2YXIgdD1yZXF1aXJlKCJwYXRoIiksZT1yZXF1aXJlKCJmcyIpO2Z1bmN0aW9uIHIodCxlKXtmb3IodmFyIHI9LTEsbj1udWxsPT10PzA6dC5sZW5ndGg7KytyPG4mJiExIT09ZSh0W3JdLHIsdCk7KTtyZXR1cm4gdH12YXIgbixvPWZ1bmN0aW9uK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pLGF9KSl9bGV0IGw9ZWUocyk+MDtyZXR1cm57cGF0aDppLGJBbGxFeGlzdDphLGJBbGxTaXplOmMsYkFsbEhhc2g6ZixiU2xzOmwsc2xrczpzfX07CgoKbGV0IGluc3RhbmNlID0gbnVsbApmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBjaGVja1RvdGFsSGFzaAogICAgICAgIH0KICAgICAgICAKCiAgICAvL29uCiAgICAKCiAgICAvL3NhdmUKICAgIGluc3RhbmNlID0gcgoKfQoKZnVuY3Rpb24gc2VuZE1lc3NhZ2UoZGF0YSkgewogICAgCiAgICAgICAgcGFyZW50UG9ydC5wb3N0TWVzc2FnZShkYXRhKQogICAgICAgIAp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBjaGVja1RvdGFsSGFzaAogICAgICAgICAgICB9CgogICAgICAgIH0KICAgICAgICBjYXRjaChlcnIpewogICAgICAgIAogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMpCgogICAgICAgIH0KICAgICAgICAgICAgCiAgICB9CgogICAgLy9jaGVjawogICAgaWYobW9kZSA9PT0gJ2NhbGwnKXsKICAgICAgICBsZXQgc3RhdGUgPSAnJwogICAgICAgIGxldCBtc2cgPSBudWxsCgogICAgICAgIHRyeXsKCiAgICAgICAgICAgIC8vZnVuCiAgICAgICAgICAgIGxldCBmdW4gPSBpbnN0YW5jZVtkYXRhLmZ1bl0KCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAoKICAgICAgICAgICAgLy9leGVjCiAgICAgICAgICAgIGF3YWl0IGZ1biguLi5pbnB1dCkKICAgICAgICAgICAgICAgIC50aGVuKChzdWMpID0+IHsKICAgICAgICAgICAgICAgICAgICBzdGF0ZT0nc3VjY2VzcycKICAgICAgICAgICAgICAgICAgICBtc2c9c3VjCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgLmNhdGNoKChlcnIpID0+IHsKICAgICAgICAgICAgICAgICAgICBzdGF0ZT0nZXJyb3InCiAgICAgICAgICAgICAgICAgICAgbXNnPWVycgogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgfQogICAgICAgIGNhdGNoKGVycil7CiAgICAgICAgICAgIHN0YXRlID0gJ2Vycm9yJwogICAgICAgICAgICBtc2cgPSBlcnIKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgLy9z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bmcKICAgIC8vIHByb2Nlc3Mub24oJ3VuaGFuZGxlZFJlamVjdGlvbicsIChlcnIpID0+IHsKICAgIC8vICAgICBjb25zb2xlLmxvZygnaW5uZXI6dW5oYW5kbGVkUmVqZWN0aW9uJywgZXJyKQogICAgLy8gfSkKICAgIC8vIHByb2Nlc3Mub24oJ3VuY2F1Z2h0RXhjZXB0aW9uJywgKGVycikgPT4gewogICAgLy8gICAgIGNvbnNvbGUubG9nKCdpbm5lcjp1bmNhdWdodEV4Y2VwdGlvbicsIGVycikKICAgIC8vIH0pCiAgICBwcm9jZXNzLm9uKCd1bmNhdWdodEV4Y2VwdGlvbk1vbml0b3InLCAoZXJyKSA9PiB7CiAgICAgICAgY29uc29sZS5sb2coJ2lubmVyOnVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcicsIGVycikKICAgIH0pCgp9CmNhdGNoKGVycil7fQoK",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(cr);var lr=kn(cr.exports),ur={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,s,r,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,r),!0;case 6:return u.fn.call(u.context,t,n,s,r,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,s);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,s){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==t||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||s&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(s="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6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Vja1NsaWNlc0hhc2gKICAgICAgICB9CiAgICAgICAgCgogICAgLy9vbgogICAgCgogICAgLy9zYXZlCiAgICBpbnN0YW5jZSA9IHIKCn0KCmZ1bmN0aW9uIHNlbmRNZXNzYWdlKGRhdGEpIHsKICAgIAogICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YSkKICAgICAgICAKfQoKYXN5bmMgZnVuY3Rpb24gcnVuKGRhdGEpIHsKICAgIC8vIGNvbnNvbGUubG9nKCdpbm5lciB3b3JrZXIgcnVuJyxkYXRhKQoKICAgIC8vbW9kZQogICAgbGV0IG1vZGUgPSBkYXRhLm1vZGUKCiAgICAvL2NoZWNrCiAgICBpZihtb2RlICE9PSAnaW5pdCcgJiYgbW9kZSAhPT0gJ2NhbGwnKXsKICAgICAgICByZXR1cm4KICAgIH0KCiAgICAvL2luaXQKICAgIGlmKG1vZGUgPT09ICdpbml0Jyl7CiAgICAgICAgCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy90eXBlCiAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YS50eXBlCgogICAgICAgICAgICAvL2lucHV0CiAgICAgICAgICAgIGxldCBpbnB1dCA9IGRhdGEuaW5wdXQKICAgIAogICAgICAgICAgICAvL2luc3RhbmNlCiAgICAgICAgICAgIGlmKHR5cGUgPT09ICdmdW5jdGlvbicpewogICAgICAgICAgICAgICAgaW5pdCguLi5pbnB1dCkKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmKHR5cGUgPT09ICdvYmplY3QnKXsKICAgICAgICAgICAgICAgIGluc3RhbmNlID0gY2hlY2tTbGljZXNIYXNoCiAgICAgICAgICAgIH0KCiAgICAgICAgfQogICAgICAgIGNhdGNoKGVycil7CiAgICAgICAgCiAgICAgICAgICAgIC8vc2VuZE1lc3NhZ2UKICAgICAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdlbWl0JywKICAgICAgICAgICAgICAgIGV2TmFtZTogJ2Vycm9yJywKICAgICAgICAgICAgICAgIG1zZzogZXJyLAogICAgICAgICAgICB9CiAgICAgICAgICAgIHNlbmRNZXNzYWdlKHJlcykKCiAgICAgICAgfQogICAgICAgICAgICAKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9mdW4KICAgICAgICAgICAgbGV0IGZ1biA9IGluc3RhbmNlW2RhdGEuZnVuXQoKICAgICAgICAgICAgLy9pbnB1dAogICAgICAgICAgICBsZXQgaW5wdXQgPSBkYXRhLmlucHV0CgogICAgICAgICAgICAvL2V4ZWMKICAgICAgICAgICAgYXdhaXQgZnVuKC4uLmlucHV0KQogICAgICAgICAgICAgICAgLnRoZW4oKHN1YykgPT4gewogICAgICAgICAgICAgICAgICAgIHN0YXRlPSdzdWNjZXNzJwogICAgICAgICAgICAgICAgICAgIG1zZz1zdWMKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycikgPT4gewogICAgICAgICAgICAgICAgICAgIHN0YXRlPSdlcnJvcicKICAgICAgICAgICAgICAgICAgICBtc2c9ZXJyCiAgICAgICAgICAgICAgICB9KQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KICAgICAgICAKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXM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AgICAvLyAgICAgY29uc29sZS5sb2coJ2lubmVyOnVuY2F1Z2h0RXhjZXB0aW9uJywgZXJyKQogICAgLy8gfSkKICAgIHByb2Nlc3Mub24oJ3VuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcicsIChlcnIpID0+IHsKICAgICAgICBjb25zb2xlLmxvZygnaW5uZXI6dW5jYXVnaHRFeGNlcHRpb25Nb25pdG9yJywgZXJyKQogICAgfSkKCn0KY2F0Y2goZXJyKXt9Cgo=",Buffer.from(s,"base64").toString("utf8"));var s;function r(){let n=new i,s={},r=!1,o=!1;function a(e){for(let t in s){let i=s[t];delete s[t],n.removeAllListeners(t),i.reject(e)}n.emit("error",e)}function c(e){r||(r=!0,a(e))}let l=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){c(e)}}(t);if(!l)return c("invalid worker"),null;function u(){let e=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(r)return e.reject("worker is dead"),e;let t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let s=0;s<e;s++)t[s]=i[0|Math.random()*n];return t.join("")}();s[t]=e;let i={mode:"call",id:t,fun:"main",input:[...arguments]};return l.postMessage(i),n.once(t,i=>{delete s[t],"success"===i.state?e.resolve(i.msg):e.reject(i.msg)}),e}return l.on("message",function(e){let t=e,i=t.mode;"emit"!==i&&"return"!==i||("emit"===i&&n.emit(t.evName,t.msg),"return"===i&&n.emit(t.id,t))}),l.on("error",c),l.on("exit",e=>{o||c("worker exit, code["+e+"]")}),function(){let e={mode:"init",type:"function",input:[...arguments]};l.postMessage(e)}([...arguments]),n.main=u,n.main=u,n.terminate=function(){l?(o=!0,l.terminate(),l=void 0):a("worker has been terminated")},n}n=async function(){let e=[...arguments],t=r();return await t.main(...e).finally(()=>{t.terminate()})}}();try{process.on("uncaughtExceptionMonitor",e=>{console.log("outer:uncaughtExceptionMonitor",e)})}catch(e){}return n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(ur);var pr=kn(ur.exports);function dr(e,t){try{return{ok:!0,value:t()}}catch(t){let i=ts(t);return{ok:!1,stage:e,cause:Ni(i)?i:"unknown error"}}}function mr(e,t){try{return r.validateHeaderValue(e,t),!0}catch(e){return!1}}function hr(e,t,i,n={}){let r=!0===Ae(n,"forHead",!1);if(null==e)return{error:"invalid streamRead",reason:"streamRead is null or undefined"};let o=dr("identify streamRead",()=>e instanceof s.Readable?{isReadable:!0,objectMode:!0===e.readableObjectMode,done:!0===e.destroyed||!0===e.readableEnded}:{isReadable:!1});if(!o.ok)return{error:"invalid streamRead",reason:`${o.stage} failed: ${o.cause}`};if(o.value.isReadable){if(o.value.objectMode)return{error:"invalid streamRead",reason:"streamRead is in object mode"};if(o.value.done)return{error:"invalid streamRead",reason:"streamRead is already destroyed or ended (each download event must provide a new stream)"};if(r)return{source:e};let n=dr("setup pipeline",()=>{let n=0,r=!1,o=new s.Transform({transform(e,i,s){if(n+=e.length,n>t)return r=!0,void s(new Error(`streamRead sent more than fileSize[${t}] bytes`));s(null,e)},flush(e){if(n!==t)return r=!0,void e(new Error(`streamRead ended at ${n} bytes but fileSize is ${t}`));e()}});return s.pipeline(e,o,e=>{e&&r&&i(ts(e))}),o});return n.ok?{source:n.value}:{error:"invalid streamRead",reason:`${n.stage} failed: ${n.cause}`}}let a=dr("materialize streamRead",()=>{if(Buffer.isBuffer(e))return{buf:e};if(e instanceof Uint8Array)return{buf:Buffer.from(e)};if(Si(e))return{buf:Buffer.from(e,"utf8")};if("number"==typeof e||Oi(e)||"object"==typeof e&&!1===function(e){try{return wn(e.pipe)}catch(e){return null}}(e)){let t=null;try{t=JSON.stringify(e)}catch(e){return{unserializable:ts(e)}}return"string"!=typeof t?{unserializable:""}:{buf:Buffer.from(t,"utf8")}}return{unsupported:!0}});if(!a.ok)return{error:"invalid streamRead",reason:`${a.stage} failed: ${a.cause}`};if(ps(a.value,"unserializable")){let e=a.value.unserializable;return{error:"invalid streamRead",reason:Ni(e)?`streamRead can not be serialized: ${e}`:"streamRead can not be serialized"}}if(!0===a.value.unsupported)return{error:"invalid streamRead",reason:"streamRead must be a readable stream, buffer, string, number, boolean or plain object"};let c=a.value.buf;return c.length!==t?{error:"fileSize mismatch",reason:`streamRead has ${c.length} bytes but fileSize is ${t}`}:{source:c}}let fr=e=>"function"==typeof e.toWellFormed?e.toWellFormed():e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�");function gr(e,t){let i=dr(`check field[${e}]`,()=>{if("fileSize"===e)return function(e){return Mn(e,{useLimitSafe:!0})}(t)?{ok:!0,value:qi(t)}:{ok:!1};if("filename"===e||"fileType"===e){if(!Ni(t))return{ok:!1};let i=is(t);return Ni(i)?"fileType"===e?mr("Content-Type",i)?{ok:!0,value:i}:{ok:!1}:{ok:!0,value:fr(i)}:{ok:!1}}throw new Error(`unknown field[${e}]`)});return i.ok?{ok:i.value.ok,value:i.value.value,cause:""}:{ok:!1,value:void 0,cause:i.cause}}function wr(e){try{e&&wn(e.pipe)&&wn(e.destroy)&&e.destroy()}catch(e){}}function Mr(e){return void 0===e||wn(e)||"symbol"==typeof e?null:e}function yr(e,t,i={}){let n=new s.Readable;n._read=()=>{},n.push(t),n.push(null);let r=Ae(i,"returnType",""),o=Ae(i,"returnMsg",""),a=e.response(n).header("Cache-Control","no-cache, no-store, must-revalidate").header("Content-Type","application/octet-stream").header("Content-Length",n.readableLength);return Ni(r)&&a.header("Return-Type",r),Ni(o)&&mr("Return-Msg",o)&&a.header("Return-Msg",o),a}function Dr(r={}){let o={useLimitSafe:!0},a=Ae(r,"port");(!$i(a,o)||qi(a)>65535)&&(a=8080),a=qi(a);let c=Ae(r,"useInert");Oi(c)||(c=!0);let l=Ae(r,"pathStaticFiles");Ni(l)||(l="dist");let u=Ae(r,"pathUploadTemp");Ni(u)||(u="./uploadTemp");let p="";if(!En(u)){let e=Wn(u);ps(e,"error")&&(p=ts(e.error))}let d=Ae(r,"apiName");Ni(d)||(d="api");let m=Ae(r,"tokenType");Ni(m)||(m="Bearer");let h=Ae(r,"sizeSlice");$i(h,o)||(h=1048576),h=qi(h);let f=Ae(r,"sizeMsg");$i(f,o)||(f=104857600),f=qi(f);let g=Ae(r,"verifyConn");wn(g)||(g=()=>!0);let w=Ae(r,"corsOrigins",[]);on(w)||(w=["*"]);let M=Ae(r,"delayForSlice","");(!Mn(M,o)||qi(M)>2147483647)&&(M=100),M=qi(M);let y=null;y=Ae(r,"serverHapi")?r.serverHapi:i.server({port:a,routes:{timeout:{server:!1,socket:!1},cors:{origin:w,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}}});let D=Kn(),x={tag:"w-converhp"},L=(e,...t)=>Hn(D,e,t,{...x,funSettle:()=>{let i=t[t.length-1];vn(i)&&i.reject(`listener of event[${e}] error`)},funEmit:I}),v=(e,...t)=>Bn(D,e,t,{...x,funEmit:I});function I(e,...t){if("error"===e&&Ai(t[0])&&"listener"===t[0].fun){let e=Ae(t[0],"name",""),i=Ae(t[0],"msg");return console.log(`listener of event[${e}] error`,i),D.emit("error",`listener of event[${e}] error: ${ts(i)}`)}return D.emit(e,...t)}Ni(p)&&v("error",`create pathUploadTemp[${u}] error: ${p}`);let b=(e,t,i)=>{let n=Ln(),s=Ln();return s.then(t=>{void 0===t&&(t=null);let s=typeof t;if("function"===s||"symbol"===s)return n.reject("output can not be serialized"),void L("error",`event[${e}] output can not be serialized: output is a ${s}`);n.resolve(wn(i)?i(t):t)}).catch(e=>{n.reject(e)}),function(e,t,i,n,s,r){if(0===e.listenerCount(i)){let e=`no listener for event[${i}]`;return s.reject(e),r(e),!1}t(i,...n,s)}(D,L,e,t,s,e=>{L("error",e)}),n};async function C(e){return b("upload",[e])}async function E(e){return b("download",[e])}let T=`${is(m)} `,A=(e,t)=>{let i=Ae(e,"headers");i=Ai(i)?i:"";let n=Ae(e,"query");n=Ai(n)?n:"";let s="",r="";return"query"===t.authFrom?(r=Ae(n,"token",""),r=Ni(r)?r:"",Ni(r)&&(s=`${m} ${r}`)):(s=Ae(i,"authorization",""),s=Ni(s)?s:"",r=s.startsWith(T)?s.slice(T.length):""),{headers:i,query:n,authorization:s,token:r}},S=(e,t)=>{let i=(i,n,s)=>function(e,t,i={}){Ni(t)||(console.log("msg",t),console.log("msg is not an effective string, set msg=''"),t="");let n=Ae(i,"retryable",!0),s={error:t};!1===n&&(s.retryable=!1);let r=yr(e,Ls(s),{returnType:"error",returnMsg:t});return!1===n&&r.header("Return-Retryable","false"),r}(e,n,s).code(t.statusOf[i]);return{permission:()=>i("permission","permission denied"),param:e=>i("param",e,{retryable:!1}),app:e=>i("app",e),output:e=>i("output",e),packet:e=>i("packet",e),internal:e=>i("internal",e)}},N=async(e,t,i,n)=>!0!==await async function(e){let t=!1;try{t=g(e),vn(t)&&(t=await t)}catch(i){t=!1,console.log(`verifyConn error for apiType[${Ae(e,"apiType","")}]`,i),L("error",`verifyConn error for apiType[${Ae(e,"apiType","")}]: ${ts(i)}`)}return!0===t}({apiType:i.apiType,authorization:t.authorization,query:t.query,headers:t.headers,req:e})?n.permission():(L("handler",{api:i.api,headers:t.headers,query:t.query}),null),k=(e,t,i,n)=>{let s=function(e,t){let i={};for(let n of t){let t=dr(`read field[${n}]`,()=>Ae(e,n));if(!t.ok)return{ok:!1,field:n,cause:t.cause,fields:i};i[n]=t.value}return{ok:!0,fields:i}}(e,i.fields.map(e=>e.name));if(!s.ok)return wr(Ae(s.fields,"streamRead")),L("error",`download fileId[${t}] output error: can not read field[${s.field}]: ${s.cause}`),{ok:!1,res:n.output("invalid streamRead")};let r={streamRead:s.fields.streamRead};for(let e of i.fields){if("streamRead"===e.name)continue;let i=gr(e.name,s.fields[e.name]);if(i.ok){r[e.name]=i.value;continue}if(!0===e.optional&&!Ni(i.cause)){r[e.name]="";continue}wr(r.streamRead);let o="fileSize"===e.name?`[${ts(s.fields.fileSize)}]`:"";return L("error",`download fileId[${t}] output error: invalid ${e.name}${o}${Ni(i.cause)?`: ${i.cause}`:""}`),{ok:!1,res:n.output(`invalid ${e.name}`)}}return{ok:!0,v:r}},j=async(e,t,i,n)=>{let s={},r="";await i.then(e=>{s.success=e,r="success"}).catch(e=>{s.error=e,r="error"});let o=function(e,t){let i={};for(let t of Object.keys(e))i[t]=Mr(e[t]);let n=Ls(i,{returnWithStateAndMsg:!0});return"success"!==Ae(n,"state")?(t(Ae(n,"msg","unknown error")),null):n.msg}(s,e=>{L("error",`${n} output can not be serialized: ${e}`)});return null===o?t.internal("output can not be serialized"):yr(e,o,{returnType:r,returnMsg:"need to parse"})},Z=e=>(t,i,n)=>{if(413===Ae(n,"output.statusCode"))throw n;return L("error",`invalid request packet for ${e.api}: ${ts(n)}`),S(i,e).packet("invalid request packet").takeover()},z={path:`/${d}/main`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.main,n=S(t,i),r=A(e,i),o=await N(e,r,i,n);if(o)return o;let a=null;try{a=await(()=>{let t=Ln(),i=[],n=0,r=!1,o=new s.Writable({write(e,t,s){if(n+=e.length,n>f)return i=[],r=!0,void s();i.push(e),s()}});return o.on("finish",()=>{}),e.payload.pipe(o),e.payload.on("end",()=>{if(r)return void t.reject("payload too large");let e=Buffer.concat(i);i=[],t.resolve(e)}),e.payload.on("close",()=>{}),e.payload.on("error",e=>{console.log("apiMain req.payload err",e),L("error",`receive payload error: ${ts(e)}`),t.reject(`receive payload error: ${ts(e)}`)}),t})()}catch(e){if("payload too large"===e)return t.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${f}`}).code(413);throw e}let c=Cs(new Uint8Array(a),{returnWithStateAndMsg:!0});if("success"!==Ae(c,"state")||!Ai(c.msg)){let e=ts(Ae(c,"msg",""));return L("error",`invalid request packet for apiMain: ${Ni(e)?e:"not an effective object"}`),n.packet("invalid request packet")}let l=c.msg;return j(t,n,async function(e){return b("execute",[Ae(e,"func",""),Ae(e,"input",null)],t=>(e.output=t,delete e.input,e))}(l),`execute func[${ts(Ae(l,"func",""))}]`)}},Y={path:`/${d}/ulctr`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.ulctr)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.ulctr,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.mode","");if("check-total-hash"!==o&&"check-slices-hash"!==o&&"merge-slices-push"!==o&&"merge-slices-get"!==o)return n.param(`invalid mode[${ts(o)}] in payload`);let a=Ae(e,"payload.fileHash","");if(!Ts(a))return n.param("invalid fileHash in payload");let c=Ae(e,"payload.chunkTotal","");if("merge-slices-push"===o){if(!$i(c))return n.param("invalid chunkTotal in payload");c=qi(c)}let l=Ae(e,"payload.filename",""),p=function(e,t="unknown"){if(!Ni(e))return t;let i=e.replace(/\\/g,"/").split("/").filter(e=>""!==e&&"."!==e&&".."!==e).pop()||"";return i=i.replace(/[\x00-\x1f\x7f<>:"|?*]/g,"_"),i=i.replace(/[. ]+$/g,""),/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i.test(i)&&(i=`_${i}`),""===i?t:i}(l,""),d=e=>Ai(e)&&ps(e,"error")?`${o}: ${is(e.error)}`:"",m=async(e,t)=>{try{return await t()}catch(t){return L("error",`upload-controller mode[${o}] ${e} error: ${ts(t)}`),Promise.reject(`${o} failed`)}};return j(t,n,(async()=>{let t=null;if("check-total-hash"===o){let i=Ae(e,"payload.fileSize","");t=await m("check total hash",()=>lr(i,h,a,u));let n=d(t);if(Ni(n))return Promise.reject(n);if(t.bAllHash){let e={from:"check-total-hash",filename:l,filenameSafe:p,path:t.path},i=await C(e);t={...t,msg:i}}delete t.path,t.sizeSlice=h}else if("check-slices-hash"===o){let i=Ae(e,"payload.fileSliceHashs",[]);t=await m("check slices hash",()=>pr(i,a,u));let n=d(t);if(Ni(n))return Promise.reject(n)}else if("merge-slices-push"===o){t={queueId:await m("push merge task",()=>or(a,c,u))}}else if("merge-slices-get"===o){let i=Ae(e,"payload.queueId",""),n=await ar(i,u,{funConsume:async e=>await C({from:"merge-slices-get",filename:l,filenameSafe:p,path:e}),funLog:e=>{L("error",e)}});t={state:n.state,msg:n.msg,queueId:i,filename:l},"error"===n.state&&Ni(n.reason)&&L("error",`${n.msg} for fileHash[${a}]: ${n.reason}`)}return t})(),`upload-controller mode[${o}]`)}},X={path:`/${d}/slc`,method:"POST",options:{payload:{maxBytes:h,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(i,n){let s=Ss.slc,r=S(n,s),o=A(i,s),a=await N(i,o,s,r);if(a)return a;let c=Ae(o.headers,"chunk-index",""),l=Ae(o.headers,"chunk-total",""),p=Ae(o.headers,"package-id","");if(!Mn(c))return r.param("invalid chunkIndex in headers");if(c=qi(c),!Mn(l))return r.param("invalid chunkTotal in headers");if(l=qi(l),!Ts(p))return r.param("invalid packageId in headers");let d=e.resolve(u,`${p}_${c}`),m=t.createWriteStream(d),f=()=>{let e=Ln(),t=0,n=!1,s=!1,r=!1,o=!1;m.on("error",t=>{s||n||r||(s=!0,i.payload.unpipe(m),i.payload.resume(),console.log(`apiUploadSlice streamWrite chunk[${c+1}/${l}] of packageId[${p}] err`,t),L("error",`write chunk[${c+1}/${l}] of packageId[${p}] error: ${ts(t)}`),e.reject(`write chunk[${c+1}/${l}] of packageId[${p}] error`))}),m.on("close",()=>{n||s||r?Es(d):o&&!0===m.writableFinished&&setTimeout(()=>{e.resolve(`chunk[${c+1}/${l}] of packageId[${p}] done`)},M)}),i.payload.on("data",e=>{n||(t+=e.length,t>h&&(n=!0,i.payload.unpipe(m),i.payload.resume(),m.destroy()))}),i.payload.pipe(m),i.payload.on("end",()=>{o=!0,s||n&&e.reject("payload too large")});let a=t=>{r||o||s||(r=!0,m.destroy(),L("error",`receive chunk[${c+1}/${l}] of packageId[${p}] error: ${t}`),e.reject(`receive chunk[${c+1}/${l}] of packageId[${p}] error: ${t}`))};return i.payload.on("error",e=>{console.log(`apiUploadSlice req.payload chunk[${c+1}/${l}] of packageId[${p}] err`,e),a(ts(e))}),i.payload.on("close",()=>{a("closed before end")}),e},g={},w="",y="";try{let e=await f();g.success=e,w="success",y="need to parse"}catch(e){if("payload too large"===e)return n.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${h}`}).code(413);g.error=e,w="error",y="need to parse"}return yr(n,Ls(g),{returnType:w,returnMsg:y})}},F={path:`/${d}/dwgfn`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.dwgfn)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Ss.dwgfn,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.fileId","");if(!Ni(o))return n.param("invalid fileId in payload");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);return l.ok?(wr(l.v.streamRead),j(t,n,Promise.resolve({filename:l.v.filename}),`download fileId[${o}]`)):l.res}},U={path:`/${d}/dwgf`,method:"GET",options:{timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Ss.dwgf,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(s.query,"fileId","");if(o=Ni(o)?o:"",!Ni(o))return n.param("invalid fileId in query");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=l.v.fileSize,d=l.v.fileType,m=l.v.filename,h=hr(u,p,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===is(Ae(e,"method","")).toLowerCase()});if(h.error)return wr(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error);let f=t.response(h.source).type(d).header("Content-Encoding","identity").header("Content-Length",p).header("Content-Disposition",Ni(m)?`attachment; filename*=UTF-8''${function(e){let t=Array.from(is(e)),i="";for(let e of t){let t="";try{t=encodeURIComponent(e)}catch(e){t="%EF%BF%BD"}i+=t}return i.replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}(m)}`:"attachment");return f}},G={path:`/${d}/dw`,method:"POST",options:{payload:{maxBytes:f,maxParts:1e9,timeout:!1,parse:!0,failAction:Z(Ss.dw)},timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Ss.dw,n=S(t,i),s=A(e,i),r=await N(e,s,i,n);if(r)return r;let o=Ae(e,"payload.fileId","");if(!Ni(o))return n.param("invalid fileId in payload");let a={fileId:o,token:s.token},c={};if(await E(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),ps(c,"error"))return n.app("can not get file from fileId");let l=k(Ae(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=function(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!Ni(e))return n("invalid str");let s="";try{let t=cs.parse(e);s=us.stringify(t)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}(l.v.filename),d=l.v.fileSize,m=l.v.fileType,h=hr(u,d,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===is(Ae(e,"method","")).toLowerCase()});return h.error?(wr(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error)):t.response(h.source).type(m).header("Content-Encoding","identity").header("Content-Disposition",`attachment; filename="${p}"`).header("Content-Length",d)}};let P=null;if(Ae(r,"serverHapi"))try{y.route([z,Y,X,F,U,G])}catch(e){console.log("register routes error",e),v("error",`register routes error: ${ts(e)}`)}else P=async function(){c&&await y.register(n);let e=[];if(c){let t={method:"GET",path:"/{file*}",handler:{directory:{path:`${l}/`}}};e=[...e,t]}e=[...e,z,Y,X,F,U,G],y.route(e),await y.start(),console.log(`Server running at: ${y.info.uri}`)}().catch(e=>{console.log("start server error",e),v("error",`start server error: ${ts(e)}`)});return D.stop=async()=>{try{vn(P)&&await P,await y.stop()}catch(e){console.log("stop server error",e),L("error",`stop server error: ${ts(e)}`)}},D}var xr=function(){return S.Date.now()},Lr=Math.max,vr=Math.min;function Ir(e,t,i){var n,s,r,o,a,c,l=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=n,r=s;return n=s=void 0,l=t,o=e.apply(r,i)}function h(e){var i=e-c;return void 0===c||i>=t||i<0||p&&e-l>=r}function f(){var e=xr();if(h(e))return g(e);a=setTimeout(f,function(e){var i=t-(e-c);return p?vr(i,r-(e-l)):i}(e))}function g(e){return a=void 0,d&&n?m(e):(n=s=void 0,o)}function w(){var e=xr(),i=h(e);if(n=arguments,s=this,c=e,i){if(void 0===a)return function(e){return l=e,a=setTimeout(f,t),u?m(e):o}(c);if(p)return clearTimeout(a),a=setTimeout(f,t),m(c)}return void 0===a&&(a=setTimeout(f,t)),o}return t=Ui(t)||0,_(i)&&(u=!!i.leading,r=(p="maxWait"in i)?Lr(Ui(i.maxWait)||0,t):r,d="trailing"in i?!!i.trailing:d),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=s=a=void 0},w.flush=function(){return void 0===a?o:g(xr())},w}var br=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Cr=br;function Er(e,t,i){"__proto__"==t&&Cr?Cr(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function Tr(e,t,i){(void 0!==i&&!le(e[t],i)||void 0===i&&!(t in e))&&Er(e,t,i)}var Ar="object"==typeof exports&&exports&&!exports.nodeType&&exports,Sr=Ar&&"object"==typeof module&&module&&!module.nodeType&&module,Nr=Sr&&Sr.exports===Ar?S.Buffer:void 0,kr=Nr?Nr.allocUnsafe:void 0;function jr(e,t){if(t)return e.slice();var i=e.length,n=kr?kr(i):new e.constructor(i);return e.copy(n),n}function Zr(e){var t=new e.constructor(e.byteLength);return new $t(t).set(new $t(e)),t}function zr(e,t){var i=t?Zr(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Yr(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}var Xr=Object.create,Fr=function(){function e(){}return function(t){if(!_(t))return{};if(Xr)return Xr(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Ur(e){return"function"!=typeof e.constructor||Ne(e)?{}:Fr(cn(e))}function Gr(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Pr=Object.prototype.hasOwnProperty;function Kr(e,t,i){var n=e[t];Pr.call(e,t)&&le(n,i)&&(void 0!==i||t in e)||Er(e,t,i)}function Or(e,t,i,n){var s=!i;i||(i={});for(var r=-1,o=t.length;++r<o;){var a=t[r],c=n?n(i[a],e[a],a,i,e):void 0;void 0===c&&(c=e[a]),s?Er(i,a,c):Kr(i,a,c)}return i}var _r=Object.prototype.hasOwnProperty;function Wr(e){if(!_(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Ne(e),i=[];for(var n in e)("constructor"!=n||!t&&_r.call(e,n))&&i.push(n);return i}function Hr(e){return $e(e)?Kt(e,!0):Wr(e)}function Br(e,t,i,n,s,r,o){var a=Gr(e,i),c=Gr(t,i),l=o.get(c);if(l)Tr(e,i,l);else{var u,p=r?r(a,c,i+"",e,t,o):void 0,d=void 0===p;if(d){var m=E(c),h=!m&&St(c),f=!m&&!h&&Gt(c);p=c,m||h||f?E(a)?p=a:U(u=a)&&$e(u)?p=Yr(a):h?(d=!1,p=jr(c,!0)):f?(d=!1,p=zr(c,!0)):p=[]:hn(c)||Ct(c)?(p=a,Ct(a)?p=function(e){return Or(e,Hr(e))}(a):_(a)&&!W(a)||(p=Ur(c))):d=!1}d&&(o.set(c,p),s(p,c,n,r,o),o.delete(c)),Tr(e,i,p)}}function Vr(e,t,i,n,s){e!==t&&Dt(t,function(r,o){if(s||(s=new Vt),_(r))Br(e,t,o,i,Vr,n,s);else{var a=n?n(Gr(e,o),r,o+"",e,t,s):void 0;void 0===a&&(a=r),Tr(e,o,a)}},Hr)}var Qr=Math.max;var Rr=Cr?function(e,t){return Cr(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ii,Jr=Rr,qr=Date.now;var $r=function(e){var t=0,i=0;return function(){var n=qr(),s=16-(n-i);if(i=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Jr),eo=$r;function to(e,t){return eo(function(e,t,i){return t=Qr(void 0===t?e.length-1:t,0),function(){for(var n=arguments,s=-1,r=Qr(n.length-t,0),o=Array(r);++s<r;)o[s]=n[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=n[s];return a[t]=i(o),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,a)}}(e,t,Ii),e+"")}var io,no=(io=function(e,t,i){Vr(e,t,i)},to(function(e,t){var i=-1,n=t.length,s=n>1?t[n-1]:void 0,r=n>2?t[2]:void 0;for(s=io.length>3&&"function"==typeof s?(n--,s):void 0,r&&Ei(t[0],t[1],r)&&(s=n<3?void 0:s,n=1),e=Object(e);++i<n;){var o=t[i];o&&io(e,o,i,s)}return e}));function so(e,t={}){let i=Ae(t,"returnWithStateAndMsg",null);Oi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Ni(e))return n("invalid v");let s={};try{s=JSON.parse(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:s}:s}function ro(e,i={}){let n={};if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let s=Ae(i,"fpTableTags","");Ni(s)||(s="./tableTags.json");let r=Ae(i,"genTag");wn(r)||(r=()=>Yn()+"|"+Un(6));let o=(t,...i)=>{setTimeout(()=>{e.emit(t,...i)},1)};function a(){let e={};try{if(t.existsSync(s)){let i=so(t.readFileSync(s,"utf8"));Ai(i)&&(e=i)}}catch(e){o("error",{msg:"readTableTags catch",err:e})}return e}function c(){try{let e=function(e,t=!1,i={}){let n=Ae(i,"returnWithStateAndMsg",null);Oi(n)||(n=!1);let s=e=>n?{state:"error",msg:e}:"";if(tn(e))return s("invalid v");let r="";try{r=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){return s(e.toString())}return n?{state:"success",msg:r}:r}(n);t.writeFileSync(s,e,"utf8")}catch(e){o("error",{msg:"writeTableTags catch",err:e})}}let l=Ir(()=>{c(),o("changeTableTags",n)},200);return e.readTableTags=a,e.writeTableTags=c,e.initTableTags=function(e={},t="useInputFirst"){if("useInputOnly"===t)n=e;else if("useStorageOnly"===t)n=a();else if("useInputFirst"===t)n=no(a(),e);else{if("useStorageFirst"!==t)throw new Error(`invalid mode[${t}]`);n=no(e,a())}c()},e.setTableTags=function(e={}){n=no(n,e),c()},e.getTableTags=function(){return n},e.updateTableTag=function(e){n[e]=r(),l()},e}var oo=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)si(t,ui(e)),e=cn(e);return t}:ai;function ao(e){return ri(e,Hr,oo)}var co=Object.prototype.hasOwnProperty;var lo=/\w*$/;var uo=N?N.prototype:void 0,po=uo?uo.valueOf:void 0;function mo(e,t,i){var n,s,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Zr(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var i=t?Zr(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return zr(e,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(r=new(s=e).constructor(s.source,lo.exec(s))).lastIndex=s.lastIndex,r;case"[object Symbol]":return n=e,po?Object(po.call(n)):{}}}var ho=Ft&&Ft.isMap,fo=ho?Zt(ho):function(e){return U(e)&&"[object Map]"==Je(e)};var go=Ft&&Ft.isSet,wo=go?Zt(go):function(e){return U(e)&&"[object Set]"==Je(e)},Mo="[object Arguments]",yo="[object Function]",Do="[object Object]",xo={};function Lo(e,t,i,n,s,r){var o,a=1&t,c=2&t,l=4&t;if(i&&(o=s?i(e,n,s,r):i(e)),void 0!==o)return o;if(!_(e))return e;var u=E(e);if(u){if(o=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&co.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!a)return Yr(e,o)}else{var p=Je(e),d=p==yo||"[object GeneratorFunction]"==p;if(St(e))return jr(e,a);if(p==Do||p==Mo||d&&!s){if(o=c||d?{}:Ur(e),!a)return c?function(e,t){return Or(e,oo(e),t)}(e,function(e,t){return e&&Or(t,Hr(t),e)}(o,e)):function(e,t){return Or(e,ui(e),t)}(e,function(e,t){return e&&Or(t,Ot(t),e)}(o,e))}else{if(!xo[p])return s?e:{};o=mo(e,p,a)}}r||(r=new Vt);var m=r.get(e);if(m)return m;r.set(e,o),wo(e)?e.forEach(function(n){o.add(Lo(n,t,i,n,e,r))}):fo(e)&&e.forEach(function(n,s){o.set(s,Lo(n,t,i,s,e,r))});var h=u?void 0:(l?c?ao:pi:c?Hr:Ot)(e);return ds(h||e,function(n,s){h&&(n=e[s=n]),Kr(o,s,Lo(n,t,i,s,e,r))}),o}xo[Mo]=xo["[object Array]"]=xo["[object ArrayBuffer]"]=xo["[object DataView]"]=xo["[object Boolean]"]=xo["[object Date]"]=xo["[object Float32Array]"]=xo["[object Float64Array]"]=xo["[object Int8Array]"]=xo["[object Int16Array]"]=xo["[object Int32Array]"]=xo["[object Map]"]=xo["[object Number]"]=xo[Do]=xo["[object RegExp]"]=xo["[object Set]"]=xo["[object String]"]=xo["[object Symbol]"]=xo["[object Uint8Array]"]=xo["[object Uint8ClampedArray]"]=xo["[object Uint16Array]"]=xo["[object Uint32Array]"]=!0,xo["[object Error]"]=xo[yo]=xo["[object WeakMap]"]=!1;function vo(e){return Lo(e,5)}function Io(e={}){let t=Kn(),i={},n=null,s=Ae(e,"timeAlive");$i(s)||(s=1e4),s=qi(s),s=Math.min(s,On);let r=Ae(e,"timeDetect");return $i(r)||(r=50),r=qi(r),r=Math.min(r,On),t.trigger=function(e,o){Ni(e)?(ps(i,e)||setTimeout(()=>{Hn(t,"message",[{eventName:"enter",key:e,data:o,now:wt(i)}],{tag:"alive"})},1),i[e]={data:o,time:Date.now()},null===n&&(n=setInterval(()=>{ms(i,(e,n)=>{if(Date.now()-e.time>s){let e=vo(i[n]);delete i[n],Hn(t,"message",[{eventName:"leave",key:n,data:e.data,now:wt(i)}],{tag:"alive"})}}),Ai(i)||(clearInterval(n),n=null)},r))):console.log("trigger need key")},t.get=function(){let e=[];return ms(i,(t,i)=>{e.push({key:i,data:t.data})}),e=vo(e),e},t}function bo(e,t={}){let i={};if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let n=(t,...i)=>{setTimeout(()=>{e.emit(t,...i)},1)},s=Io(),r=setInterval(()=>{let e=ks(s.get(),"key"),t={};ms(e,e=>{t[e]=Ae(i,e,[])}),i=t},1e3);s.on("message",function({eventName:e,key:t,data:i,now:s}){"enter"===e?n("clientEnter",t,i):"leave"===e&&n("clientLeave",t,i),n("clientChange",s)}),e.on("execute",function(e,t,r){if("[sys:polling]"===e)try{let e=Ae(t,"clientId",""),n=Ae(i,e,[]);n=vo(n),i[e]=[],s.trigger(e,t),r.resolve(n)}catch(e){n("error",e),r.reject("[sys:polling] error")}});return e.getClients=s.get,e.getMessages=()=>vo(i),e.broadcast=e=>{if(!Ai(i))return;let t={};ms(i,(i,n)=>{i.push({mode:"broadcast",data:e}),t[n]=i}),i=t},e.clearBroadcast=()=>{clearInterval(r)},e}let Co=(e,t)=>{let i={};return ms(e,e=>{let n=e,s=Ae(t,e,"");Ni(s)&&(i[n]=s)}),i};function Eo(e,t,i,n={}){if(!Ai(e))throw new Error("invalid instWConverServer");if(0===wt(t))return e;if(!Ai(i))return e;let s=Ae(n,"genTag");wn(s)||(s=()=>Yn()+"|"+Un(6));let r={};return ms(t,e=>{r[e]=s()}),e.initTableTags(r,"useInputOnly"),ms(t,t=>{let n=i[t];if(!n)throw new Error(`invalid kpOrm[${t}]`);try{n.on("change",()=>{e.updateTableTag(t)})}catch(e){throw new Error(`kpOrm[${t}] can not listen to change events`)}}),e.on("changeTableTags",i=>{e.broadcast({mode:"syncKpTable",data:Co(t,i)})}),e}function To(e,t,i,n){for(var s=i-1,r=e.length;++s<r;)if(n(e[s],t))return s;return-1}var Ao=Array.prototype.splice;function So(e,t){return e&&e.length&&t&&t.length?function(e,t,i,n){var s=n?To:zs,r=-1,o=t.length,a=e;for(e===t&&(t=Yr(t)),i&&(a=xe(e,Zt(i)));++r<o;)for(var c=0,l=t[r],u=i?i(l):l;(c=s(a,u,c,n))>-1;)a!==e&&Ao.call(a,c,1),Ao.call(e,c,1);return e}(e,t):e}function No(e,t={}){if(!Ai(e))throw new Error("invalid instWConverServer");let i=Ae(t,"getUserIdByToken",null);wn(i)||(i=async()=>"");let n=Ae(t,"useDbOrm",null);Oi(n)||(n=!1);let s=null;if(n&&(s=Ae(t,"operOrm",null),!wn(s)))throw new Error("invalid opt.operOrm when useDbOrm=true");let r=[];if(n&&(r=Ae(t,"tableNames",null),!en(r)))throw new Error("invalid opt.tableNames when useDbOrm=true");let o=[];n&&(o=Ae(t,"methods",null),en(o)||(o=["select","insert","save","del"]));let a=Ae(t,"kpFunExt",null);let c={};async function l(e,t,n){if(!Ni(e))return n.resolve({state:"error",msg:"invalid func"}),n;let s="";if(!ps(t,"__sysToken__"))return n.resolve({state:"error",msg:"invalid token"}),n;if(s=is(t.__sysToken__),!ps(t,"__sysInputArgs__"))return n.resolve({state:"error",msg:"invalid input"}),n;t=t.__sysInputArgs__;let r="";if(r=i(s),vn(r)&&(r=await r),Ni(r)||(r=""),"[sys:getFuncList]"===e){let e=Ot(c);e=function(e,t){if(!on(e))return[];if((Ti(t)||Wi(t)||Si(t)||Oi(t))&&(t=[t]),!on(t))return e;let i=vo(e);return So(i,t),i}(e,"[sys:getTableTags]");let t={state:"success",msg:e};return n.resolve(t),n}if(!ps(c,e))return n.resolve({state:"error",msg:`invalid func[${e}]`}),n;let o=c[e];try{let e=await In(o)(r,...t);n.resolve(e)}catch(t){n.resolve({state:"error",msg:`call func[${e}] has an error: ${t.message}`})}return n}return n&&(r=vo(r),c=function(e,t,i){let n={};return ms(e,e=>{ms(t,t=>{n[`${e}.${t}`]=async function(n,s){return await i(n,e,t,s)}})}),n}(r,o,s)),Ai(a)&&ms(a,(e,t)=>{c[t]=e}),e.on("execute",async function(t,i,n){await l(t,i,n).catch(i=>{e.emit("error",i),n.resolve({state:"error",msg:`execFun func[${t}] has an error: ${i.message}`})})}),e}function ko(e,t={}){if(Ai(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Kn()),!ps(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let i=Ae(t,"fpTableTags",null);Ni(i)||(i="./tableTags.json");let n=Ae(t,"genTag");wn(n)||(n=()=>Yn()+"|"+Un(6)),e=new bo(e=new ro(e,{fpTableTags:i,genTag:n}));let s=Ae(t,"useDbOrm",null);Oi(s)||(s=!0);let r=Ae(t,"kpOrm",null),o=Ae(t,"operOrm",null),a=Ae(t,"tableNamesExec",null),c=Ae(t,"methodsExec",null),l=Ae(t,"tableNamesSync",null),u=Ae(t,"getUserIdByToken",null),p=Ae(t,"kpFunExt",null);if(Ai(p)||(p={}),p={...p,"[sys:getTableTags]":()=>{let t=e.getTableTags();return{mode:"syncKpTable",data:Co(l,t)}}},e=new No(e,{getUserIdByToken:u,useDbOrm:s,operOrm:o,tableNames:a,methods:c,kpFunExt:p}),s){if(!Ti(r))return e.emit("error","invalid opt.kpOrm when useDbOrm=true"),e;e=new Eo(e,l,r,{genTag:n})}return e}function jo(e={}){let t=Kn(),s=null,r=null,o=Ae(e,"port");Bi(o)||(o=8080);let a=Ae(e,"corsOrigins",[]);on(a)||(a=["http://localhost"]);let c=Ae(e,"delayForSlice","");Mn(c)||(c=100),c=qi(c);let l=Ae(e,"useInert");Oi(l)||(l=!0);let u=Ae(e,"pathStaticFiles");Ni(u)||(u="dist");let p=Ae(e,"apis");on(p)||(p=[]);let d=Ae(e,"apiName");Ni(d)||(d="api");let m=Ae(e,"pathUploadTemp");Ni(m)||(m="./uploadTemp"),En(m)||Wn(m);let h=Ae(e,"tokenType");Ni(h)||(h="Bearer");let f=Ae(e,"sizeSlice");$i(f)||(f=1048576);let g=Ae(e,"sizeMsg");$i(g)||(g=104857600);let w=Ae(e,"verifyConn");wn(w)||(w=()=>!0);let M=Ae(e,"getUserIdByToken",null),y=Ae(e,"useDbOrm",null);Oi(y)||(y=!0);let D=Ae(e,"kpOrm",null),x=Ae(e,"operOrm",null),L=Ae(e,"tableNamesExec",null),v=Ae(e,"methodsExec",null),I=Ae(e,"tableNamesSync",null),b=Ae(e,"kpFunExt",null),C=Ae(e,"fpTableTags",null);Ni(C)||(C=Ae(e,"fnTableTags",null));let E=Ae(e,"genTag");wn(E)||(E=()=>Yn()+"|"+Un(6));let T=Ae(e,"useShowLog");Oi(T)||(T=!0);(async()=>{await(async()=>{s=new i.Server({port:o,routes:{timeout:{server:!1,socket:!1},cors:{origin:a,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}}}),l&&await s.register(n);let e=[];l&&(e=[{method:"GET",path:"/{file*}",handler:{directory:{path:`${u}/`}}}]),e=[...e,...p],s.route(e)})(),await(async()=>{r=new Dr({serverHapi:s,apiName:d,pathUploadTemp:m,tokenType:h,sizeSlice:f,sizeMsg:g,verifyConn:w,corsOrigins:a,delayForSlice:c}),r.on("clientChange",function(e){T&&console.log(`Server[port:${o}]: now clients: ${e}`)})})(),await(async()=>{r=new ko(r,{getUserIdByToken:M,useDbOrm:y,kpOrm:D,operOrm:x,tableNamesExec:L,tableNamesSync:I,methodsExec:v,kpFunExt:b,fpTableTags:C,genTag:E}),r.on("error",e=>{t.emit("error",e)})})(),await s.start(),T&&console.log(`Server running at: ${s.info.uri}`)})().catch(e=>{t.emit("error",e)}),process.on("unhandledRejection",e=>{console.log("unhandledRejection",e),t.emit("error",{mode:"unhandledRejection",err:e})}),process.on("uncaughtException",e=>{console.log("uncaughtException",e),t.emit("error",{mode:"uncaughtException",err:e})});return t.getServer=async()=>(await _n(()=>null!==s),s),t.getInstWConverServer=async()=>(await _n(()=>null!==r),r),t}function Zo(e,t){let i=Ln();if(!en(e)&&!Ti(e))return i.reject("rs is not an array or object"),i;let n=!1;if(Ti(e)){n=!0;let t=[];ms(e,(e,i)=>{t.push({k:i,v:e})}),e=t}wn(t)||(t=function(e){return e});let s=-1,r=[];return e.reduce(function(e,i){return e.then(function(e){r.push(e),s+=1;let o=s,a=i;return n&&(o=i.k,a=i.v),wn(t)?t(a,o):a})},Promise.resolve()).then(function(e){var t,n,s,o;r.push(e),o=null==(t=r)?0:t.length,r=o?js(t,(n=s||void 0===n?1:Ki(n))<0?0:n,o):[],i.resolve(r)}).catch(function(e){i.reject(e)}),i}let zo={backup:async function(e){return await Zo(e,async(e,t)=>(console.log("backup...",t),{name:t,data:await e.select()}))},recover:async function(e,i,n,s=!1){if(!An(e))throw console.log("fp",e),new Error("fp is not exist");if(!Ai(i))throw console.log("woItems",i),new Error("invalid woItems");wn(n)||(n=null),Oi(s)||(s=!1);let r=t.readFileSync(e,"utf8");r=Qs(r);let o=so(r);wn(n)&&n(),await Zo(o,async e=>{console.log("recover...",e.name),s&&(console.log("needCreateStorage"),await i[e.name].createStorage());let t=null;return wt(e.data)>0&&(t=await i[e.name].insert(e.data)),t})}};function Yo(){if(!wn(zn))throw new Error("invalid dayjs");return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}var Xo={exports:{}},Fo={},Uo={exports:{}},Go={};function Po(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Ko=/javascript\s*\:/gim;Go.whiteList=Po(),Go.getDefaultWhiteList=Po,Go.onAttr=function(e,t,i){},Go.onIgnoreAttr=function(e,t,i){},Go.safeAttrValue=function(e,t){return Ko.test(t)?"":t};var Oo={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,s;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,s=e.length;n<s;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},_o=Oo;var Wo=function(e,t){";"!==(e=_o.trimRight(e))[e.length-1]&&(e+=";");var i=e.length,n=!1,s=0,r=0,o="";function a(){if(!n){var i=_o.trim(e.slice(s,r)),a=i.indexOf(":");if(-1!==a){var c=_o.trim(i.slice(0,a)),l=_o.trim(i.slice(a+1));if(c){var u=t(s,o.length,c,l,i);u&&(o+=u+"; ")}}}s=r+1}for(;r<i;r++){var c=e[r];if("/"===c&&"*"===e[r+1]){var l=e.indexOf("*/",r+2);if(-1===l)break;s=(r=l+1)+1,n=!1}else"("===c?n=!0:")"===c?n=!1:";"===c?n||a():"\n"===c&&a()}return _o.trim(o)},Ho=Go,Bo=Wo;function Vo(e){return null==e}function Qo(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).whiteList=e.whiteList||Ho.whiteList,e.onAttr=e.onAttr||Ho.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Ho.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Ho.safeAttrValue,this.options=e}Qo.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,i=t.whiteList,n=t.onAttr,s=t.onIgnoreAttr,r=t.safeAttrValue;return Bo(e,function(e,t,o,a,c){var l=i[o],u=!1;if(!0===l?u=l:"function"==typeof l?u=l(a):l instanceof RegExp&&(u=l.test(a)),!0!==u&&(u=!1),a=r(o,a)){var p,d={position:t,sourcePosition:e,source:c,isWhite:u};return u?Vo(p=n(o,a,d))?o+":"+a:p:Vo(p=s(o,a,d))?void 0:p}})};var Ro=Qo;!function(e,t){var i=Go,n=Ro;for(var s in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,i)t[s]=i[s];"undefined"!=typeof window&&(window.filterCSS=e.exports)}(Uo,Uo.exports);var Jo=Uo.exports,qo={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,s;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,s=e.length;n<s;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},$o=Jo.FilterCSS,ea=Jo.getDefaultWhiteList,ta=qo;function ia(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var na=new $o;function sa(e){return e.replace(ra,"<").replace(oa,">")}var ra=/</g,oa=/>/g,aa=/"/g,ca=/"/g,la=/&#([a-zA-Z0-9]*);?/gim,ua=/:?/gim,pa=/&newline;?/gim,da=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ma=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ha=/u\s*r\s*l\s*\(.*/gi;function fa(e){return e.replace(aa,""")}function ga(e){return e.replace(ca,'"')}function wa(e){return e.replace(la,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function Ma(e){return e.replace(ua,":").replace(pa," ")}function ya(e){for(var t="",i=0,n=e.length;i<n;i++)t+=e.charCodeAt(i)<32?" ":e.charAt(i);return ta.trim(t)}function Da(e){return e=ya(e=Ma(e=wa(e=ga(e))))}function xa(e){return e=sa(e=fa(e))}Fo.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Fo.getDefaultWhiteList=ia,Fo.onTag=function(e,t,i){},Fo.onIgnoreTag=function(e,t,i){},Fo.onTagAttr=function(e,t,i){},Fo.onIgnoreTagAttr=function(e,t,i){},Fo.safeAttrValue=function(e,t,i,n){if(i=Da(i),"href"===t||"src"===t){if("#"===(i=ta.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(da.lastIndex=0,da.test(i))return""}else if("style"===t){if(ma.lastIndex=0,ma.test(i))return"";if(ha.lastIndex=0,ha.test(i)&&(da.lastIndex=0,da.test(i)))return"";!1!==n&&(i=(n=n||na).process(i))}return i=xa(i)},Fo.escapeHtml=sa,Fo.escapeQuote=fa,Fo.unescapeQuote=ga,Fo.escapeHtmlEntities=wa,Fo.escapeDangerHtml5Entities=Ma,Fo.clearNonPrintableCharacter=ya,Fo.friendlyAttrValue=Da,Fo.escapeAttrValue=xa,Fo.onIgnoreTagStripAll=function(){return""},Fo.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var i=!Array.isArray(e),n=[],s=!1;return{onIgnoreTag:function(r,o,a){if(function(t){return!!i||-1!==ta.indexOf(e,t)}(r)){if(a.isClosing){var c="[/removed]",l=a.position+10;return n.push([!1!==s?s:a.position,l]),s=!1,c}return s||(s=a.position),"[removed]"}return t(r,o,a)},remove:function(e){var t="",i=0;return ta.forEach(n,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}},Fo.stripCommentTag=function(e){for(var t="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var s=e.indexOf("--\x3e",n);if(-1===s)break;i=s+3}return t},Fo.stripBlankChar=function(e){var t=e.split("");return(t=t.filter(function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})).join("")},Fo.attributeWrapSign='"',Fo.cssFilter=na,Fo.getDefaultCSSWhiteList=ea;var La={},va=qo;function Ia(e){var t,i=va.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=va.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}function ba(e){return"</"===e.slice(0,2)}var Ca=/[^a-zA-Z0-9\\_:.-]/gim;function Ea(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Ta(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}}function Aa(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Sa(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}La.parseTag=function(e,t,i){var n="",s=0,r=!1,o=!1,a=0,c=e.length,l="",u="";e:for(a=0;a<c;a++){var p=e.charAt(a);if(!1===r){if("<"===p){r=a;continue}}else if(!1===o){if("<"===p){n+=i(e.slice(s,a)),r=a,s=a;continue}if(">"===p||a===c-1){n+=i(e.slice(s,r)),l=Ia(u=e.slice(r,a+1)),n+=t(r,n.length,l,u,ba(u)),s=a+1,r=!1;continue}if('"'===p||"'"===p)for(var d=1,m=e.charAt(a-d);""===m.trim()||"="===m;){if("="===m){o=p;continue e}m=e.charAt(a-++d)}}else if(p===o){o=!1;continue}}return s<c&&(n+=i(e.substr(s))),n},La.parseAttr=function(e,t){var i=0,n=0,s=[],r=!1,o=e.length;function a(e,i){if(!((e=(e=va.trim(e)).replace(Ca,"").toLowerCase()).length<1)){var n=t(e,i||"");n&&s.push(n)}}for(var c=0;c<o;c++){var l,u=e.charAt(c);if(!1!==r||"="!==u)if(!1===r||c!==n)if(/\s|\n|\t/.test(u)){if(e=e.replace(/\s|\n|\t/g," "),!1===r){if(-1===(l=Ea(e,c))){a(va.trim(e.slice(i,c))),r=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=Aa(e,c-1))){a(r,Sa(va.trim(e.slice(i,c)))),r=!1,i=c+1;continue}}else;else{if(-1===(l=e.indexOf(u,c+1)))break;a(r,va.trim(e.slice(n+1,l))),r=!1,i=(c=l)+1}else r=e.slice(i,c),i=c+1,n='"'===e.charAt(i)||"'"===e.charAt(i)?i:Ta(e,c+1)}return i<e.length&&(!1===r?a(e.slice(i)):a(r,Sa(va.trim(e.slice(i))))),va.trim(s.join(" "))};var Na=Jo.FilterCSS,ka=Fo,ja=La,Za=ja.parseTag,za=ja.parseAttr,Ya=qo;function Xa(e){return null==e}function Fa(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=ka.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=function(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(e){return e.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}(e.whiteList||e.allowList):e.whiteList=ka.whiteList,this.attributeWrapSign=!0===e.singleQuotedAttributeValue?"'":ka.attributeWrapSign,e.onTag=e.onTag||ka.onTag,e.onTagAttr=e.onTagAttr||ka.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||ka.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||ka.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||ka.safeAttrValue,e.escapeHtml=e.escapeHtml||ka.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Na(e.css))}Fa.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this,i=t.options,n=i.whiteList,s=i.onTag,r=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,c=i.safeAttrValue,l=i.escapeHtml,u=t.attributeWrapSign,p=t.cssFilter;i.stripBlankChar&&(e=ka.stripBlankChar(e)),i.allowCommentTag||(e=ka.stripCommentTag(e));var d=!1;i.stripIgnoreTagBody&&(d=ka.StripTagBody(i.stripIgnoreTagBody,r),r=d.onIgnoreTag);var m=Za(e,function(e,t,i,d,m){var h={sourcePosition:e,position:t,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(n,i)},f=s(i,d,h);if(!Xa(f))return f;if(h.isWhite){if(h.isClosing)return"</"+i+">";var g=function(e){var t=Ya.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=Ya.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=Ya.trim(e.slice(0,-1))),{html:e,closing:i}}(d),w=n[i],M=za(g.html,function(e,t){var n=-1!==Ya.indexOf(w,e),s=o(i,e,t,n);return Xa(s)?n?(t=c(i,e,t,p))?e+"="+u+t+u:e:Xa(s=a(i,e,t,n))?void 0:s:s});return d="<"+i,M&&(d+=" "+M),g.closing&&(d+=" /"),d+=">"}return Xa(f=r(i,d,h))?l(d):f},l);return d&&(m=d.remove(m)),m};var Ua=Fa;!function(e,t){var i=Fo,n=La,s=Ua;function r(e,t){return new s(t).process(e)}(t=e.exports=r).filterXSS=r,t.FilterXSS=s,function(){for(var e in i)t[e]=i[e];for(var s in n)t[s]=n[s]}(),"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(Xo,Xo.exports);var Ga=kn(Xo.exports);function Pa(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let Ka={getFilterXSS:function(e=Ga){if(wn(e))return e;let t=Pa(),i=Ae(t,"filterXSS",null);if(wn(i))return i;let n=Ae(t,"xss",null);if(wn(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(e){return{onIgnoreTagAttr:function(t,i,n,s){if("style"===i)return i+'="'+e.escapeAttrValue(n)+'"'}}}};function Oa(e){let t=null,i=null;let n=function e(n){return en(n)||Ti(n)?(ms(n,function(t,i){n[i]=e(t)}),n):Ni(n)?(s=n,null===t&&(t=Ka.getFilterXSS(),i=Ka.getOpt(t)),t(s,i)):n;var s}(vo(e));return n}let _a=null,Wa=null;function Ha(e,t,i,n="save"){if(!Ai(_a))throw console.log("ds",_a),new Error("invalid ds");let s=_a[e].keys,r=!1;en(i)||(r=!0,i=[i]);let o=Yo();return n.indexOf("insert")>=0&&(s.indexOf("userId")>=0&&ms(i,(e,n)=>{i[n].userId=t}),s.indexOf("timeCreate")>=0&&ms(i,(e,t)=>{i[t].timeCreate=o}),s.indexOf("userIdUpdate")>=0&&ms(i,(e,n)=>{i[n].userIdUpdate=t}),s.indexOf("timeUpdate")>=0&&ms(i,(e,t)=>{i[t].timeUpdate=o})),(n.indexOf("insert")>=0||n.indexOf("save")>=0)&&(s.indexOf("userIdUpdate")>=0&&ms(i,(e,n)=>{i[n].userIdUpdate=t}),s.indexOf("timeUpdate")>=0&&ms(i,(e,t)=>{i[t].timeUpdate=o})),i=ks(i,(e,t)=>{let i={};return ms(e,(e,t)=>{e=Oa(e),i[t]=e}),i}),i=r?i[0]:i}async function Ba(e,t,i,n){let s,r=null;if(!Ai(Wa))return Promise.reject("無有效woItems");let o=Ae(Wa,t,null);if(null===o)return Promise.reject(`ORM找不到表名稱: ${t}`);if("select"===i){if(s=await o.select(n).catch(e=>{console.log(`${t}.select catch`,e),r="取得資料失敗"}),Ni(r))return Promise.reject(r)}else if("insert"===i||"save"===i){try{n=Ha(t,e,n,i)}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if("insert"===i?s=await o.insert(n).catch(e=>{console.log(`${t}.save catch`,e),r="新增資料失敗"}):"save"===i&&(s=await o.save(n).catch(e=>{console.log(`${t}.save catch`,e),r="儲存資料失敗"})),Ni(r))return Promise.reject(r);s=en(n)?ks(n,e=>({id:e.id})):{id:n.id}}else if("del"===i)s=await o.del(n).catch(e=>{console.log(`${t}.del catch`,e),r="刪除資料失敗"});else if("delAll"===i)s=await o.delAll(n).catch(e=>{console.log(`${t}.delAll catch`,e),r="刪除資料失敗"});else if("mix"===i){if(!Ai(n))return Promise.reject("mix僅支援輸入ltdtDiffByKey結果物件");let i;s=[];let a=Ae(n,"add",[]);if(wt(a)>0){try{a=Ha(t,e,a,"insert+save")}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if(await o.insert(a).catch(e=>{console.log(`${t}.save catch`,e),r="新增資料失敗"}),Ni(r))return Promise.reject(r);i=ks(a,e=>({id:e.id})),s=[...s,...i]}let c=Ae(n,"del",[]);if(wt(c)>0){if(await o.del(c).catch(e=>{console.log(`${t}.save catch`,e),r="刪除資料失敗"}),Ni(r))return Promise.reject(r);i=ks(c,e=>({id:e.id})),s=[...s,...i]}let l=Ae(n,"diff",[]);if(wt(l)>0){try{l=Ha(t,e,l)}catch(e){return console.log("adjustData catch",e.toString()),r="調整資料失敗",Promise.reject(r)}if(await o.save(l).catch(e=>{console.log(`${t}.save catch`,e),r="變更資料失敗"}),Ni(r))return Promise.reject(r);i=ks(l,e=>({id:e.id})),s=[...s,...i]}}else r=`invalid mode: ${i}`;return Ni(r)?Promise.reject(r):s}function Va(e,t){return _a=e,Wa=t,Ba}function Qa(e,t){var i=[];return Ht(e,function(e,n,s){t(e,n,s)&&i.push(e)}),i}function Ra(e,t){return(E(e)?oi:Qa)(e,Ci(t))}function Ja(e,t=null){if(!en(e)){let e=Ln();return e.reject("pms is not an array"),e}return e.reduce((e,t)=>e.then(t),Promise.resolve(t))}let qa=[],$a=[],ec=[],tc=null,ic=null,nc=!0,sc=!0;function rc(e){setTimeout(()=>{qa.push(e)},1)}function oc(e){setTimeout(()=>{$a.push(e)},1)}function ac(e){setTimeout(()=>{ec.push(e)},1)}async function cc(e,t,i,n){if(!wn(tc))return Promise.reject("invalid mapOrm");if(nc&&!Ni(e))return console.log("userId",e),console.log("找不到使用者主鍵"),Promise.reject("找不到使用者主鍵");let s="n";if(nc){if(!wn(ic))return Promise.reject("invalid getUserById");let t=await ic(e);if(!t)return console.log("userId",e),console.log("找不到使用者資訊"),Promise.reject("找不到使用者資訊");s=Ae(t,"isAdmin"),"y"!==s&&"n"!==s&&(s="n");let i=Ae(t,"isActive");if("y"!==i&&"n"!==i&&(i="n"),"y"!==i)return console.log("userId",e),console.log("oSelf",t),console.log("使用者被停權或無有效使用者資訊"),Promise.reject("使用者被停權或無有效使用者資訊")}if(await Zo(qa,r=>r({woName:t,userId:e,isAdmin:s,mode:i,input:n})),wt($a)>0){let r={woName:t,userId:e,isAdmin:s,mode:i,input:n},o=await Ja($a,r);n=o.input}let r=await tc(e,t,i,n);return sc&&"n"===s&&"select"===i&&en(r)&&(r=Ra(r,e=>!ps(e,"isActive")||!("n"===e.isActive))),wt(ec)>0&&(r=await Ja(ec,{woName:t,userId:e,isAdmin:s,mode:i,input:n,output:r})),r}function lc(e,t,i,n,s={}){let r=function(e,t,i,n){if(!Ai(e))throw console.log("ds",e),new Error("invalid ds");if(!wn(t))throw console.log("WOrm",t),new Error("invalid WOrm");if(!Ni(i))throw console.log("url",i),new Error("invalid url");if(!Ni(n))throw console.log("db",n),new Error("invalid db");let s={};return ms(Ot(e),e=>{let r=new t({url:i,db:n,cl:e});s[e]=r}),s}(e,t,i,n),o=function(e,t={}){return wn(e)?(tc=e,nc=Ae(t,"useCheckUser"),Oi(nc)||(nc=!0),ic=Ae(t,"getUserById"),sc=Ae(t,"useExcludeWhenNotAdmin"),Oi(sc)||(sc=!0),{addFunCheck:rc,addFunPreProcessing:oc,addFunPostProcessing:ac,procOrm:cc}):Promise.reject("invalid mapOrm")}(Va(e,r),s);return{...zo,woItems:r,closeAll:async()=>{await Zo(r,async e=>{e&&wn(e.close)&&await e.close()})},...o}}const uc=[];for(let e=0;e<256;++e)uc.push((e+256).toString(16).slice(1));const pc=new Uint8Array(16);function dc(){return crypto.getRandomValues(pc)}const mc={};function hc(e,t,i){let n;if(e)n=fc(e.random??e.rng?.()??dc(),e.msecs,e.seq,t,i);else{const e=Date.now(),s=dc();!function(e,t,i){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=gc(i),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(mc,e,s),n=fc(s,mc.msecs,mc.seq,t,i)}return t??function(e,t=0){return(uc[e[t+0]]+uc[e[t+1]]+uc[e[t+2]]+uc[e[t+3]]+"-"+uc[e[t+4]]+uc[e[t+5]]+"-"+uc[e[t+6]]+uc[e[t+7]]+"-"+uc[e[t+8]]+uc[e[t+9]]+"-"+uc[e[t+10]]+uc[e[t+11]]+uc[e[t+12]]+uc[e[t+13]]+uc[e[t+14]]+uc[e[t+15]]).toLowerCase()}(n)}function fc(e,t,i,n,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(s<0||s+16>n.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else n=new Uint8Array(16),s=0;return t??=Date.now(),i??=gc(e),n[s++]=t/1099511627776&255,n[s++]=t/4294967296&255,n[s++]=t/16777216&255,n[s++]=t/65536&255,n[s++]=t/256&255,n[s++]=255&t,n[s++]=112|i>>>28&15,n[s++]=i>>>20&255,n[s++]=128|i>>>14&63,n[s++]=i>>>6&255,n[s++]=i<<2&255|3&e[10],n[s++]=e[11],n[s++]=e[12],n[s++]=e[13],n[s++]=e[14],n[s++]=e[15],n}function gc(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function wc(){return hc()}function Mc(e,t,i=""){if(!on(t))return{};let n={};return ms(t,function(t){n[t]=Ae(e,t,i)}),n}let yc={id:{pk:!0,name:"主鍵",type:"STRING"},ip:{name:"IP",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"}},Dc={id:{pk:!0,name:"主鍵",type:"STRING"},token:{name:"金鑰",type:"STRING"},userId:{name:"使用者主鍵",type:"STRING"},isApp:{name:"是否為應用系統",type:"STRING"},perms:{name:"應用系統權限",type:"TEXT"},timeCreate:{name:"創建時間",type:"STRING"},timeEnd:{name:"到期時間",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"}},xc={id:{pk:!0,name:"主鍵",type:"STRING"},order:{name:"順序",type:"INTEGER"},account:{name:"帳號",type:"STRING"},password:{name:"密碼",type:"STRING"},name:{name:"姓名",type:"STRING"},email:{name:"電子郵件",type:"STRING"},description:{name:"描述",type:"TEXT"},from:{name:"來源",type:"STRING"},redir:{name:"登入後轉址",type:"STRING"},isAdmin:{name:"是否為系統管理員",type:"STRING"},tokenVerify:{name:"註冊後驗證用token",type:"STRING"},timeVerified:{name:"驗證時間",type:"STRING"},timeExpired:{name:"過期時間",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"},isForceChangePw:{name:"是否須強制變更密碼",type:"STRING"},userId:{name:"創建使用者主鍵",type:"STRING"},timeCreate:{name:"創建時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"},isActive:{name:"是否有效",type:"STRING"}};function Lc(e,t={}){let i=Ae(t,"useCreateStorage");Oi(i)||(i=!1);let{keyTable:n,tableNameCht:s,tableNameEng:r,settings:o,parser:a,funNew:c,funTest:l,ext:u}=e;if(!Ni(n))throw new Error(`invalid keyTable[${n}]`);if(Ni(s)||(s=n),Ni(r)||(r=n),!Ai(o))throw new Error("invalid settings");Ai(u)||(u=null),Ai(a)||(a=null),wn(c)||(c=null);let p=null;wn(l)&&(p=async e=>{if(!Ai(e))throw new Error("invalid wo");if(!ps(e,n))throw console.log(e),new Error(`keyTable[${n}] is not in wo`);let t=[];try{t=l(),vn(t)&&(t=await t)}catch(e){throw console.log(`keyTable[${n}] funTest catch`,e),new Error(e)}if(0!==wt(t))return i&&await e[n].createStorage(),await e[n].save(t),t});let d={},m={};return ms(Ot(o),e=>{let t=Ae(o,`${e}.name`,"");Ni(t)&&(d[e]=t);let i=Ae(o,`${e}.type`,"");Ni(i)&&(m[e]=i)}),{...e,keyTable:n,tableNameCht:s,tableNameEng:r,settings:o,keys:Ot(o),kpType:m,kpHead:d,parser:a,funNew:c,funTest:l,funTestAndSave:p,ext:u}}let vc={ips:{keyTable:"ips",tableNameCht:"IP使用者",tableNameEng:"IPs",settings:yc,funNew:(e={})=>{let t=Mc(e,Ot(yc));return t.id=`${wc()}`,t},funTest:()=>[]},tokens:{keyTable:"tokens",tableNameCht:"金鑰",tableNameEng:"Tokens",settings:Dc,funNew:(e={})=>{let t=Mc(e,Ot(Dc));return t.id=`${wc()}`,t.token=`${wc()}`,en(t.perms)||(t.perms=[]),t.timeCreate=Yo(),t.timeEnd=zn().add(30,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),t.timeUpdate=t.timeCreate,t},funTest:()=>[]},users:{keyTable:"users",tableNameCht:"使用者",tableNameEng:"Users",settings:xc,funNew:(e={})=>{let t=Mc(e,Ot(xc));return t.id=`${wc()}`,t.timeCreate=Yo(),t.userIdUpdate=t.userId,t.timeUpdate=t.timeCreate,t.isActive="y","y"!==t.isForceChangePw&&"n"!==t.isForceChangePw&&(t.isForceChangePw="n"),t},funTest:()=>[]}},Ic={};for(let e in vc)Ic[e]=Lc(vc[e],{useCreateStorage:!1});function bc(e){let t;return t=Dn(e,1),"Z"===t?`${e=xn(e,1)}+00:00`:e}let Cc={checkTZ:function(e){let t;return t=Dn(e,1),"Z"===t||(t=Dn(e,6),!!/[+|-]\d\d:\d\d/.test(t))},delTZ:function(e){let t;return t=Dn(e,1),xn(e,"Z"===t?1:6)},normTZ:bc,sepTZ:function(e){let t=bc(e);return{t:xn(t,6),tz:Dn(t,6)}}};function Ec(e){if(!Ni(e))return!1;if(!Cc.checkTZ(e))return!1;let t=Cc.delTZ(e),i="YYYY-MM-DDTHH:mm:ss.SSS";return t===zn(t,i).format(i)}function Tc(e){let t=Ae(e,"timeExpired","");return!!Ec(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=t}function Ac(e){let t=Ae(e,"timeBlocked","");return!!Ec(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}function Sc(e){return"y"===Ae(e,"isActive","")}function Nc(e){let t=Ec(Ae(e,"timeVerified",""));let i=!Tc(e),n=!Ac(e),s=function(e){return"y"===Ae(e,"isAdmin","")}(e),r=Sc(e);return t&&i&&n&&s&&r}let kc=a.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(up).href:"undefined"==typeof document?location.href:C&&"SCRIPT"===C.tagName.toUpperCase()&&C.src||new URL("w-web-sso.umd.js",document.baseURI).href),jc=e.dirname(kc);function Zc(e){if(en(e))return e.map(Zc);if(null==e||""===e)return"";if(!Ni(e))return`(${typeof e})`;let t=null;try{t=new URL(e)}catch(e){return"(invalid-url)"}return"http:"!==t.protocol&&"https:"!==t.protocol?t.protocol:`${t.origin}${t.pathname}`}let zc=(i={})=>{let n=Ae(i,"logFd","");Ni(n)||(n="./logs");let s=Ae(i,"logInterval","");Ni(s)||(s="hr");let r=Ae(i,"logNumKeep",null),o={fdLog:n,interval:s};if(null!=r&&""!==r){if(!$i(r))throw new Error(`invalid logNumKeep[${r}], must be positive integer`);o.numKeep=qi(r)}let a=function(i={}){let n=Kn(),s=Ae(i,"timeZone",null),r=Ae(i,"fdLog");Ni(r)||(r="./_logs");let o=Ae(i,"interval");"day"!==o&&"hr"!==o&&(o="day");let a=Ae(i,"numKeep");$i(a)||(a="day"===o?365:8760),a=qi(a);let l=c.transport({targets:[{level:"info",target:e.resolve(jc,"./formatter.mjs"),options:{interval:o,fdLog:r,timeZone:s}}]}),u=c(l),p=()=>{try{if(!En(r))return;let i="hr"===o?/^\d{4}-\d{2}-\d{2}T\d{2}\.log$/:/^\d{4}-\d{2}-\d{2}\.log$/,s=t.readdirSync(r).filter(e=>i.test(e));s.sort();let c=s.length-a;if(c<=0)return;let l=s.slice(0,c);for(let i of l){let s=e.join(r,i);try{t.unlinkSync(s),n.emit("delete",{fp:s,fn:i})}catch(e){}}}catch(e){console.error("WSyslog cleanLogs error:",e)}};p();let d=setInterval(p,36e5);d.unref();let m=null,h=e=>{let t=u[e].bind(u);return(...i)=>{try{n.emit(e,{args:i})}catch(e){}t(...i)}};return n.fatal=h("fatal"),n.error=h("error"),n.warn=h("warn"),n.info=h("info"),n.debug=h("debug"),n.trace=h("trace"),n.cleanLogs=p,n.clear=(e={})=>{if(null!==m)return m;let t=Ae(e,"timeLimit");$i(t)||(t=6e4),m=Ln();let i=!1,n=()=>{i||(i=!0,clearInterval(d),m.resolve())},s=setTimeout(()=>{try{l.worker.terminate()}catch(e){}n()},t);try{u.flush(e=>{if(e||l.closed)return clearTimeout(s),void n();l.once("close",()=>{clearTimeout(s),n()}),l.end()})}catch(e){clearTimeout(s),n()}return m},n}(o);return a};function Yc(e){if(en(e))return e.map(Yc);if(null==e||""===e)return"";if(!Ni(e))return`(${typeof e})`;let t=e.length,i=Math.min(4,Math.floor(t/8));if(0===i)return`(len=${t})`;let n=e=>Array.from(e,e=>{let t=e.charCodeAt(0);return t<32||127===t?"?":e}).join("");return`${n(e.slice(0,i))}...${n(e.slice(-i))}(len=${t})`}let Xc=["id","account","email","name"];function Fc(e,t){return Ni(e)&&Xc.includes(e)?t:Yc(t)}var Uc,Gc,Pc={exports:{}},Kc={},Oc={exports:{}},_c={},Wc={},Hc={};function Bc(){if(Uc)return Hc;Uc=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.toUnicode=Hc.toASCII=Hc.encode=Hc.decode=Hc.ucs2=Hc.version=void 0;const e=2147483647,t=36,i=/^xn--/,n=/[^\0-\x7F]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,r={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=Math.floor,a=String.fromCharCode;function c(e){throw new RangeError(r[e])}function l(e,t){const i=e.split("@");let n="";i.length>1&&(n=i[0]+"@",e=i[1]);const r=function(e,t){const i=[];let n=e.length;for(;n--;)i[n]=t(e[n]);return i}((e=e.replace(s,".")).split("."),t).join(".");return n+r}function u(e){const t=[];let i=0;const n=e.length;for(;i<n;){const s=e.charCodeAt(i++);if(s>=55296&&s<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&s)<<10)+(1023&n)+65536):(t.push(s),i--)}else t.push(s)}return t}const p=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},d=function(e,t){return e+22+75*Number(e<26)-(Number(0!=t)<<5)},m=function(e,i,n){let s=0;for(e=n?o(e/700):e>>1,e+=o(e/i);e>455;s+=t)e=o(e/35);return o(s+36*e/(e+38))},h=function(i){const n=[],s=i.length;let r=0,a=128,l=72,u=i.lastIndexOf("-");u<0&&(u=0);for(let e=0;e<u;++e)i.charCodeAt(e)>=128&&c("not-basic"),n.push(i.charCodeAt(e));for(let d=u>0?u+1:0;d<s;){const u=r;for(let n=1,a=t;;a+=t){d>=s&&c("invalid-input");const u=p(i.charCodeAt(d++));u>=t&&c("invalid-input"),u>o((e-r)/n)&&c("overflow"),r+=u*n;const m=a<=l?1:a>=l+26?26:a-l;if(u<m)break;const h=t-m;n>o(e/h)&&c("overflow"),n*=h}const h=n.length+1;l=m(r-u,h,0==u),o(r/h)>e-a&&c("overflow"),a+=o(r/h),r%=h,n.splice(r++,0,a)}return String.fromCodePoint(...n)};Hc.decode=h;const f=function(i){const n=[],s=u(i),r=s.length;let l=128,p=0,h=72;for(const e of s)e<128&&n.push(a(e));const f=n.length;let g=f;for(f&&n.push("-");g<r;){let i=e;for(const e of s)e>=l&&e<i&&(i=e);const r=g+1;i-l>o((e-p)/r)&&c("overflow"),p+=(i-l)*r,l=i;for(const i of s)if(i<l&&++p>e&&c("overflow"),i===l){let e=p;for(let i=t;;i+=t){const s=i<=h?1:i>=h+26?26:i-h;if(e<s)break;const r=e-s,c=t-s;n.push(a(d(s+r%c,0))),e=o(r/c)}n.push(a(d(e,0))),h=m(p,r,g===f),p=0,++g}++p,++l}return n.join("")};Hc.encode=f;Hc.toUnicode=function(e){return l(e,function(e){return i.test(e)?h(e.slice(4).toLowerCase()):e})};return Hc.toASCII=function(e){return l(e,function(e){return n.test(e)?"xn--"+f(e):e})},Hc.version="2.3.1",Hc.ucs2={decode:u,encode:e=>String.fromCodePoint(...e)},Hc}function Vc(){if(Gc)return Wc;Gc=1;var e,t=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Nn&&Nn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var s={};if(null!=n)for(var r=e(n),o=0;o<r.length;o++)"default"!==r[o]&&t(s,n,r[o]);return i(s,n),s}),s=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.resolve=Wc.parse=void 0;const r=s(u),o=s(p),a=n(Bc()),c=/^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/,l=/^[\x00-\x20]+|[\x00-\x20]+$/g,d=/^[\x00-\x20\u00a0\ufeff]+/,m=/^([a-zA-Z0-9+.-]+:)?[\\/]{2}([^\\/?#]*)/,h=/[\x00-\x20#/:<>?@[\\\]^|\x7f]/,f=/[\x00-\x1f\x7f]/;function g(e,t,i,n){const s=o.default.parse(e,t,n),c=m.exec(e.replace(d,""));if(c&&(c[1]||null!==s.hostname)){const e=c[2].slice(c[2].lastIndexOf("@")+1);if(!e||f.test(e)||(s.host||"").toLowerCase()!==a.toASCII(e.toLowerCase()))throw i;if("["===e.charAt(0)&&!r.default.isIPv6(e.slice(1,e.indexOf("]"))))throw i}else if(null!==s.hostname)throw i;const l=null===s.auth||void 0===s.auth?null:s.auth.split(":"),u=s;return u.username=l?l.shift():null,u.password=l&&l.length?l.join(":"):null,u}function w(e){try{return decodeURIComponent(e)}catch(t){return e}}function M(e,t){const i=e||"";if(!i)return"";if("["===i.charAt(0)&&"]"===i.charAt(i.length-1))return i.slice(1,-1);const n=w(i),s=h.test(n)?"":o.default.domainToASCII(n);if(!s)throw function(e){const t=new TypeError("Invalid URL");return t.code="ERR_INVALID_URL",t.input=e,t}(t);return s}Wc.parse=(e,t)=>{e=(e||"").replace(l,"");const i=c.exec(e),n=i?i[1]+"//"+i[2]:e;let s;try{s=new URL(n)}catch(e){return g(n,t,e)}const r=M(s.hostname,s.href),o=s.port||null,a=s.pathname||null,u=s.search||null;let p,d=null,m=null,h=null;if((s.username||s.password)&&(m=w(s.username),h=s.password?w(s.password):null,d=m+(null!==h?":"+h:"")),t){const e=Object.create(null);s.searchParams.forEach((t,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];Array.isArray(n)?n.push(t):e[i]=[n,t]}else e[i]=t}),p=e}else p=u?u.slice(1):null;return{protocol:s.protocol||null,host:s.host||null,hostname:r,port:o,pathname:a,search:u,path:(a||"")+(u||"")||null,href:s.href,auth:d,username:m,password:h,query:p}};return Wc.resolve=(e,t)=>{try{return new URL(t,e).href}catch(i){return g(e,!1,i,!0),g(t,!1,i,!0),o.default.resolve(e,t)}},Wc}var Qc,Rc={exports:{}},Jc={exports:{}};var qc,$c={};function el(){return qc||(qc=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.homepage=$c.version=$c.name=void 0,$c.name="nodemailer",$c.version="10.0.13",$c.homepage="https://nodemailer.com/"),$c}var tl,il={};function nl(){return tl||(tl=1,Object.defineProperty(il,"__esModule",{value:!0}),il.EFETCH=il.EURLACCESS=il.EFILEACCESS=il.EPROXY=il.ECONFIG=il.ESES=il.ESENDMAIL=il.EMAXRECIPIENTS=il.EMAXLIMIT=il.EOAUTH2=il.ENOAUTH=il.EAUTH=il.ESTREAM=il.EMESSAGE=il.EENVELOPE=il.EPROTOCOL=il.EREQUIRETLS=il.ETLS=il.EDNS=il.ESOCKET=il.ETIMEDOUT=il.ECONNECTION=il.ERROR_CODES=void 0,il.ERROR_CODES={ECONNECTION:"Connection closed unexpectedly",ETIMEDOUT:"Connection or operation timed out",ESOCKET:"Socket-level error",EDNS:"DNS resolution failed",ETLS:"TLS handshake or STARTTLS failed",EREQUIRETLS:"REQUIRETLS not supported by server (RFC 8689)",EPROTOCOL:"Invalid SMTP server response",EENVELOPE:"Invalid mail envelope (sender or recipients)",EMESSAGE:"Message delivery error",ESTREAM:"Stream processing error",EAUTH:"Authentication failed",ENOAUTH:"Authentication credentials not provided",EOAUTH2:"OAuth2 token generation or refresh error",EMAXLIMIT:"Pool resource limit reached (max messages per connection)",EMAXRECIPIENTS:"Recipient count exceeds maxRecipients",ESENDMAIL:"Sendmail command error",ESES:"AWS SES transport error",ECONFIG:"Invalid configuration",EPROXY:"Proxy connection error",EFILEACCESS:"File access rejected (disableFileAccess is set)",EURLACCESS:"URL access rejected (disableUrlAccess is set)",EFETCH:"HTTP fetch error"},il.ECONNECTION="ECONNECTION",il.ETIMEDOUT="ETIMEDOUT",il.ESOCKET="ESOCKET",il.EDNS="EDNS",il.ETLS="ETLS",il.EREQUIRETLS="EREQUIRETLS",il.EPROTOCOL="EPROTOCOL",il.EENVELOPE="EENVELOPE",il.EMESSAGE="EMESSAGE",il.ESTREAM="ESTREAM",il.EAUTH="EAUTH",il.ENOAUTH="ENOAUTH",il.EOAUTH2="EOAUTH2",il.EMAXLIMIT="EMAXLIMIT",il.EMAXRECIPIENTS="EMAXRECIPIENTS",il.ESENDMAIL="ESENDMAIL",il.ESES="ESES",il.ECONFIG="ECONFIG",il.EPROXY="EPROXY",il.EFILEACCESS="EFILEACCESS",il.EURLACCESS="EURLACCESS",il.EFETCH="EFETCH"),il}var sl,rl,ol,al={};function cl(){return sl||(sl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.copyOwnKeys=e.isProtoKey=void 0;e.isProtoKey=e=>"__proto__"===e;e.copyOwnKeys=(t,i,n)=>(Object.keys(i||{}).forEach(s=>{(0,e.isProtoKey)(s)||n&&n(s)||(t[s]=i[s])}),t)}(al)),al}function ll(){return rl||(rl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(h),c=o(f),l=r(Vc()),p=o(g),d=w,m=o((Qc||(Qc=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(u),c=r(Vc());t.default=class{constructor(e){this.options=e||{},this.cookies=[]}set(e,t){const i=c.parse(t||""),n=this.parse(e);let s;return n.domain?(s=n.domain.replace(/^\./,""),(i.hostname.length<s.length||s.indexOf(".")<0||s.endsWith(".")||a.default.isIP(i.hostname)||!("."+i.hostname).endsWith("."+s))&&(n.domain=i.hostname)):n.domain=i.hostname,n.path||(n.path=this.getPath(i.pathname)),n.expires||(n.expires=new Date(Date.now()+1e3*(Number(this.options.sessionTimeout||1800)||1800))),this.add(n)}get(e){return this.list(e).map(e=>e.name+"="+e.value).join("; ")}list(e){const t=[];for(let i=this.cookies.length-1;i>=0;i--){const n=this.cookies[i];this.isExpired(n)?this.cookies.splice(i,1):this.match(n,e)&&t.unshift(n)}return t}parse(e){const t={};return(e||"").toString().split(";").forEach(e=>{const i=e.split("="),n=i.shift().trim().toLowerCase();let s,r=i.join("=").trim();if(n)switch(n){case"expires":{const e=new Date(r);"Invalid Date"!==e.toString()&&(t.expires=e);break}case"path":t.path=r;break;case"domain":s=r.toLowerCase(),s.length&&"."!==s.charAt(0)&&(s="."+s),t.domain=s;break;case"max-age":t.expires=new Date(Date.now()+1e3*(Number(r)||0));break;case"secure":t.secure=!0;break;case"httponly":t.httponly=!0;break;default:t.name||(t.name=n,t.value=r)}}),t}match(e,t){const i=c.parse(t||"");if(i.hostname!==e.domain&&("."!==e.domain.charAt(0)||("."+i.hostname).substr(-e.domain.length)!==e.domain))return!1;const n=i.pathname||"/",s=e.path;return!(n!==s&&(!n.startsWith(s)||!s.endsWith("/")&&"/"!==n.charAt(s.length))||e.secure&&"https:"!==i.protocol)}add(e){if(!e||!e.name)return!1;for(let t=0,i=this.cookies.length;t<i;t++)if(this.compare(this.cookies[t],e))return this.isExpired(e)?(this.cookies.splice(t,1),!1):(this.cookies[t]=e,!0);return this.isExpired(e)||this.cookies.push(e),!0}compare(e,t){return e.name===t.name&&e.path===t.path&&e.domain===t.domain&&e.secure===t.secure&&e.httponly===t.httponly}isExpired(e){return e.expires&&e.expires<new Date||!e.value}getPath(e){const t=(e||"/").split("/");t.pop();const i=t.join("/").trim();return"/"!==i.charAt(0)?"/":i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Jc,Jc.exports)),Jc.exports)),M=r(el()),y=o(u),D=r(nl()),x=cl(),L=["ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","dhparam","ecdhCurve","honorCipherOrder","key","maxVersion","minVersion","passphrase","pfx","rejectUnauthorized","secureContext","secureOptions","secureProtocol","servername","sessionIdContext","sigalgs"];function v(e){let t;try{t=l.parse(e)}catch(e){return!1}return("http:"===t.protocol||"https:"===t.protocol)&&t}function I(e,t){(t=t||{}).fetchRes=t.fetchRes||new d.PassThrough,t.cookies=t.cookies||new m.default,t.redirects=t.redirects||0,t.maxRedirects=isNaN(t.maxRedirects)?5:t.maxRedirects;const i=t.fetchRes,n=v(e);if(!n)return t.body&&"function"==typeof t.body.destroy&&(t.body.on("error",()=>!1),t.body.destroy()),setImmediate(()=>{const t=new Error("Unsupported protocol for URL "+e);t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i;t.cookie&&([].concat(t.cookie||[]).forEach(i=>{t.cookies.set(i,e)}),t.cookie=!1);let s,r,o=(t.method||"").toString().trim().toUpperCase()||"GET",u=!1;const h="https:"===n.protocol?c.default:a.default,f={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+M.version};if(Object.keys(t.headers||{}).forEach(e=>{(0,x.isProtoKey)(e.toLowerCase().trim())||(f[e.toLowerCase().trim()]=t.headers[e])}),t.userAgent&&(f["user-agent"]=t.userAgent),n.auth&&(f.Authorization="Basic "+Buffer.from(n.auth).toString("base64")),(s=t.cookies.get(e))&&(f.cookie=s),t.body){if(!1!==t.contentType&&(f["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"),"function"==typeof t.body.pipe)f["Transfer-Encoding"]="chunked",r=t.body,r.on("error",t=>{u||(u=!0,t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t))});else{if(t.body instanceof Buffer)r=t.body;else if("object"==typeof t.body)try{r=Buffer.from(Object.keys(t.body).map(e=>{const i=t.body[e].toString().trim();return encodeURIComponent(e)+"="+encodeURIComponent(i)}).join("&"))}catch(t){return u=!0,t.code=D.EFETCH,t.sourceUrl=e,setImmediate(()=>i.emit("error",t)),i}else r=Buffer.from(t.body.toString().trim());f["Content-Type"]=t.contentType||"application/x-www-form-urlencoded",f["Content-Length"]=r.length}o=(t.method||"").toString().trim().toUpperCase()||"POST"}let g;const w={method:o,host:n.hostname,path:n.path,port:n.port?n.port:"https:"===n.protocol?443:80,headers:f,rejectUnauthorized:!0,agent:!1};t.tls&&Object.keys(t.tls).forEach(e=>{L.includes(e)&&(w[e]=t.tls[e])}),"https:"!==n.protocol||!n.hostname||n.hostname===w.host||y.default.isIP(n.hostname)||w.servername||(w.servername=n.hostname);try{g=h.request(w)}catch(t){return u=!0,setImmediate(()=>{t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i}const b=(t,n=e)=>{u||(u=!0,t.code=D.EFETCH,t.sourceUrl=n,i.emit("error",t),g.abort())},C="number"==typeof t.timeout&&t.timeout>=0?t.timeout:6e4;return C&&g.setTimeout(C,()=>b(new Error("Request Timeout"))),g.on("error",e=>b(e)),g.on("response",s=>{let r;if(u)return;switch(s.headers["content-encoding"]){case"gzip":case"deflate":r=p.default.createUnzip()}if(s.headers["set-cookie"]&&[].concat(s.headers["set-cookie"]||[]).forEach(i=>{t.cookies.set(i,e)}),[301,302,303,307,308].includes(s.statusCode)&&s.headers.location){if(t.redirects++,t.redirects>t.maxRedirects)return b(new Error("Maximum redirect count exceeded"));let i;t.method="GET",t.body=!1;try{i=l.resolve(e,s.headers.location)}catch(e){i=s.headers.location}const r=v(i);if(!r)return b(new Error("Unsupported protocol for URL "+i),i);const o=r.hostname!==n.hostname,a="https:"===n.protocol&&"http:"===r.protocol;if(t.headers&&(o||a)){const e=["authorization","cookie","proxy-authorization"];Object.keys(t.headers).forEach(i=>{e.includes(i.toLowerCase())&&delete t.headers[i]})}return u=!0,s.resume(),g.abort(),I(i,t)}if(i.statusCode=s.statusCode,i.headers=s.headers,s.statusCode>=300&&!t.allowErrorResponse)return b(new Error("Invalid status code "+s.statusCode));s.on("error",e=>b(e));const o="number"==typeof t.maxBytes&&t.maxBytes>0?t.maxBytes:67108864,a=r||s;let c=0;a.on("data",e=>{c+=e.length,c<=o||u||(a.unpipe(i),b(new Error("Response size exceeds the allowed "+o+" bytes")))}),r?(s.pipe(r).pipe(i),r.on("error",e=>b(e))):s.pipe(i)}),setImmediate(()=>{if(r)try{if("function"==typeof r.pipe)return r.pipe(g);g.write(r)}catch(e){return b(e)}g.end()}),i}I.Cookies=m.default,I.DEFAULT_TIMEOUT=6e4,t.default=I,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Rc,Rc.exports)),Rc.exports}function ul(){return ol||(ol=1,function(e){var t,i=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=Nn&&Nn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var r=t(e),o=0;o<r.length;o++)"default"!==r[o]&&i(s,e,r[o]);return n(s,e),s}),r=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeXText=e.assign=e.parseDataURI=e.callbackPromise=e.getLogger=e._logFunc=e.parseConnectionUrl=e.resolveHostname=e.dnsCache=e.networkInterfaces=e._resetCacheCleanup=e._lastCacheCleanup=e.copyOwnKeys=e.isProtoKey=void 0,e.resolveContent=function(t,i,n,s){s||"function"!=typeof n||(s=n,n=!1);let r;n=n||{},s||(r=new Promise((t,i)=>{s=(0,e.callbackPromise)(t,i)}));return function(t,i,n,s){let r=t&&t[i]&&t[i].content||t[i];const o=("object"==typeof t[i]&&t[i].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!r)return s(null,r);if("object"==typeof r){if("function"==typeof r.pipe)return b(r,(e,n)=>{if(e)return s(e);t[i].content?t[i].content=n:t[i]=n,s(null,n)});if(/^data:/i.test(r.path||r.href)){const t=(0,e.parseDataURI)(r.path||r.href);return s(null,t&&t.data?t.data:Buffer.alloc(0))}if(r.href||/^https?:\/\//i.test(r.path)){const e=r.href||r.path;return n.disableUrlAccess?void setImmediate(()=>{const t=new Error("Url access rejected for "+e);t.code=p.EURLACCESS,s(t)}):b((0,l.default)(e,{headers:r.httpHeaders,tls:r.tls}),s)}if(r.path)return n.disableFileAccess?void setImmediate(()=>{const e=new Error("File access rejected for "+r.path);e.code=p.EFILEACCESS,s(e)}):b(c.default.createReadStream(r.path),s)}"string"!=typeof t[i].content||["utf8","usascii","ascii"].includes(o)||(r=Buffer.from(t[i].content,o));setImmediate(()=>s(null,r))}(t,i,n,s),r};const o=s(Vc()),a=r(d),c=r(m),l=r(ll()),p=s(nl()),h=cl();Object.defineProperty(e,"isProtoKey",{enumerable:!0,get:function(){return h.isProtoKey}}),Object.defineProperty(e,"copyOwnKeys",{enumerable:!0,get:function(){return h.copyOwnKeys}});const f=r(M),g=r(u),w=r(y),D=3e5;let x=0;e._lastCacheCleanup=()=>x;e._resetCacheCleanup=()=>{x=0};try{e.networkInterfaces=w.default.networkInterfaces()}catch(e){}const L=(t,i)=>{const n=Object.values(e.networkInterfaces||{}).flat();return!n.length||n.filter(e=>!e.internal||i).some(e=>e.family==="IPv"+t||e.family===t)},v=(e,t,i,n)=>{if(!L(e,(i=i||{}).allowInternalNetworkInterfaces))return n(null,[]);(f.default.Resolver?new f.default.Resolver(i):f.default)["resolve"+e](t,(e,t)=>{if(e){switch(e.code){case f.default.NODATA:case f.default.NOTFOUND:case f.default.NOTIMP:case f.default.SERVFAIL:case f.default.CONNREFUSED:case f.default.REFUSED:case"EAI_AGAIN":return n(null,[])}return n(e)}return n(null,Array.isArray(t)?t:[].concat(t||[]))})};e.dnsCache=new Map;const I=(e,t)=>{if(!e)return Object.assign({},t||{});const i=e.addresses||[],n=i.length>0?i[Math.floor(Math.random()*i.length)]:null;return Object.assign({host:n,_addresses:i},t||{})};e.resolveHostname=(t,i)=>{if(!(t=t||{}).host&&t.servername&&(t.host=t.servername),!t.host||g.default.isIP(t.host)){const e={addresses:[t.host]};return i(null,I(e,{servername:t.servername||!1,cached:!1}))}const n=t.host,s=t.servername||n;let r;if(e.dnsCache.has(t.host)){r=e.dnsCache.get(t.host);const n=Date.now();if(n-x>3e4){x=n;for(const[t,i]of e.dnsCache.entries())i.expires&&i.expires<n&&e.dnsCache.delete(t);if(e.dnsCache.size>1e3){const t=Math.floor(100);Array.from(e.dnsCache.keys()).slice(0,t).forEach(t=>e.dnsCache.delete(t))}}if(!r.expires||r.expires>=n)return i(null,I(r.value,{servername:s,cached:!0}))}let o=[],a=[],c=null,l=null;v(4,t.host,t,(u,p)=>{u?c=u:o=p||[],v(6,n,t,(u,p)=>{u?l=u:a=p||[];const d=o.concat(a);if(d.length){const r={addresses:d};return e.dnsCache.set(n,{value:r,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r,{servername:s,cached:!1}))}if(c&&l&&r)return e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:c}));try{f.default.lookup(n,{all:!0},(o,a)=>{if(o)return r?(e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:o}))):i(o);const c=a?a.filter(e=>L(e.family)).map(e=>e.address):[];if(a&&a.length&&!c.length&&console.warn(`Failed to resolve IPv${a[0].family} addresses with current network`),!c.length&&r)return i(null,I(r.value,{servername:s,cached:!0}));const l={addresses:c.length?c:[n]};return e.dnsCache.set(n,{value:l,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(l,{servername:s,cached:!1}))})}catch(o){return r?(e.dnsCache.set(n,{value:r.value,expires:Date.now()+(t.dnsTtl||D)}),i(null,I(r.value,{servername:s,cached:!0,error:o}))):i(c||l||o)}})})};e.parseConnectionUrl=e=>{e=e||"";const t={},i=o.parse(e,!0);switch(i.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0}return!isNaN(i.port)&&Number(i.port)&&(t.port=Number(i.port)),i.hostname&&(t.host=i.hostname),(i.username||i.password)&&(t.auth={user:i.username||"",pass:i.password||""}),Object.keys(i.query||{}).forEach(e=>{let n=t,s=e,r=i.query[e];switch(isNaN(r)||(r=Number(r)),r){case"true":r=!0;break;case"false":r=!1}if(0===e.indexOf("tls."))s=e.substr(4),t.tls||(t.tls={}),n=t.tls;else if(e.indexOf(".")>=0)return;(0,h.isProtoKey)(s)||s in n||(n[s]=r)}),t};e._logFunc=(e,t,i,n,s,...r)=>{const o=Object.assign({},i||{},n||{});delete o.level;let a=t;"function"!=typeof e[a]&&(a=["info","debug","log","trace","warn","error"].find(t=>"function"==typeof e[t])),a&&e[a](o,s,...r)};e.getLogger=(t,i)=>{const n={},s=["trace","debug","info","warn","error","fatal"];if(!(t=t||{}).logger)return s.forEach(e=>{n[e]=()=>!1}),n;const r=!0===t.logger?function(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0),i=new Map;e.forEach(e=>{let n=e.toUpperCase();n.length<t&&(n+=" ".repeat(t-n.length)),i.set(e,n)});const n=(e,t,n,...s)=>{let r="";t&&("server"===t.tnx?r="S: ":"client"===t.tnx&&(r="C: "),t.sid&&(r="["+t.sid+"] "+r),t.cid&&(r="[#"+t.cid+"] "+r)),(n=a.default.format(n,...s)).split(/\r?\n/).forEach(t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),i.get(e),r+t)})},s={};return e.forEach(e=>{s[e]=n.bind(null,e)}),s}(s):t.logger;return s.forEach(t=>{n[t]=(...n)=>{const s="string"==typeof n[0]?void 0:n.shift();(0,e._logFunc)(r,t,i,s,...n)}}),n};e.callbackPromise=(e,t)=>function(...i){const n=i.shift();n?t(n):e(...i)};e.parseDataURI=e=>{if("string"!=typeof e)return null;if(!e.startsWith("data:"))return null;const t=e.indexOf(",");if(-1===t)return null;const i=e.substring(t+1);let n;const s=e.substring(5,t).split(";");if(s.length>0){const e=s[s.length-1].toLowerCase().trim();["base64","utf8","utf-8"].includes(e)&&-1===e.indexOf("=")&&(n=e,s.pop())}const r=s.length>0?s.shift():"application/octet-stream",o={};for(let e=0;e<s.length;e++){const t=s[e],i=t.indexOf("=");if(i>0){const e=t.substring(0,i).trim(),n=t.substring(i+1).trim();e&&!(0,h.isProtoKey)(e)&&(o[e]=n)}}let a;try{if("base64"===n)a=Buffer.from(i,"base64");else try{a=Buffer.from(decodeURIComponent(i))}catch(e){a=Buffer.from(i)}}catch(e){a=Buffer.alloc(0)}return{data:a,encoding:n||null,contentType:r||"application/octet-stream",params:o}};e.assign=function(...e){const t=e.shift()||{};return e.forEach(e=>{Object.keys(e||{}).forEach(i=>{(0,h.isProtoKey)(i)||(["tls","auth"].includes(i)&&e[i]&&"object"==typeof e[i]?t[i]=(0,h.copyOwnKeys)(t[i]||{},e[i]):t[i]=e[i])})}),t};function b(e,t){let i=!1;const n=[];let s=0;e.on("error",e=>{i||(i=!0,t(e))}),e.on("readable",()=>{let t;for(;null!==(t=e.read());)n.push(t),s+=t.length}),e.on("end",()=>{if(i)return;let e;i=!0;try{e=Buffer.concat(n,s)}catch(e){return t(e)}t(null,e)})}e.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e))return e;const t=Buffer.from(e);let i="";for(let e=0,n=t.length;e<n;e++){const n=t[e];i+=n<33||n>126||43===n||61===n?"+"+(n<16?"0":"")+n.toString(16).toUpperCase():String.fromCharCode(n)}return i}}(_c)),_c}var pl,dl={};function ml(){if(pl)return dl;pl=1;var e=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dl,"__esModule",{value:!0}),dl.detectMimeType=function(e){if(!e)return i;const n=t.default.parse(e),s=(n.ext.substr(1)||n.name||"").split("?").shift().trim().toLowerCase(),o=r.has(s)?r.get(s):i;if(Array.isArray(o))return o[0];return o},dl.detectExtension=function(e){if(!e)return n;const t=e.toLowerCase().trim().split("/"),i=t.shift().trim(),r=t.join("/").trim();if(s.has(i+"/"+r)){const e=s.get(i+"/"+r);return Array.isArray(e)?e[0]:e}if("text"===i)return"txt";return"bin"};const t=e(D),i="application/octet-stream",n="bin",s=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/geo+json","geojson"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]),r=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);return dl}var hl,fl={exports:{}},gl={exports:{}},wl={},Ml={};function yl(){if(hl)return Ml;hl=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.Encoder=void 0,Ml.encode=t,Ml.wrap=i;const e=w;function t(e){return"string"==typeof e&&(e=Buffer.from(e,"utf-8")),e.toString("base64")}function i(e,t){if(e=(e||"").toString(),t=Math.max(Number(t)||76,1),e.length<=t)return e;const i=[];let n=0;const s=1024*t,r=new RegExp(".{"+t+"}","g");for(;n<e.length;){const t=e.substr(n,s).replace(r,"$&\r\n").trim();i.push(t),n+=s}return i.join("\r\n").trim()}class n extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this._remainingBytes=!1,this.inputBytes=0,this.outputBytes=0}_transform(e,n,s){let r="buffer"!==n?Buffer.from(e,n):e;if(!r||!r.length)return void setImmediate(s);this.inputBytes+=r.length,this._remainingBytes&&this._remainingBytes.length&&(r=Buffer.concat([this._remainingBytes,r],this._remainingBytes.length+r.length),this._remainingBytes=!1),r.length%3?(this._remainingBytes=r.slice(r.length-r.length%3),r=r.slice(0,r.length-r.length%3)):this._remainingBytes=!1;let o=this._curLine+t(r);if(this.options.lineLength){o=i(o,this.options.lineLength);const e=o.lastIndexOf("\n");e<0?(this._curLine=o,o=""):e===o.length-1?this._curLine="":(this._curLine=o.substring(e+1),o=o.substring(0,e+1))}o&&(this.outputBytes+=o.length,this.push(Buffer.from(o,"ascii"))),setImmediate(s)}_flush(e){this._remainingBytes&&this._remainingBytes.length&&(this._curLine+=t(this._remainingBytes)),this._curLine&&(this._curLine=i(this._curLine,this.options.lineLength),this.outputBytes+=this._curLine.length,this.push(Buffer.from(this._curLine,"ascii")),this._curLine=""),e()}}return Ml.Encoder=n,Ml}var Dl,xl,Ll={};function vl(){if(Dl)return Ll;Dl=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.Encoder=void 0,Ll.encode=n,Ll.wrap=s;const e=w,t=4,i=[[9],[10],[13],[32,60],[62,126]];function n(e){"string"==typeof e&&(e=Buffer.from(e,"utf-8"));let t,n="";for(let s=0,o=e.length;s<o;s++)t=e[s],r(t,i)&&(32!==t&&9!==t||s!==o-1&&10!==e[s+1]&&13!==e[s+1])?n+=String.fromCharCode(t):n+="="+(t<16?"0":"")+t.toString(16).toUpperCase();return n}function s(e,i){if(e=(e||"").toString(),i=Math.max(Number(i)||76,t),e.length<=i)return e;let n=0;const s=e.length;let r,o,a;const c=Math.floor(i/3);let l="";for(;n<s;)if(a=e.substr(n,i),r=a.match(/\r\n/))a=a.substr(0,r.index+r[0].length),l+=a,n+=a.length;else if("\n"!==a.substr(-1))if(r=a.substr(-c).match(/\n.*?$/))a=a.substr(0,a.length-(r[0].length-1)),l+=a,n+=a.length;else{if(a.length>i-c&&(r=a.substr(-c).match(/[ \t.,!?][^ \t.,!?]*$/)))a=a.substr(0,a.length-(r[0].length-1));else if(a.match(/[=][\da-f]{0,2}$/i))for((r=a.match(/[=][\da-f]{0,1}$/i))&&(a=a.substr(0,a.length-r[0].length));a.length>3&&a.length<s-n&&!a.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(r=a.match(/[=][\da-f]{2}$/gi))&&(o=parseInt(r[0].substr(1,2),16),!(o<128))&&(a=a.substr(0,a.length-3),!(o>=192)););a.length||(a=e.substr(n,i)),n+a.length<s&&"\n"!==a.substr(-1)?(a.length===i&&a.match(/[=][\da-f]{2}$/i)?a=a.substr(0,a.length-3):a.length===i&&(a=a.substr(0,a.length-1)),n+=a.length,a+="=\r\n"):n+=a.length,l+=a}else l+=a,n+=a.length;return l}function r(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.length){if(1===n.length&&e===n[0])return!0;if(2===n.length&&e>=n[0]&&e<=n[1])return!0}}return!1}class o extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(e,t,i){let r;if("buffer"!==t&&(e=Buffer.from(e,t)),!e||!e.length)return i();this.inputBytes+=e.length,this.options.lineLength?(r=this._curLine+n(e),r=s(r,this.options.lineLength),r=r.replace(/(^|\n)([^\n]*)$/,(e,t,i)=>(this._curLine=i,t)),r&&(this.outputBytes+=r.length,this.push(r))):(r=n(e),this.outputBytes+=r.length,this.push(r,"ascii")),i()}_flush(e){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),e()}}return Ll.Encoder=o,Ll}function Il(){if(xl)return wl;xl=1;var e,t=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=Nn&&Nn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var s={};if(null!=n)for(var r=e(n),o=0;o<r.length;o++)"default"!==r[o]&&t(s,n,r[o]);return i(s,n),s});Object.defineProperty(wl,"__esModule",{value:!0}),wl.isPlainText=c,wl.quoteString=function(e){return'"'+(e||"").toString().replace(/["\\]/g,"\\$&")+'"'},wl.hasLongerLines=function(e,t){if(e.length>131072)return!0;return new RegExp("^.{"+(t+1)+",}","m").test(e)},wl.encodeWord=l,wl.encodeWords=function(e,t,i,n){i=i||0;const s=e.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!s)return e;if(n)return l(e,t,i);const r=e.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!r)return e;const o=s.index+(s[0].match(/[^\s]/)||{index:0}).index,a=r.index+(r[1]||"").length;return(o?e.substr(0,o):"")+l(e.substring(o,a),t||"Q",i)+(a<e.length?e.substr(a):"")},wl.buildHeaderValue=function(e){const t=[];Object.keys(e.params||{}).forEach(i=>{const n=e.params[i],s=i.replace(/[\x00-\x1f\x7f]/g,"");!c(n,!0)||n.length>=75?u(s,n,50).forEach(e=>{/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(e.value)&&"*"!==e.key.substr(-1)?t.push(e.key+"="+JSON.stringify(e.value)):t.push(e.key+"="+e.value)}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)?t.push(s+"="+JSON.stringify(n)):t.push(s+"="+n)});return("string"==typeof e.value?e.value.replace(/[\x00-\x1f\x7f]/g,""):e.value)+(t.length?"; "+t.join("; "):"")},wl.buildHeaderParam=u,wl.parseHeaderValue=function(e){const t={value:"",params:{}},i=(e,i)=>{(0,a.isProtoKey)(e)||(t.params[e]=i)};let n,s=!1,r="",o="value",c=!1,l=!1;for(let a=0,u=e.length;a<u;a++)if(n=e.charAt(a),"key"===o){if("="===n){s=r.trim().toLowerCase(),o="value",r="";continue}r+=n}else{if(l)r+=n;else{if("\\"===n){l=!0;continue}c&&n===c?c=!1:c||'"'!==n?c||";"!==n?r+=n:(!1===s?t.value=r.trim():i(s,r.trim()),o="key",r=""):c=n}l=!1}"value"===o?!1===s?t.value=r.trim():i(s,r.trim()):r.trim()&&i(r.trim().toLowerCase(),"");return Object.keys(t.params).forEach(e=>{let i,n,s,r;if(s=e.match(/(\*(\d+)|\*(\d+)\*|\*)$/)){if(i=e.substr(0,s.index),n=Number(s[2]||s[3])||0,(0,a.isProtoKey)(i))return void delete t.params[e];t.params[i]&&"object"==typeof t.params[i]||(t.params[i]={charset:!1,values:[]}),r=t.params[e],0===n&&"*"===s[0].substr(-1)&&(s=r.match(/^([^']*)'[^']*'(.*)$/))&&(t.params[i].charset=s[1]||"iso-8859-1",r=s[2]),t.params[i].values[n]=r,delete t.params[e]}}),Object.keys(t.params).forEach(e=>{let i;t.params[e]&&Array.isArray(t.params[e].values)&&(i=t.params[e].values.map(e=>e||"").join(""),t.params[e].charset?t.params[e]="=?"+t.params[e].charset+"?Q?"+i.replace(/[=?_\s]/g,e=>{const t=e.charCodeAt(0).toString(16);return" "===e?"_":"%"+(t.length<2?"0":"")+t}).replace(/%/g,"=")+"?=":t.params[e]=i)}),t},wl.detectExtension=function(e){return o.detectExtension(e)},wl.detectMimeType=function(e){return o.detectMimeType(e)},wl.foldLines=function(e,t,i){e=(e||"").toString(),t=t||76;let n=0;const s=e.length;let r,o,a="";for(;n<s;){if(r=e.substr(n,t),r.length<t){a+=r;break}(o=r.match(/^[^\n\r]*(\r?\n|\r)/))?(r=o[0],a+=r,n+=r.length):((o=r.match(/(\s+)[^\s]*$/))&&o[0].length-(i?(o[1]||"").length:0)<r.length?r=r.substr(0,r.length-(o[0].length-(i?(o[1]||"").length:0))):(o=e.substr(n+r.length).match(/^[^\s]+(\s*)/))&&(r+=o[0].substr(0,o[0].length-(i?0:(o[1]||"").length))),a+=r,n+=r.length,n<s&&(a+="\r\n"))}return a},wl.splitMimeEncodedString=p,wl.encodeURICharComponent=d,wl.safeEncodeURIComponent=m;const s=n(yl()),r=n(vl()),o=n(ml()),a=cl();function c(e,t){return"string"==typeof e&&!(t?/[\x00-\x1f\x7f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(e)}function l(e,t,i){let n;if((i=i||0)&&i>12&&(i-=12),"Q"===(t=(t||"Q").toString().toUpperCase().trim().charAt(0))?n=r.encode(e).replace(/[^a-z0-9!*+\-/=]/gi,e=>{const t=e.charCodeAt(0).toString(16).toUpperCase();return" "===e?"_":"="+(1===t.length?"0"+t:t)}):"B"===t&&(n="string"==typeof e?e:e.toString("utf-8"),i=i?Math.max(3,(i-i%4)/4*3):0),i&&("B"!==t?n:s.encode(e)).length>i)if("Q"===t)n=p(n,i).join("?= =?UTF-8?"+t+"?");else{const e=[];let r="";for(let t=0,o=n.length;t<o;t++){let o=n.charAt(t);/[\ud800-\udbff]/.test(o)&&/[\udc00-\udfff]/.test(n.charAt(t+1))&&(o+=n.charAt(++t)),Buffer.byteLength(r+o)<=i||0===t?r+=o:(e.push(s.encode(r)),r=o)}r&&e.push(s.encode(r)),n=e.length>1?e.join("?= =?UTF-8?"+t+"?"):e.join("")}else"B"===t&&(n=s.encode(e));return"=?UTF-8?"+t+"?"+n+("?="===n.substr(-2)?"":"?=")}function u(e,t,i){const n=[];let s,r,o,a,l="string"==typeof t?t:(t||"").toString(),u=0;if(i=i||50,c(t,!0)){if(l.length<=i)return[{key:e,value:l}];l=l.replace(new RegExp(".{"+i+"}","g"),e=>(n.push({line:e}),"")),l&&n.push({line:l})}else{if(/[\uD800-\uDBFF]/.test(l)){const e=[];for(o=0,a=l.length;o<a;o++)s=l.charAt(o),/[\ud800-\udbff]/.test(s)&&/[\udc00-\udfff]/.test(l.charAt(o+1))?(s+=l.charAt(o+1),e.push(s),o++):e.push(s);l=e}r="utf-8''";let e=!0;for(u=0,o=0,a=l.length;o<a;o++){if(s=l[o],e)s=m(s);else if(s=" "===s?s:m(s),s!==l[o]){if(!((m(r)+s).length>=i)){e=!0,o=u,r="";continue}n.push({line:r,encoded:e}),r="",e=!0}(r+s).length>=i?(n.push({line:r,encoded:e}),r=s=" "===l[o]?" ":m(l[o]),s===l[o]?(e=!1,u=o-1):e=!0):r+=s}r&&n.push({line:r,encoded:e})}return n.map((t,i)=>({key:e+"*"+i+(t.encoded?"*":""),value:t.line}))}function p(e,t){const i=[];let n,s,r,o,a;for(t=Math.max(t||0,12);e.length;){for(n=e.substr(0,t),(r=n.match(/[=][0-9A-F]?$/i))&&(n=n.substr(0,r.index)),s=n.length?n:e.substr(0,t),a=!1;!a&&n.length;)a=!0,(r=e.substr(n.length).match(/^[=]([0-9A-F]{2})/i))&&(o=parseInt(r[1],16),o<194&&o>127&&(n=n.substr(0,n.length-3),a=!1));n.length||(n=s),i.push(n),e=e.substr(n.length)}return i}function d(e){let t="",i=e.charCodeAt(0).toString(16).toUpperCase();if(i.length%2&&(i="0"+i),i.length>2)for(let e=0,n=i.length/2;e<n;e++)t+="%"+i.substr(e,2);else t+="%"+i;return t}function m(e){e=(e||"").toString();try{e=encodeURIComponent(e)}catch(t){e=encodeURIComponent(Buffer.from(e,"utf-8").toString("utf-8"))}return e.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,e=>d(e))}return wl}var bl,Cl={exports:{}};function El(){return bl||(bl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=/\s/,n=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,s=/^[^@\s]+@[^@\s]+$/,r=/^[^@\s]+@\S+$/,o=/\s*\b[^@\s]+@[^\s]+\b\s*/y;function a(e){return 32===e||e>=9&&e<=13||160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||95===e}function l(e,t){return c(e.charCodeAt(t-1))!==c(e.charCodeAt(t))}function u(e,t,i){for(let n=t;n<i;n++)if(64===e.charCodeAt(n))return n;return-1}function p(e){const t=e.length;let i=0;for(;i<t;){for(;i<t&&a(e.charCodeAt(i));)i++;if(i>=t)break;const n=i;let s=i;for(;s<t&&!a(e.charCodeAt(s));)s++;let r=u(e,n,s);if(r>=0){let t=-1;for(let i=s;i>n;i--)if(l(e,i)){t=i;break}let i=n;for(;t>=0&&r>=0;){if(r>i&&s>r+1&&t>r+1)for(let t=i;t<r;t++)if(l(e,t)){if(t>n)return t;let i=n;for(;i>0&&a(e.charCodeAt(i-1));)i--;return i}i=r+1,r=u(e,i,s)}}i=s}return-1}function d(e){const t=[];let i="",n="",s=0,r="",o="";for(let a=0,c=e.length;a<c;a++){const l=e.charAt(a);if(s)"\\"===l&&a<c-1?n+=e.charAt(++a):"("===l?(s++,n+=l):")"!==l||--s?n+=l:(t.push(n.trim()),n="","@"!==o&&"@"!==e.charAt(a+1)&&(i+=" ",o=" "));else{if(r){if("\\"===l&&'"'===r&&a<c-1){i+=l+e.charAt(++a),o=e.charAt(a);continue}l===r&&(r="")}else if('"'===l)r='"';else if("["===l)r="]";else if("("===l){s=1;continue}i+=l,o=l}}return s&&t.push(n.trim()),{address:i.trim(),comments:t.filter(e=>e)}}function m(e,t){let a=!1,c="text";const l=[],u={address:[],comment:[],group:[],text:[],textWasQuoted:[]};let m=!1;const h={address:"",comment:"",group:"",text:""};for(let t=0,i=e.length;t<i;t++){const i=e[t],n=t?e[t-1]:null;if("operator"===i.type)switch(i.value){case"<":c="address",m=!1;break;case"(":c="comment",m=!1;break;case":":c="group",a=!0,m=!1;break;case'"':m=!m,c="text";break;default:c="text",m=!1}else if(i.value){const s=t>1?e[t-2]:null,r="operator"===n?.type&&'"'===n.value&&!!n.noBreak&&"operator"===s?.type&&'"'===s.value;"address"===c&&(i.value=i.value.replace(/^[^<]*<\s*/,""));const o=u[c];n&&n.noBreak&&o.length&&(")"!==n.value||"@"===h[c]||"@"===i.value.charAt(0))?(u[c][u[c].length-1]+=i.value,i.value&&(h[c]=i.value.charAt(i.value.length-1)),"text"===c&&m&&(u.textWasQuoted[u.textWasQuoted.length-1]=!0)):(u[c].push(i.value),h[c]=i.value.charAt(i.value.length-1),"text"===c&&u.textWasQuoted.push(m||r))}}if(!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),a){u.text=u.text.join(" ");let e=[];if(u.group.length){g(u.group.join(","),{_depth:t+1}).forEach(t=>{t.group?e=e.concat(t.group):e.push(t)})}l.push({name:u.text||"",group:e})}else{const e=[],t=[];for(const i of u.address){if(i.indexOf("(")<0){t.push(i);continue}const n=d(i);for(const t of n.comments)e.push(t);n.address&&t.push(n.address)}if(u.address=t,!u.address.length&&u.text.length){for(let e=u.text.length-1;e>=0;e--)if(!u.textWasQuoted[e]&&s.test(u.text[e])){u.address=u.text.splice(e,1),u.textWasQuoted.splice(e,1);break}if(!u.address.length){let e=!1;for(let t=u.text.length-1;t>=0;t--)if(!u.textWasQuoted[t]){const i=u.text[t];let n=i;const s=p(i);if(s>=0){o.lastIndex=s;const t=o.exec(i);t&&(u.address=[t[0].trim()],e=!0,n=i.slice(0,s)+" "+i.slice(s+t[0].length))}if(u.text[t]=n.trim(),e)break}}}!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),u.address.length>1&&(u.text=u.text.concat(u.address.splice(1)));const a=!u.address.length&&u.textWasQuoted.some(e=>e);u.text=u.text.join(" "),u.address=u.address.join(" "),a&&u.text&&(u.address=function(e){const t=e.lastIndexOf("@");if(t<0)return e;const i=e.substr(0,t);return/^[^\s"(),:;<>@[\\\]]+$/.test(i)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(i)?e:'"'+i.replace(/["\\]/g,"\\$&")+'"@'+e.substr(t+1)}(u.text),u.text=""),function(e){if(!i.test(e.address))return;let t,o;const a=e.address.match(n);if(a){if(!a[2])return;t=a[1],o=[a[2]]}else{if(e.address.indexOf('"')>=0)return;const i=e.address.split(/\s+/);let n=i.findIndex(e=>s.test(e));if(n<0&&(n=i.findIndex(e=>r.test(e))),n<0)return;t=i.splice(n,1)[0],o=i}e.address=t,e.text=[e.text].concat(o).filter(e=>e).join(" ")}(u),!u.text&&e.length&&(u.text=e.join(" "));const c={address:u.address||u.text||"",name:u.text||u.address||""};c.address===c.name&&(/@/.test(c.address||"")?c.name="":c.address=""),l.push(c)}return l}class h{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.inDomainLiteral=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){const e=[];for(let e=0,t=this.str.length;e<t;e++){const i=this.str.charAt(e),n=e<t-1?this.str.charAt(e+1):null;this.checkChar(i,n)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(this.escaped||this.operatorExpecting||(this.inDomainLiteral||"["!==e?!this.inDomainLiteral||"]"!==e&&","!==e&&";"!==e||(this.inDomainLiteral=!1):this.inDomainLiteral=!0),this.escaped);else{if(e===this.operatorExpecting)return this.node={type:"operator",value:e},t&&![" ","\t","\r","\n",",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",void(this.escaped=!1);if(!this.operatorExpecting&&!this.inDomainLiteral&&e in this.operators)return this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],void(this.escaped=!1);if(['"',"'"].includes(this.operatorExpecting)&&"\\"===e)return void(this.escaped=!0)}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),"\n"===e&&(e=" "),(e.charCodeAt(0)>=33||[" ","\t"].includes(e))&&(this.node.value+=e),this.escaped=!1}}const f=50;function g(e,t){const i=(t=t||{})._depth||0;if(i>f)return[];const n=new h(e).tokenize(),s=[];let r=[],o=[];n.forEach(e=>{"operator"!==e.type||","!==e.value&&";"!==e.value?r.push(e):(r.length&&s.push(r),r=[])}),r.length&&s.push(r),s.forEach(e=>{const t=m(e,i);for(let e=0;e<t.length;e++)o.push(t[e])});const a=[];for(let e=o.length-1;e>=0;e--){const t=o[e],i=a.length?a[a.length-1]:null;i&&""===t.address&&t.name&&!t.group&&i.address&&i.name?i.name=t.name+", "+i.name:a.push(t)}if(a.reverse(),o=a,t.flatten){const e=[],t=i=>{i.forEach(i=>{if(i.group)return t(i.group);e.push(i)})};return t(o),e}return o}t.default=g,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Cl,Cl.exports)),Cl.exports}var Tl,Al={exports:{}};var Sl,Nl={exports:{}};function kl(){return Sl||(Sl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e),this.lastByte=!1}_transform(e,t,i){let n,s=0;for(let t=0,i=e.length;t<i;t++)10===e[t]&&(t&&13!==e[t-1]||!t&&13!==this.lastByte)&&(t>s&&(n=e.slice(s,t),this.push(n)),this.push(Buffer.from("\r\n")),s=t+1);s&&s<e.length?(n=e.slice(s),this.push(n)):s||this.push(e),this.lastByte=e[e.length-1],i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Nl,Nl.exports)),Nl.exports}var jl,Zl,zl,Yl={exports:{}};function Xl(){return jl||(jl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e)}_transform(e,t,i){let n,s=0;for(let t=0,i=e.length;t<i;t++)13===e[t]&&(n=e.slice(s,t),s=t+1,this.push(n));s&&s<e.length?(n=e.slice(s),this.push(n)):s||this.push(e),i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Yl,Yl.exports)),Yl.exports}function Fl(){return Zl||(Zl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(x),c=o(m),l=r(Bc()),u=w,d=r(ul()),h=o(p),f=r(Il()),g=r(vl()),M=r(yl()),y=o(El()),D=o(ll()),L=r(nl()),v=o((Tl||(Tl=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(){super(),this.lastByte=!1}_transform(e,t,i){e.length&&(this.lastByte=e[e.length-1]),this.push(e),i()}_flush(e){return 10===this.lastByte?e():13===this.lastByte?(this.push(Buffer.from("\n")),e()):(this.push(Buffer.from("\r\n")),e())}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Al,Al.exports)),Al.exports)),I=o(kl()),b=o(Xl()),C=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"],E="[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~\\x80-\\uFFFF]",T=new RegExp("^"+E+"+(?:\\."+E+"+)*$"),A=/^"(?:[^"\\]|\\[\s\S])*"$/,S=/^[^\s"(),:;<>@[\\\]]+@[^\s"(),:;<>@[\\\]]+$/,N=/[/\\?#%\x00-\x20\x7F]/;function k(e){return e.replace(/[\x00-\x1f\x7f]+/g,"")}class j{constructor(e,t){this.nodeCounter=0,t=t||{},this.baseBoundary=k(t.baseBoundary||a.default.randomBytes(8).toString("hex")),this.boundaryPrefix=k(t.boundaryPrefix||"--_NmP"),this.disableFileAccess=!!t.disableFileAccess,this.disableUrlAccess=!!t.disableUrlAccess,this.normalizeHeaderKey=t.normalizeHeaderKey,this.date=t.parentNode?null:new Date,this.rootNode=t.rootNode||this,this.keepBcc=!!t.keepBcc,t.filename&&(this.filename=t.filename,e||(e=f.detectMimeType(this.filename.split(".").pop()))),this.textEncoding=(t.textEncoding||"").toString().trim().charAt(0).toUpperCase(),this.parentNode=t.parentNode,this.hostname=t.hostname,this.newline=t.newline,this.childNodes=[],this._nodeId=++this.rootNode.nodeCounter,this._headers=[],this._isPlainText=!1,this._hasLongLines=!1,this._envelope=!1,this._raw=!1,this._transforms=[],this._processFuncs=[],e&&this.setHeader("Content-Type",e)}createChild(e,t){t||"object"!=typeof e||(t=e,e=void 0);const i=new j(e,t);return this.appendChild(i),i}appendChild(e){return e.parentNode&&e.parentNode!==this&&e.remove(),e.rootNode!==this.rootNode&&(e.rootNode=this.rootNode,e._nodeId=++this.rootNode.nodeCounter),e.parentNode=this,this.childNodes.push(e),e}replace(e){return e===this?this:(this.parentNode.childNodes.forEach((t,i)=>{t===this&&(e.rootNode=this.rootNode,e.parentNode=this.parentNode,e._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,e.parentNode.childNodes[i]=e)}),e)}remove(){if(!this.parentNode)return this;for(let e=this.parentNode.childNodes.length-1;e>=0;e--)if(this.parentNode.childNodes[e]===this)return this.parentNode.childNodes.splice(e,1),this.parentNode=void 0,this.rootNode=this,this}setHeader(e,t){let i=!1;if(!t&&e&&"object"==typeof e)return e.key&&"value"in e?this.setHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.setHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.setHeader(t,e[t])}),this;const n={key:e=this._normalizeHeaderKey(e),value:t};for(let t=0,s=this._headers.length;t<s;t++)this._headers[t].key===e&&(i?(this._headers.splice(t,1),t--,s--):(this._headers[t]=n,i=!0));return i||this._headers.push(n),this}addHeader(e,t){return!t&&e&&"object"==typeof e?(e.key&&e.value?this.addHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.addHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.addHeader(t,e[t])}),this):Array.isArray(t)?(t.forEach(t=>{this.addHeader(e,t)}),this):(this._headers.push({key:this._normalizeHeaderKey(e),value:t}),this)}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,i=this._headers.length;t<i;t++)if(this._headers[t].key===e)return this._headers[t].value}setContent(e){return this.content=e,"function"==typeof this.content.pipe?(this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler),this.content=e},this.content.once("error",this._contentErrorHandler)):"string"==typeof this.content&&(this._isPlainText=f.isPlainText(this.content),this._isPlainText&&f.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=this.createReadStream(),s=[];let r=0,o=!1;return n.on("readable",()=>{let e;for(;null!==(e=n.read());)s.push(e),r+=e.length}),n.once("error",e=>{if(!o)return o=!0,i(e)}),n.once("end",e=>{if(!o)return o=!0,e&&e.length&&(s.push(e),r+=e.length),i(null,Buffer.concat(s,r))}),t}getTransferEncoding(){let e=!1;const t=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();return this.content&&(e=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim(),e&&["base64","quoted-printable"].includes(e)||(/^text\//i.test(t)?e=this._isPlainText&&!this._hasLongLines?"7bit":"string"==typeof this.content||this.content instanceof Buffer?"Q"===this._getTextEncoding(this.content)?"quoted-printable":"base64":"B"===this.textEncoding?"base64":"quoted-printable":/^(multipart|message)\//i.test(t)||(e=e||"base64"))),e}buildHeaders(){const e=this.getTransferEncoding(),t=[];if(e&&this.setHeader("Content-Transfer-Encoding",e),this.filename&&!this.getHeader("Content-Disposition")&&this.setHeader("Content-Disposition","attachment"),this.rootNode===this){this.getHeader("Date")||this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000")),this.messageId(),this.getHeader("MIME-Version")||this.setHeader("MIME-Version","1.0");for(let e=this._headers.length-2;e>=0;e--){const t=this._headers[e];"Content-Type"===t.key&&(this._headers.splice(e,1),this._headers.push(t))}}return this._headers.forEach(e=>{let i,n,s=e.key,r=e.value;const o={};if(!r||"object"!=typeof r||C.includes(s)||(d.copyOwnKeys(o,r,e=>"value"===e),r=(r.value||"").toString(),r.trim()))if(o.prepared)o.foldLines?t.push(f.foldLines(s+": "+r)):t.push(s+": "+r);else{switch(e.key){case"Content-Disposition":i=f.parseHeaderValue(r),this.filename&&(i.params.filename=this.filename),r=f.buildHeaderValue(i);break;case"Content-Type":i=f.parseHeaderValue(r),i.value=(i.value||"").toString().replace(/[\x00-\x1f\x7f]/g,""),this._handleContentType(i),i.value.match(/^text\/plain\b/)&&"string"==typeof this.content&&/[\u0080-\uFFFF]/.test(this.content)&&(i.params.charset="utf-8"),r=f.buildHeaderValue(i),this.filename&&(n=/[\x00-\x1f\x7f]/.test(this.filename)?f.encodeWord(this.filename,this._getTextEncoding(this.filename),52):this._encodeWords(this.filename),(n!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n))&&(n=JSON.stringify(n)),r+="; name="+n);break;case"Bcc":if(!this.keepBcc)return}if(r=this._encodeHeaderValue(s,r),(r||"").toString().trim()){if("function"==typeof this.normalizeHeaderKey){const e=this.normalizeHeaderKey(s,r),t="string"==typeof e?e.replace(/[\x00-\x1f\x7f]/g,""):"";t&&(s=t)}t.push(f.foldLines(s+": "+r,76))}}}),t.join("\r\n")}createReadStream(e){e=e||{};const t=new u.PassThrough(e);let i,n=t;this.stream(t,e,e=>{e?n.emit("error",e):t.end()});for(let e=0,t=this._transforms.length;e<t;e++)i="function"==typeof this._transforms[e]?this._transforms[e]():this._transforms[e],n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);i=new v.default,n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);for(let e=0,t=this._processFuncs.length;e<t;e++)i=this._processFuncs[e],n=i(n);if(this.newline){const e=["win","windows","dos","\r\n"].includes(this.newline.toString().toLowerCase())?new I.default:new b.default,t=n.pipe(e);return n.on("error",e=>t.emit("error",e)),t}return n}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,i){const n=this.getTransferEncoding();let s,r,o=!1;const a=e=>{o||(o=!0,i(e))},c=()=>{let i=0;const n=()=>{if(i>=this.childNodes.length)return e.write("\r\n--"+this.boundary+"--\r\n"),a();const s=this.childNodes[i++];e.write((i>1?"\r\n":"")+"--"+this.boundary+"\r\n"),s.stream(e,t,e=>{if(e)return a(e);setImmediate(n)})};if(!this.multipart)return a();setImmediate(n)},l=()=>{if(this.content){if("[object Error]"===Object.prototype.toString.call(this.content))return a(this.content);"function"==typeof this.content.pipe&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=e=>a(e),this.content.once("error",this._contentErrorHandler));const i=()=>{["quoted-printable","base64"].includes(n)?(s=new("base64"===n?M:g).Encoder(t),s.pipe(e,{end:!1}),s.once("end",c),s.once("error",e=>a(e)),r=this._getStream(this.content),r.pipe(s)):(r=this._getStream(this.content),r.pipe(e,{end:!1}),r.once("end",c)),r.once("error",e=>a(e))};if(this.content._resolve){const e=[];let t=0,n=!1;const s=this._getStream(this.content);s.on("error",e=>{n||(n=!0,a(e))}),s.on("readable",()=>{let i;for(;null!==(i=s.read());)e.push(i),t+=i.length}),s.on("end",()=>{n||(n=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(e,t),setImmediate(i))})}else setImmediate(i);return}return setImmediate(c)};this._raw?setImmediate(()=>{if("[object Error]"===Object.prototype.toString.call(this._raw))return a(this._raw);"function"==typeof this._raw.pipe&&this._raw.removeListener("error",this._contentErrorHandler);const t=this._getStream(this._raw);t.pipe(e,{end:!1}),t.on("error",t=>e.emit("error",t)),t.on("end",c)}):(e.write(this.buildHeaders()+"\r\n\r\n"),setImmediate(l))}setEnvelope(e){let t;this._envelope={from:!1,to:[]},e.from&&(t=[],this._convertAddresses(this._parseEnvelopeAddresses(e.from),t),t=t.filter(e=>e&&e.address),t.length&&t[0]&&(this._envelope.from=t[0].address));const i=new Set,n=[];["to","cc","bcc"].forEach(t=>{e[t]&&this._convertAddresses(this._parseEnvelopeAddresses(e[t]),n,i)}),this._envelope.to=n.map(e=>e.address).filter(e=>e);const s=["to","cc","bcc","from"];return d.copyOwnKeys(this._envelope,e,e=>s.includes(e)),this}getAddresses(){const e={},t=new Map;return this._headers.forEach(i=>{const n=i.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(n)&&(Array.isArray(e[n])||(e[n]=[],t.set(n,new Set)),this._convertAddresses(this._parseAddresses(i.value),e[n],t.get(n)))}),e}getEnvelope(){if(this._envelope)return this._envelope;const e={from:!1,to:[]},t=new Set,i=[];return this._headers.forEach(n=>{const s=[];"From"===n.key||!e.from&&["Reply-To","Sender"].includes(n.key)?(this._convertAddresses(this._parseAddresses(n.value),s),s.length&&s[0]&&(e.from=s[0].address)):["To","Cc","Bcc"].includes(n.key)&&this._convertAddresses(this._parseAddresses(n.value),i,t)}),e.to=i.map(e=>e.address),e}messageId(){let e=this.getHeader("Message-ID");return e||(e=this._generateMessageId(),this.setHeader("Message-ID",e)),e}setRaw(e){return this._raw=e,this._raw&&"function"==typeof this._raw.pipe&&(this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=e},this._raw.once("error",this._contentErrorHandler)),this}_accessDisabled(e){let t=this;for(;t;){if(t[e])return!0;t=t.parentNode}return!1}_getStream(e){let t;return e._resolvedValue?(t=new u.PassThrough,setImmediate(()=>{try{t.end(e._resolvedValue)}catch(e){t.emit("error",e)}}),t):"function"==typeof e.pipe?e:e&&"string"==typeof e.path&&!e.href?this._accessDisabled("disableFileAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("File access rejected for "+e.path);i.code=L.EFILEACCESS,t.emit("error",i)}),t):c.default.createReadStream(e.path):e&&"string"==typeof e.href?this._accessDisabled("disableUrlAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("Url access rejected for "+e.href);i.code=L.EURLACCESS,t.emit("error",i)}),t):(0,D.default)(e.href,{headers:e.httpHeaders,tls:e.tls}):(t=new u.PassThrough,setImmediate(()=>{try{t.end(e||"")}catch(e){t.emit("error",e)}}),t)}_parseAddresses(e){const t=[],i=new WeakSet,n=[],s=e=>{i.has(e)||(i.add(e),n.push({list:e,pos:0}))};for(s(Array.isArray(e)?e:[e]);n.length;){const e=n[n.length-1];if(e.pos>=e.list.length){n.pop();continue}const i=e.list[e.pos++];if(Array.isArray(i)){s(i);continue}if(i&&i.address){const e=this._normalizeAddress(i.address);if(e===i.address&&"string"==typeof i.name){t.push(i);continue}const n=d.copyOwnKeys({},i);n.address=e,n.name=i.name||"",t.push(n);continue}const r=this._normalizeParsedAddresses((0,y.default)(i));for(let e=0;e<r.length;e++)t.push(r[e])}return t}_normalizeParsedAddresses(e){return e.forEach(e=>{e.address?e.address=this._normalizeAddress(e.address):e.group&&this._normalizeParsedAddresses(e.group)}),e}_parseEnvelopeAddresses(e){return this._parseAddresses(e).map(e=>e.address||e.group||!e.name||/[\s@]/.test(e.name)?e:{address:this._normalizeAddress(e.name),name:""})}_normalizeHeaderKey(e){return e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x1f\x7f]/g,"").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,e=>e.toUpperCase()).replace(/^Content-Features$/i,"Content-features")}_handleContentType(e){if(this.contentType=e.value.trim().toLowerCase(),this.multipart=!!/^multipart\//i.test(this.contentType)&&this.contentType.substr(this.contentType.indexOf("/")+1),this.multipart){const t=k(e.params.boundary||this.boundary||"");this.boundary=e.params.boundary=t||k(this._generateBoundary())}else this.boundary=!1}_generateBoundary(){return k(this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary)+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){switch(e=this._normalizeHeaderKey(e)){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(t));case"Message-ID":case"In-Reply-To":case"Content-Id":return"<"!==(t=(t||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")).charAt(0)&&(t="<"+t),">"!==t.charAt(t.length-1)&&(t+=">"),t;case"References":return(t=[].concat.apply([],[].concat(t||"").map(e=>(e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").trim()).replace(/<[^>]*>/g,e=>e.replace(/\s/g,"")).split(/\s+/))).map(e=>("<"!==e.charAt(0)&&(e="<"+e),">"!==e.charAt(e.length-1)&&(e+=">"),e))).join(" ").trim();case"Date":return"[object Date]"===Object.prototype.toString.call(t)?t.toUTCString().replace(/GMT/,"+0000"):(t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t));case"Content-Type":case"Content-Disposition":return(t||"").toString().replace(/\r?\n|\r/g," ");default:return t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t)}}_convertAddresses(e,t,i){const n=[];if(t=t||[],!i){i=new Set;for(let e=0;e<t.length;e++)i.add(t[e].address)}return[].concat(e||[]).forEach(e=>{if(e.address)e.address=this._normalizeAddress(e.address),e.name?n.push(`${this._encodeAddressName(e.name)} <${e.address}>`):n.push(S.test(e.address)?e.address:`<${e.address}>`),i.has(e.address)||(i.add(e.address),t.push(e));else if(e.group){const s=(e.group.length?this._convertAddresses(e.group,t,i):"").trim();n.push(`${this._encodeAddressName(e.name)}:${s};`)}}),n.join(", ")}_normalizeAddress(e){if(!(e=(e||"").toString().replace(/[\x00-\x1F\x7F<>]+/g," ").trim()))return e;const t=e.lastIndexOf("@");if(t<0)return this._normalizeLocalPart(e);const i=e.substr(0,t),n=e.substr(t+1);let s=n;const r=/[\x80-\uFFFF]/.test(i);try{s=function(e,t){const i=t?h.default.domainToUnicode:h.default.domainToASCII;if("function"==typeof i&&!N.test(e)){const t=i(e);if(t)return t}return t?l.toUnicode(e):l.toASCII(e)}(n.toLowerCase(),r)}catch(e){}return`${this._normalizeLocalPart(i)}@${s}`}_normalizeLocalPart(e){return T.test(e)||A.test(e)?e:f.quoteString(e)}_encodeAddressName(e){return/^[\w ]*$/.test(e)?e:/^[\x20-\x7e]*$/.test(e)?f.quoteString(e):f.encodeWord(e,this._getTextEncoding(e),52)}_encodeHeaderText(e){return/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(e)?f.encodeWord(e,this._getTextEncoding(e),52):this._encodeWords(e)}_encodeWords(e){return f.encodeWords(e,this._getTextEncoding(e),52,!0)}_getTextEncoding(e){if(e=(e||"").toString(),this.textEncoding)return this.textEncoding;let t=0,i=0;for(let n=0,s=e.length;n<s;n++){const s=e.charCodeAt(n);s>=0&&s<=8||11===s||12===s||s>=14&&s<=31||s>=128?t++:(s>=65&&s<=90||s>=97&&s<=122)&&i++}return t<i?"Q":"B"}_generateMessageId(){return"<"+[2,2,2,6].reduce((e,t)=>e+"-"+a.default.randomBytes(t).toString("hex"),a.default.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}}t.default=j,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(gl,gl.exports)),gl.exports}var Ul,Gl={exports:{}},Pl={exports:{}};var Kl,Ol={exports:{}};var _l,Wl,Hl={exports:{}};function Bl(){return _l||(_l=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(Bc()),c=r(Il()),l=o(x),u=r(nl());function p(e){const t=new Error('Unsupported DKIM hash algorithm "'+e+'"');return t.code=u.ECONFIG,t}function d(e,t,i,n){const s=m(e,(n=n||{}).headerFieldNames||"From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive",n.skipFields),r=function(e,t,i,n,s){const r=e=>(e||"").toString().replace(/[\x00-\x1f\x7f;=]/g,""),o=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+a.toASCII(r(e)),"q=dns/txt","s="+r(t),"bh="+s,"h="+r(i)].join("; ");return c.foldLines("DKIM-Signature: "+o,76)+";\r\n b="}(n.domainName,n.keySelector,s.fieldNames,t,i);let o,u;s.headers+="dkim-signature:"+h(r);try{o=l.default.createSign(("rsa-"+t).toUpperCase())}catch(e){throw p(t)}o.update(s.headers,"latin1");try{u=o.sign(n.privateKey,"base64")}catch(e){return!1}return r+u.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,"$&\r\n ").trim()}function m(e,t,i){const n=new Set,s=new Set,r=new Map;(i||"").toLowerCase().split(":").forEach(e=>{s.add(e.trim())}),(t||"").toLowerCase().split(":").filter(e=>!s.has(e.trim())).forEach(e=>{n.add(e.trim())});for(let t=e.length-1;t>=0;t--){const i=e[t];n.has(i.key)&&!r.has(i.key)&&r.set(i.key,h(i.line))}const o=[],a=[];return n.forEach(e=>{r.has(e)&&(a.push(e),o.push(e+":"+r.get(e)))}),{headers:o.join("\r\n")+"\r\n",fieldNames:a.join(":")}}function h(e){return e.substr(e.indexOf(":")+1).replace(/\r?\n/g,"").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}d.relaxedHeaders=m,d.unsupportedHashAlgoError=p,t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Hl,Hl.exports)),Hl.exports}function Vl(){return Wl||(Wl=1,function(e,t){var i=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i((Ul||(Ul=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w;class n extends i.Transform{constructor(e){super(e),this.lastBytes=Buffer.alloc(4),this.headersParsed=!1,this.headerBytes=0,this.headerChunks=[],this.rawHeaders=!1,this.bodySize=0}updateLastBytes(e){const t=this.lastBytes.length,i=Math.min(e.length,t);for(let e=0,n=t-i;e<n;e++)this.lastBytes[e]=this.lastBytes[e+i];for(let n=1;n<=i;n++)this.lastBytes[t-n]=e[e.length-n]}checkHeaders(e){if(this.headersParsed)return!0;const t=this.lastBytes.length;let i=0;for(let n=0,s=this.lastBytes.length+e.length;n<s;n++){let s;if(s=n<t?this.lastBytes[n]:e[n-t],10===s&&n){const s=n-1<t?this.lastBytes[n-1]:e[n-1-t],r=n>1&&(n-2<t?this.lastBytes[n-2]:e[n-2-t]);if(10===s){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}if(13===s&&10===r){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}}}if(this.headersParsed){if(this.headerChunks.push(e.slice(0,i)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),e.length>i){const t=e.slice(i);this.bodySize+=t.length,setImmediate(()=>this.push(t))}return!1}return this.headerBytes+=e.length,this.headerChunks.push(e),this.updateLastBytes(e),!1}_transform(e,t,i){if(!e||!e.length)return i();let n;"string"==typeof e&&(e=Buffer.from(e,t));try{n=this.checkHeaders(e)}catch(e){return i(e)}n&&(this.bodySize+=e.length,this.push(e)),setImmediate(i)}_flush(e){this.headerChunks&&(this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders())),e()}parseHeaders(){const e=(this.rawHeaders||Buffer.alloc(0)).toString("binary").split(/\r?\n/),t=[];for(const i of e)t.length&&/^[ \t]/.test(i)?t[t.length-1]+="\n"+i:t.push(i);return t.filter(e=>/[^ \t\r]/.test(e)).map(e=>({key:e.substr(0,e.indexOf(":")).replace(/^[ \t]+|[ \t]+$/g,"").toLowerCase(),line:e}))}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Pl,Pl.exports)),Pl.exports)),s=i((Kl||(Kl=1,function(e,t){var i=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=w,s=i(x),r=Buffer.from("\r\n"),o=Buffer.alloc(4096,r);class a extends n.Transform{constructor(e){super(),e=e||{},this.bodyHash=s.default.createHash(e.hashAlgo||"sha256"),this.byteLength=0,this.debug=e.debug,this._debugBody=!!e.debug&&[],this._lineHasContent=!1,this._pendingWsp=!1,this._pendingCr=!1,this._pendingEmptyLines=0}_hashCanonical(e){e.length&&(this.bodyHash.update(e),this._debugBody&&this._debugBody.push(Buffer.from(e)))}_hashEmptyLines(){for(;this._pendingEmptyLines>0;){const e=Math.min(this._pendingEmptyLines,o.length/2);this._hashCanonical(o.subarray(0,2*e)),this._pendingEmptyLines-=e}}_emitContent(e,t,i){return this._lineHasContent||(this._pendingEmptyLines&&(this._hashCanonical(e.subarray(0,t)),t=0,this._hashEmptyLines()),this._lineHasContent=!0),this._pendingWsp&&(e[t++]=32,this._pendingWsp=!1),e[t++]=i,t}updateHash(e,t){const i=Buffer.allocUnsafe(2*e.length+2);let n=0;for(let t=0;t<e.length;t++){const s=e[t];10!==s?(this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),13===s?this._pendingCr=!0:32===s||9===s?this._pendingWsp=!0:n=this._emitContent(i,n,s)):(this._lineHasContent?(i[n++]=13,i[n++]=10,this._lineHasContent=!1):this._pendingEmptyLines++,this._pendingWsp=!1,this._pendingCr=!1)}t&&this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),this._hashCanonical(i.subarray(0,n))}_transform(e,t,i){if(!e||!e.length)return i();"string"==typeof e&&(e=Buffer.from(e,t)),this.updateHash(e),this.byteLength+=e.length,this.push(e),i()}_flush(e){this.updateHash(Buffer.alloc(0),!0),this._lineHasContent&&this._hashCanonical(r),this.emit("hash",this.bodyHash.digest("base64"),!!this.debug&&Buffer.concat(this._debugBody)),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ol,Ol.exports)),Ol.exports)),r=i(Bl()),o=w,a=i(m),c=i(D),l=i(x),u=cl();class p{constructor(e,t,i,n){this.options=e||{},this.keys=t,this.cacheTreshold=Number(this.options.cacheTreshold)||10485760,this.hashAlgo=this.options.hashAlgo||"sha256",this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=!!this.cacheDir&&c.default.join(this.cacheDir,"message."+Date.now()+"-"+l.default.randomBytes(14).toString("hex")),this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=i,this.output=n,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",e=>{this.hasErrored=!0,this.cleanup(),n.emit("error",e)})}cleanup(){this.cache&&this.cachePath&&a.default.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=a.default.createReadStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.output.emit("error",e)}),this.cache.once("close",()=>{this.cleanup()}),this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored)return;if(this.readPos>=this.chunks.length)return this.cache?this.createReadCache():void this.output.end();const e=this.chunks[this.readPos++];!1!==this.output.write(e)?setImmediate(()=>this.sendNextChunk()):this.output.once("drain",()=>{this.sendNextChunk()})}sendSignedOutput(){let e=0;const t=()=>{if(e>=this.keys.length)return this.output.write(this.parser.rawHeaders),void setImmediate(()=>this.sendNextChunk());const i=this.keys[e++];let n;try{n=(0,r.default)(this.headers,this.hashAlgo,this.bodyHash,{domainName:i.domainName,keySelector:i.keySelector,privateKey:i.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields})}catch(e){return this.hasErrored=!0,this.cleanup(),void this.output.emit("error",e)}n&&this.output.write(Buffer.from(n+"\r\n")),setImmediate(t)};if(this.bodyHash&&this.headers)return t();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=a.default.createWriteStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;null!==this.relaxedBody.read(););}),this.hasErrored=!0,this.output.emit("error",e)}),this.cache.once("close",()=>{this.sendSignedOutput()}),this.relaxedBody.removeAllListeners("readable"),this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new n.default,this.relaxedBody=new s.default({hashAlgo:this.hashAlgo}),this.parser.on("headers",e=>{this.headers=e}),this.relaxedBody.on("hash",e=>{this.bodyHash=e}),this.relaxedBody.on("readable",()=>{let e;if(!this.cache)for(;null!==(e=this.relaxedBody.read());)if(this.chunks.push(e),this.chunklen+=e.length,this.chunklen>=this.cacheTreshold&&this.cachePath)return this.createWriteCache()}),this.relaxedBody.on("end",()=>{this.cache||this.sendSignedOutput()}),this.parser.pipe(this.relaxedBody),setImmediate(()=>this.input.pipe(this.parser))}}t.default=class{constructor(e){this.options=e||{},this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){const i=new o.PassThrough;let n=e,s=!1;Buffer.isBuffer(e)?(s=e,n=new o.PassThrough):"string"==typeof e&&(s=Buffer.from(e),n=new o.PassThrough);let a=this.options;t&&Object.keys(t).length&&(a=(0,u.copyOwnKeys)({},t),(0,u.copyOwnKeys)(a,this.options));const c=new p(a,this.keys,n,i);return setImmediate(()=>{try{c.signStream()}catch(e){return void i.emit("error",r.default.unsupportedHashAlgoError(c.hashAlgo))}s&&setImmediate(()=>{n.end(s)})}),i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Gl,Gl.exports)),Gl.exports}var Ql,Rl={exports:{}};var Jl,ql,$l={exports:{}};function eu(){return ql||(ql=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=r(ul()),p=r(ml()),m=o((zl||(zl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(Fl()),c=r(Il()),l=ul();function u(e){const t=e;return"object"==typeof e&&!!(t.content||t.path||t.href||t.raw)}t.default=class{constructor(e){this.mail=e||{},this.message=!1}compile(){return this._alternatives=this.getAlternatives(),this._htmlNode=this._alternatives.filter(e=>/^text\/html\b/i.test(e.contentType)).pop(),this._attachments=this.getAttachments(!!this._htmlNode),this._useRelated=!(!this._htmlNode||!this._attachments.related.length),this._useAlternative=this._alternatives.length>1,this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&1===this._attachments.attached.length,this.mail.raw?this.message=new a.default("message/rfc822",{newline:this.mail.newline,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess}).setRaw(this.mail.raw):this._useMixed?this.message=this._createMixed():this._useAlternative?this.message=this._createAlternative():this._useRelated?this.message=this._createRelated():this.message=this._createContentNode(!1,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""}),this.mail.headers&&this.message.addHeader(this.mail.headers),["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach(e=>{const t=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase());this.mail[t]&&this.message.setHeader(e,this.mail[t])}),this.mail.envelope&&this.message.setEnvelope(this.mail.envelope),this.message.messageId(),this.message}getAttachments(e){let t;const i=[].concat(this.mail.attachments||[]).map((e,t)=>{/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e));const i=e.contentType||c.detectMimeType(e.filename||e.path||e.href||"bin"),n=/^image\//i.test(i),s=/^message\//i.test(i),r=e.contentDisposition||(s||n&&e.cid?"inline":"attachment");let o;o="contentTransferEncoding"in e?e.contentTransferEncoding:s?"8bit":"base64";const a={contentType:i,contentDisposition:r,contentTransferEncoding:o};return e.filename?a.filename=e.filename:s||!1===e.filename||(a.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(t+1),a.filename.indexOf(".")<0&&(a.filename+="."+c.detectExtension(a.contentType))),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.cid&&(a.cid=e.cid),e.raw?a.raw=e.raw:e.path?a.content={path:e.path}:e.href?a.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls}:a.content=e.content||"",e.encoding&&(a.encoding=e.encoding),e.headers&&(a.headers=e.headers),a});return this.mail.icalEvent&&(t=Object.assign({},this._getIcalEvent()),t.contentType="application/ics",t.headers||(t.headers={}),t.filename=t.filename||"invite.ics",t.headers["Content-Disposition"]="attachment",t.headers["Content-Transfer-Encoding"]="base64"),e?{attached:i.filter(e=>!e.cid).concat(t||[]),related:i.filter(e=>!!e.cid)}:{attached:i.concat(t||[]),related:[]}}_getIcalEvent(){if(!this._icalEvent){let e;e=u(this.mail.icalEvent)?(0,l.copyOwnKeys)({},this.mail.icalEvent):{content:this.mail.icalEvent},/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e)),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.raw||(e.path?(e.content={path:e.path},e.path=void 0):e.href&&(e.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls},e.href=void 0)),e.content&&"object"==typeof e.content&&(e.content._resolve=!0),this._icalEvent=e}return this._icalEvent}getAlternatives(){const e=[];let t,i,n,s,r;return this.mail.text&&(t=u(this.mail.text)?this.mail.text:{content:this.mail.text},t.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(n=u(this.mail.watchHtml)?this.mail.watchHtml:{content:this.mail.watchHtml},n.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(s=u(this.mail.amp)?this.mail.amp:{content:this.mail.amp},s.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(r=Object.assign({},this._getIcalEvent()),r.filename=!1,r.contentType="text/calendar; charset=utf-8; method="+(r.method||"PUBLISH").toString().trim().toUpperCase(),r.headers||(r.headers={})),this.mail.html&&(i=u(this.mail.html)?this.mail.html:{content:this.mail.html},i.contentType="text/html; charset=utf-8"),[].concat(t||[]).concat(n||[]).concat(s||[]).concat(i||[]).concat(r||[]).concat(this.mail.alternatives||[]).forEach(t=>{/^data:/i.test(t.path||t.href)&&(t=this._processDataUrl(t));const i={contentType:t.contentType||c.detectMimeType(t.filename||t.path||t.href||"txt"),contentTransferEncoding:t.contentTransferEncoding};t.filename&&(i.filename=t.filename),/^https?:\/\//i.test(t.path)&&(t.href=t.path,t.path=void 0),t.raw?i.raw=t.raw:t.path?i.content={path:t.path}:t.href?i.content={href:t.href,httpHeaders:t.httpHeaders,tls:t.tls}:i.content=t.content||"",t.encoding&&(i.encoding=t.encoding),t.headers&&(i.headers=t.headers),e.push(i)}),e}_createMixed(e){const t=e?e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._useAlternative?this._createAlternative(t):this._useRelated&&this._createRelated(t),[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach(e=>{this._useRelated&&e===this._htmlNode||this._createContentNode(t,e)}),t}_createAlternative(e){const t=e?e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._alternatives.forEach(e=>{this._useRelated&&this._htmlNode===e?this._createRelated(t):this._createContentNode(t,e)}),t}_createRelated(e){const t=e?e.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._createContentNode(t,this._htmlNode),this._attachments.related.forEach(e=>this._createContentNode(t,e)),t}_createContentNode(e,t){(t=t||{}).content=t.content||"";const i=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,""),n=e?e.createChild(t.contentType,{filename:t.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default(t.contentType,{filename:t.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return t.headers&&n.addHeader(t.headers),t.cid&&n.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">"),t.contentTransferEncoding?n.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(t.contentType)&&n.setHeader("Content-Transfer-Encoding",this.mail.encoding),/^text\//i.test(t.contentType)&&!t.contentDisposition||n.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment")),"string"!=typeof t.content||["utf8","usascii","ascii"].includes(i)||(t.content=Buffer.from(t.content,i)),t.raw?n.setRaw(t.raw):n.setContent(t.content),n}_processDataUrl(e){const t=e.path||e.href;if(!t||"string"!=typeof t)return e;if(!t.startsWith("data:"))return e;if(t.length>52428800){let i="application/octet-stream";const n=t.indexOf(",");if(n>0&&n<200){const e=t.substring(5,n).split(";");e[0]&&e[0].includes("/")&&(i=e[0].trim())}return Object.assign((0,l.copyOwnKeys)({},e),{path:!1,href:!1,content:Buffer.alloc(0),contentType:e.contentType||i})}let i;try{i=(0,l.parseDataURI)(t)}catch(t){return e}return i?(e.content=i.data,e.contentType=e.contentType||i.contentType,"path"in e&&(e.path=!1),"href"in e&&(e.href=!1),e):e}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(fl,fl.exports)),fl.exports)),h=o(Vl()),f=o((Ql||(Ql=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(u),c=o(L),l=r(Vc()),p=r(nl());t.default=function e(t,i,n,s,r){"function"==typeof s&&(r=s,s={}),s=s||{};const o=r;if(!(i=Number(i)||0)||/[\r\n]/.test(n)){const e=new Error("Invalid proxy destination");return e.code=p.EPROXY,void setImmediate(()=>o(e))}const u=l.parse(t),d={host:u.hostname,port:Number(u.port)?Number(u.port):"https:"===u.protocol?443:80};let m,h;"https:"===u.protocol?(d.rejectUnauthorized=!1!==s.rejectUnauthorized,m=c.default.connect.bind(c.default)):m=a.default.connect.bind(a.default);let f=!1;const g=e=>{if(!f){f=!0;try{h.destroy()}catch(e){}o(e)}},w=()=>{const e=new Error("Proxy socket timed out");e.code="ETIMEDOUT",g(e)};h=m(d,()=>{if(f)return;const e={Host:n+":"+i,Connection:"close"};u.auth&&(e["Proxy-Authorization"]="Basic "+Buffer.from(u.auth).toString("base64")),h.write("CONNECT "+n+":"+i+" HTTP/1.1\r\n"+Object.keys(e).map(t=>t+": "+e[t]).join("\r\n")+"\r\n\r\n");let t="";const s=e=>{let i,n;if(!f){if(t+=e.toString("binary"),i=t.match(/\r\n\r\n/)){if(h.removeListener("data",s),n=t.substr(i.index+i[0].length),t=t.substr(0,i.index),n&&h.unshift(Buffer.from(n,"binary")),f=!0,i=t.match(/^HTTP\/\d+\.\d+ (\d+)/i),!i||"2"!==(i[1]||"").charAt(0)){try{h.destroy()}catch(e){}const e=new Error("Invalid response from proxy"+(i&&": "+i[1]||""));return e.code=p.EPROXY,o(e)}return h.removeListener("error",g),h.removeListener("timeout",w),h.setTimeout(0),o(null,h)}if(t.length>65536){h.removeListener("data",s);const e=new Error("Proxy response headers too large");return e.code=p.EPROXY,g(e)}}};h.on("data",s)}),h.setTimeout(e.timeout||3e4),h.on("timeout",w),h.once("error",g)},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Rl,Rl.exports)),Rl.exports)),g=r(nl()),w=o(d),y=r(Vc()),D=r(el()),v=o((Jl||(Jl=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(ul()),c=o(Fl()),l=r(Il()),u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.default=class{constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};const i=e.options||{},n=e._defaults||{};a.copyOwnKeys(this.data,t),this.data.headers=this.data.headers||{},a.copyOwnKeys(this.data,n,e=>u(this.data,e)),a.copyOwnKeys(this.data.headers,n.headers,e=>u(this.data.headers,e)),["disableFileAccess","disableUrlAccess","normalizeHeaderKey","maxRecipients"].forEach(e=>{e in i&&(this.data[e]=i[e])}),["disableFileAccess","disableUrlAccess"].forEach(e=>{!(e in i)&&u(n,e)&&(this.data[e]=this.data[e]||n[e])})}resolveContent(e,t,i,n){n||"function"!=typeof i||(n=i,i=!1),i=i||{};const s={disableFileAccess:this.data.disableFileAccess||i.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess||i.disableUrlAccess};return a.resolveContent(e,t,s,n)}resolveAll(e){const t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach((e,i)=>{t.push([this.data.alternatives,i])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((e,i)=>{e.filename||(e.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(i+1),e.filename.indexOf(".")<0&&(e.filename+="."+l.detectExtension(e.contentType))),e.contentType||(e.contentType=l.detectMimeType(e.filename||e.path||e.href||"bin")),t.push([this.data.attachments,i])});const i=new c.default;["from","to","cc","bcc","sender","replyTo"].forEach(e=>{let t;this.message?t=[].concat(i._parseAddresses(this.message.getHeader("replyTo"===e?"reply-to":e))||[]):this.data[e]&&(t=[].concat(i._parseAddresses(this.data[e])||[])),t&&t.length?this.data[e]=t:e in this.data&&(this.data[e]=null)}),["from","sender"].forEach(e=>{this.data[e]&&(this.data[e]=this.data[e].shift())});let n=0;const s=()=>{if(n>=t.length)return e(null,this.data);const i=t[n++];if(!i[0]||!i[0][i[1]])return s();a.resolveContent(...i,{disableFileAccess:this.data.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess},(t,n)=>{if(t)return e(t);const r={content:n};i[0][i[1]]&&"object"==typeof i[0][i[1]]&&!Buffer.isBuffer(i[0][i[1]])&&a.copyOwnKeys(r,i[0][i[1]],e=>e in r||["content","path","href","raw"].includes(e)),i[0][i[1]]=r,s()})};setImmediate(()=>s())}normalize(e){const t=this.message.getEnvelope(),i=this.message.messageId();this.resolveAll((n,s)=>n?e(n):(s.envelope=t,s.messageId=i,["html","text","watchHtml","amp"].forEach(e=>{s[e]&&s[e].content&&("string"==typeof s[e].content?s[e]=s[e].content:Buffer.isBuffer(s[e].content)&&(s[e]=s[e].content.toString()))}),s.icalEvent&&Buffer.isBuffer(s.icalEvent.content)&&(s.icalEvent.content=s.icalEvent.content.toString("base64"),s.icalEvent.encoding="base64"),s.alternatives&&s.alternatives.length&&s.alternatives.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),s.attachments&&s.attachments.length&&s.attachments.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),s.normalizedHeaders={},Object.keys(s.headers||{}).forEach(e=>{if(a.isProtoKey(e))return;let t=[].concat(s.headers[e]||[]).shift();t=t&&t.value||t,t&&(["references","in-reply-to","message-id","content-id"].includes(e)&&(t=this.message._encodeHeaderValue(e,t)),s.normalizedHeaders[e]=t)}),s.list&&"object"==typeof s.list&&this._getListHeaders(s.list).forEach(e=>{s.normalizedHeaders[e.key]=e.value.map(e=>e&&e.value||e).join(", ")}),s.references&&(s.normalizedHeaders.references=this.message._encodeHeaderValue("references",s.references)),s.inReplyTo&&(s.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",s.inReplyTo)),e(null,s)))}setMailerHeader(){this.message&&this.data.xMailer&&this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(this.message&&this.data.priority)switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low")}}setListHeaders(){this.message&&this.data.list&&"object"==typeof this.data.list&&this._getListHeaders(this.data.list).forEach(e=>{e.value.forEach(t=>{this.message.addHeader(e.key,t)})})}_getListHeaders(e){return Object.keys(e).map(t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map(e=>({prepared:!0,foldLines:!0,value:[].concat(e||[]).map(e=>{if("string"==typeof e&&(e={url:e}),e&&e.url){let i=(e.comment||"").toString().replace(/\r?\n|\r/g," ");const n=!l.isPlainText(i)||/\x7f/.test(i);return"id"===t.toLowerCase().trim()?(i=n?l.encodeWord(i):l.quoteString(i),(e.comment?i+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+:\/{0,2}/,"<")):(i=n?l.encodeWord(i):i.replace(/[()\\]/g,"\\$&"),this._formatListUrl(e.url)+(e.comment?" ("+i+")":""))}return""}).filter(e=>e).join(", ")}))}))}_formatListUrl(e){return e=e.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}($l,$l.exports)),$l.exports)),I=o(u),b=o(M),C=o(x);class E extends a.EventEmitter{constructor(e,t,i){super(),this.options=t||{},this._defaults=i||{},this._defaultPlugins={compile:[(...e)=>this._convertDataImages(...e)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=!!this.options.dkim&&new h.default(this.options.dkim),this.transporter=e,this.transporter.mailer=this,this.logger=c.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),"function"==typeof this.transporter.on&&(this.transporter.on("log",e=>{this.logger.debug({tnx:"transport"},"%s: %s",e.type,e.message)}),this.transporter.on("error",e=>{this.logger.error({err:e,tnx:"transport"},"Transport Error: %s",e.message),this.emit("error",e)}),this.transporter.on("idle",(...e)=>{this.emit("idle",...e)}),this.transporter.on("clear",(...e)=>{this.emit("clear",...e)})),["close","isIdle","verify"].forEach(e=>{this[e]=(...t)=>"function"==typeof this.transporter[e]?("verify"===e&&"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[e](...t)):(this.logger.warn({tnx:"transport",methodName:e},"Non existing method %s called for transport",e),!1)}),this.options.proxy&&"string"==typeof this.options.proxy&&this.setupProxy(this.options.proxy)}use(e,t){return e=(e||"").toString(),this._userPlugins.hasOwnProperty(e)?this._userPlugins[e].push(t):this._userPlugins[e]=[t],this}sendMail(e,t=null){let i;t||(i=new Promise((e,i)=>{t=c.callbackPromise(e,i)}));const n=t;"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);const s=new v.default(this,e);return this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version),this._processPlugins("compile",s,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",e.message),n(e);let t;try{s.message=new m.default(s.data).compile(),s.setMailerHeader(),s.setPriorityHeaders(),s.setListHeaders(),t=s.message.getEnvelope().to.length}catch(e){return this.logger.error({err:e,tnx:"transport",action:"send"},"Compile Error: %s",e.message),n(e)}const i=void 0===s.data.maxRecipients?1e5:s.data.maxRecipients;if(i&&t>i){const e=new Error(`Message has ${t} recipients, which is over the ${i} allowed by maxRecipients`);return e.code=g.EMAXRECIPIENTS,this.logger.error({err:e,tnx:"transport",action:"send"},"Send Error: %s",e.message),n(e)}this._processPlugins("stream",s,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"stream"},"PluginStream Error: %s",e.message),n(e);(s.data.dkim||this.dkim)&&s.message.processFunc(e=>{const t=s.data.dkim?new h.default(s.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:s.message.messageId(),dkimDomains:t.keys.map(e=>e.keySelector+"."+e.domainName).join(", ")},"Signing outgoing message with %s keys",t.keys.length),t.sign(e,s.data._dkim)}),this.transporter.send(s,(...e)=>{e[0]&&this.logger.error({err:e[0],tnx:"transport",action:"send"},"Send Error: %s",e[0].message),n(...e)})})}),i}getVersionString(){return w.default.format("%s (%s; +%s; %s/%s)",D.name,D.version,D.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,i){if(e=(e||"").toString(),!this._userPlugins.hasOwnProperty(e))return i();const n=this._userPlugins[e]||[],s=this._defaultPlugins[e]||[];if(n.length&&this.logger.debug({tnx:"transaction",pluginCount:n.length,step:e},"Using %s plugins for %s",n.length,e),n.length+s.length===0)return i();let r=0,o="default";const a=()=>{let e="default"===o?s:n;if(r>=e.length){if("default"!==o||!n.length)return i();o="user",r=0,e=n}(0,e[r++])(t,e=>{if(e)return i(e);a()})};a()}setupProxy(e){const t=y.parse(e);this.getSocket=(e,i)=>{const n=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+n))return this.meta.get("proxy_handler_"+n)(t,e,i);switch(n){case"http":case"https":return void(0,f.default)(t.href,e.port,e.host,this.options.tls||{},(e,t)=>e?i(e):i(null,{connection:t}));case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){let e=new Error("Socks module not loaded");return e.code=g.EPROXY,i(e)}const n=n=>{const s=!!this.meta.get("proxy_socks_module").SocksClient,r=s?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),o=Number(t.protocol.replace(/\D/g,""))||5,a={proxy:{ipaddress:n,port:Number(t.port),type:o},[s?"destination":"target"]:{host:e.host,port:e.port},command:"connect"};if(t.username||t.password){const e=t.username||"",i=t.password||"";s?(a.proxy.userId=e,a.proxy.password=i):4===o?a.userid=e:a.authentication={username:e,password:i}}r.createConnection(a,(e,t)=>e?i(e):i(null,{connection:t.socket||t}))};return I.default.isIP(t.hostname)?n(t.hostname):b.default.resolve(t.hostname,(e,t)=>{if(e)return i(e);n(Array.isArray(t)?t[0]:t)})}}let s=new Error("Unknown proxy configuration");s.code=g.EPROXY,i(s)}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html)return t();e.resolveContent(e.data,"html",{disableFileAccess:e.data.disableFileAccess,disableUrlAccess:e.data.disableUrlAccess},(i,n)=>{if(i)return t(i);let s=0;n=(n||"").toString().replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi,(t,i,n,r)=>{const o=C.default.randomBytes(10).toString("hex")+"@localhost";return e.data.attachments||(e.data.attachments=[]),Array.isArray(e.data.attachments)||(e.data.attachments=[].concat(e.data.attachments||[])),e.data.attachments.push({path:n,cid:o,filename:"image-"+ ++s+"."+p.detectExtension(r)}),i+"cid:"+o}),e.data.html=n,t()})}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}}t.default=E,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Oc,Oc.exports)),Oc.exports}var tu,iu,nu={exports:{}},su={exports:{}},ru={exports:{}},ou={exports:{}};function au(){return iu||(iu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(el()),c=l,p=o(u),d=o(L),m=o(y),h=o(x),f=o((tu||(tu=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=w,n=Buffer.from("\n"),s=Buffer.from("\n."),r=Buffer.from("\r"),o=Buffer.from(".");class a extends i.Transform{constructor(e){super(e),this.options=e||{},this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(e,t,i){const a=[];let c,l,u,p=0,d=0;if(!e||!e.length)return i();for("string"==typeof e&&(e=Buffer.from(e)),this.inByteCount+=e.length,c=0,l=e.length;c<l;c++){const t=e[c],i=c?e[c-1]:this.lastByte;let l=!1;13===i&&10!==t?l=46===t?s:n:10===t&&13!==i?l=r:46!==t||10!==i&&!1!==i||(l=o),l&&(c>d&&(u=e.slice(d,c),a.push(u),p+=u.length),a.push(l),p+=l.length,d=c)}a.length?(d<e.length&&(u=e.slice(d),a.push(u),p+=u.length),this.outByteCount+=p,this.push(Buffer.concat(a,p))):(this.outByteCount+=e.length,this.push(e)),this.lastByte=e[e.length-1],i()}_flush(e){let t;t=10===this.lastByte?Buffer.from(".\r\n"):13===this.lastByte?Buffer.from("\n.\r\n"):Buffer.from("\r\n.\r\n"),this.outByteCount+=t.length,this.push(t),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ou,ou.exports)),ou.exports)),g=w,M=r(ul()),D=6e5,v=()=>{};function I(e){if(!e)return e;const t=Buffer.from(e,"binary").toString("utf8");return t.includes("�")?e:t}function b(e){return/^\d+-/.test(e)}class C extends c.EventEmitter{constructor(e){super(e),this.id=h.default.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=e||{},this.options.requireTLS&&(this.options.ignoreTLS||this.options.opportunisticTLS)&&(this.options=Object.assign({},this.options,{ignoreTLS:!1,opportunisticTLS:!1})),this.secureConnection=!!this.options.secure,this.alreadySecured=!!this.options.secured,this.port=Number(this.options.port)||(this.secureConnection?465:587),this.host=this.options.host||"localhost",this.servername=this.options.servername?this.options.servername:!p.default.isIP(this.host)&&this.host,this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,void 0===this.options.secure&&465===this.port&&(this.secureConnection=!0),this.name=(this.options.name||this._getHostname()).toString().replace(/[\r\n]+/g,""),this.logger=M.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map;for(const e of Object.keys(this.options.customAuth||{})){const t=(e||"").toString().trim().toUpperCase();t&&this.customAuth.set(t,this.options.customAuth[e])}this.version=a.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],this._responsePartial=!1,this.lastServerResponse=!1,this._socket=!1,this._supportedAuth=[],this.allowsAuth=!1,this._envelope=!1,this._supportedExtensions=[],this._maxAllowedSize=0,this._responseActions=[],this._recipientQueue=[],this._greetingTimeout=!1,this._connectionTimeout=!1,this._destroyed=!1,this._closing=!1,this._currentDataStream=!1,this._pendingSend=!1,this._connectCallback=!1,this._onSocketData=e=>this._onData(e),this._onSocketError=e=>this._onError(e,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout(),this._onConnectionSocketError=e=>this._onConnectionError(e,"ESOCKET"),this._connectionAttemptId=0}connect(e){if("function"==typeof e){this._connectCallback=e,this.once("connect",()=>{this._connectCallback=!1,this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),e()});const t=this._isDestroyedMessage("connect");if(t)return e(this._formatError(t,"ECONNECTION",!1,"CONN"))}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||3e4};return this.options.localAddress&&(t.localAddress=this.options.localAddress),this.options.connection?(this._socket=this.options.connection,this._setupConnectionHandlers(),void(this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()})):setImmediate(()=>this._onConnect()))):this.options.socket?(this._socket=this.options.socket,this._resolveAndConnect(t,e=>{try{this._socket.connect(this.port,this.host,()=>{if(this._socket.setKeepAlive(!0),this.secureConnection&&!this.alreadySecured)return this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()});this._onConnect()}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}})):(this.secureConnection&&(Object.assign(t,this.options.tls||{}),this.servername&&!t.servername&&(t.servername=this.servername)),this._resolveAndConnect(t,e=>{this._fallbackAddresses=(e._addresses||[]).filter(e=>e!==t.host),this._connectOpts=Object.assign({},t),this._connectToHost(t,this.secureConnection)}))}_resolveAndConnect(e,t){return M.resolveHostname(e,(i,n)=>{if(i)return setImmediate(()=>this._onError(i,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:n.host,cached:!!n.cached},"Resolved %s as %s [cache %s]",e.host,n.host,n.cached?"hit":"miss");for(const t of Object.keys(n))"_"!==t.charAt(0)&&n[t]&&(e[t]=n[t]);t(n)})}_connectToHost(e,t){if(this._destroyed||this._closing)return;this._connectionAttemptId++;const i=this._connectionAttemptId,n=t?d.default.connect:p.default.connect;try{this._socket=n(e,()=>{this._connectionAttemptId===i&&(this._socket.setKeepAlive(!0),this._onConnect())}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}}_setupConnectionHandlers(){this._connectionTimeout=setTimeout(()=>{this._onConnectionError("Connection timeout","ETIMEDOUT")},this.options.connectionTimeout||12e4),this._socket.on("error",this._onConnectionSocketError)}_onConnectionError(e,t){clearTimeout(this._connectionTimeout);if(!(this._fallbackAddresses&&this._fallbackAddresses.length&&"init"===this.stage&&!this._destroyed))return void this._onError(e,t,!1,"CONN");const i=this._fallbackAddresses.shift();if(this.logger.info({tnx:"network",failedHost:this._connectOpts.host,nextHost:i,error:e.message||e},"Connection to %s failed, trying %s",this._connectOpts.host,i),this._socket){try{this._socket.removeListener("error",this._onConnectionSocketError),this._socket.on("error",v),this._socket.destroy()}catch(e){}this._socket=null}this._connectOpts.host=i,this._connectToHost(this._connectOpts,this.secureConnection)}quit(){this._sendCommand("QUIT"),this._responseActions.push(this.close)}close(){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._responseActions=[],this._closing)return;this._closing=!0;const e="init"===this.stage?"destroy":"end";this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);const t=this._socket&&this._socket.socket||this._socket;if(this._currentDataStream){try{this._currentDataStream.unpipe(this._socket)}catch(e){}this._currentDataStream=!1}if(this._pendingSend){const{stream:e,onStreamError:t}=this._pendingSend;e&&(e.removeListener("error",t),e.on("error",v)),this._pendingSend=!1}if(t&&!t.destroyed)try{t.setTimeout(0),t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout),t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError),t.on("error",v),t[e]()}catch(e){}this._destroy()}login(e,t){const i=this._isDestroyedMessage("login");if(i)return t(this._formatError(i,"ECONNECTION",!1,"API"));this._auth=e||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1;const n=!!this._auth.oauth2||this.customAuth.has("XOAUTH2");if(this._authMethod||!this._auth.oauth2||this._auth.credentials){if(!this._authMethod||"XOAUTH2"===this._authMethod&&!this._auth.oauth2){const e=this._supportedAuth.find(e=>"XOAUTH2"!==e||n);this._authMethod=(e||"PLAIN").toUpperCase().trim()}}else this._authMethod="XOAUTH2";if(("XOAUTH2"!==this._authMethod||this.customAuth.has("XOAUTH2"))&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass)){if(!(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod)))return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options}}if(this.customAuth.has(this._authMethod)){const e=this.customAuth.get(this._authMethod);let i,n=!1;const s=()=>{n||(n=!0,this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0))},r=e=>{n||(n=!0,t(this._formatError(e,"EAUTH",i,"AUTH "+this._authMethod)))},o=(e,t)=>{let n;return t||(n=new Promise((e,i)=>{t=M.callbackPromise(e,i)})),this._responseActions.push(n=>{i=n;let s=n.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),r={command:e,response:n};s?(r.status=Number(s[1])||0,s[2]&&(r.code=s[2]),r.text=n.substr(s[0].length)):(r.text=n,r.status=0),t(null,r)}),setImmediate(()=>this._sendCommand(e)),n},a=e({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:o,resolve:s,reject:r});return void(a&&"function"==typeof a.catch&&a.then(s).catch(r))}switch(this._authMethod){case"XOAUTH2":return void this._handleXOauth2Token(!1,t);case"LOGIN":return this._responseActions.push(e=>{this._actionAUTH_LOGIN_USER(e,t)}),void this._sendCommand("AUTH LOGIN");case"PLAIN":return this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),void this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0/* secret */","utf-8").toString("base64"));case"CRAM-MD5":return this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5(e,t)}),void this._sendCommand("AUTH CRAM-MD5")}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(e,t,i){let n=!1;const s=(e,t)=>{n||(n=!0,this._pendingSend&&this._pendingSend.callback===s&&(this._pendingSend=!1),i(e,t))};if(!t)return s(this._formatError("Empty message","EMESSAGE",!1,"API"));const r=this._isDestroyedMessage("send message");if(r)return s(this._formatError(r,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&e.size>this._maxAllowedSize)return void setImmediate(()=>{s(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});const o={callback:s,stream:!1,onStreamError:e=>s(this._formatError(e,"ESTREAM",!1,"API"))};"function"==typeof t.on&&(o.stream=t,o.stream.on("error",o.onStreamError)),this._pendingSend=o;const a=Date.now();this._setEnvelope(e,(e,i)=>{if(e){const i=new g.PassThrough;return"function"==typeof t.pipe?t.pipe(i):(i.write(t),i.end()),s(e)}const n=Date.now(),r=this._createSendStream((e,t)=>{if(e)return s(e);const o=i;return o.envelopeTime=n-a,o.messageTime=Date.now()-n,o.messageSize=r.outByteCount,o.response=t,s(null,o)});"function"==typeof t.pipe?t.pipe(r):(r.write(t),r.end())})}reset(e){const t=this._isDestroyedMessage("reset");if(t)return e(this._formatError(t,"ECONNECTION",!1,"API"));this._sendCommand("RSET"),this._responseActions.push(t=>"2"!==t.charAt(0)?e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET")):(this._envelope=!1,e(null,!0)))}_onConnect(){const e=this._socket;clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",e.remoteAddress,e.remotePort),this._destroyed?this.close():(this.stage="connected",e.removeListener("data",this._onSocketData),e.removeListener("timeout",this._onSocketTimeout),e.removeListener("close",this._onSocketClose),e.removeListener("end",this._onSocketEnd),e.removeListener("error",this._onConnectionSocketError),e.removeListener("error",this._onSocketError),e.on("error",this._onSocketError),e.on("data",this._onSocketData),e.once("close",this._onSocketClose),e.once("end",this._onSocketEnd),e.setTimeout(this.options.socketTimeout||D),e.on("timeout",this._onSocketTimeout),this._greetingTimeout=setTimeout(()=>{this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting&&this._onError("Greeting never received","ETIMEDOUT",!1,"CONN")},this.options.greetingTimeout||3e4),this._responseActions.push(this._actionGreeting),e.resume())}_onData(e){if(this._destroyed||!e||!e.length)return;const t=this.options.maxResponseSize||1048576,i=e.toString("binary");if(!i.includes("\n"))return this._remainder+=i,this._remainder.length>t?this._onResponseTooLarge():void 0;const n=(this._remainder+i).split(/\r?\n/);this._remainder=n.pop();for(let e=0,i=n.length;e<i;e++)if(this._responsePartial?this._responseQueue[this._responseQueue.length-1]+="\n"+n[e]:this._responseQueue.push(n[e]),this._responsePartial=b(n[e]),this._responsePartial&&this._responseQueue[this._responseQueue.length-1].length>t)return this._onResponseTooLarge();if(this._remainder.length>t)return this._onResponseTooLarge();this._responsePartial||this._processResponse()}_onResponseTooLarge(){this._remainder="",this._responseQueue=[],this._responsePartial=!1,this._onError(new Error("Server response exceeds maximum allowed size"),"EPROTOCOL",!1,"CONN")}_onError(e,t,i,n){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._destroyed)return;e=this._formatError(e,t,i,n);["ETIMEDOUT","ESOCKET","ECONNECTION"].includes(e.code)?this.logger.warn(i,e.message):this.logger.error(i,e.message);const s=this._pendingSend;this.emit("error",e),this.close(),s&&s.callback(e)}_formatError(e,t,i,n){let s;s=/Error\]$/i.test(Object.prototype.toString.call(e))?e:new Error(e),t&&"Error"!==t&&(s.code=t),i&&(s.response=i,s.message+=": "+i);const r="string"==typeof i&&Number((i.match(/^\d+/)||[])[0])||!1;return r&&(s.responseCode=r),n&&(s.command=n),s}_onClose(){let e=!1;this._remainder&&this._remainder.trim()&&(this.lastServerResponse=e=I(this._remainder.trim()),(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e)),this.logger.info({tnx:"network"},"Connection closed");const t=!("string"!=typeof e||!/^[45]\d{2}[ -]/.test(e))&&e;if(this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",t,"CONN");if(!t&&this._responseActions[0]===this._actionGreeting&&this._connectCallback&&!this._destroyed){const e=this._connectCallback;this._connectCallback=!1;const t=this._formatError(new Error("Connection closed unexpectedly"),"ECONNECTION",!1,"CONN");return this.logger.warn({tnx:"network"},t.message),e(t),void this.close()}if(t||this._responseActions[0]!==this.close&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.end()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.destroyed=!0,clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._connectionTimeout=!1,this._greetingTimeout=!1,this.emit("end"))}_upgradeConnection(e){this._remainder="",this._responseQueue=[],this._responsePartial=!1;const t=this._socket;t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout);const i=Object.assign({socket:t,host:this.host},this.options.tls||{});this.servername&&!i.servername&&(i.servername=this.servername);const n=()=>{t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError)};this.upgrading=!0;try{this._socket=d.default.connect(i,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),n(),e(null,!0)))}catch(t){return n(),e(t)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||D),this._socket.on("timeout",this._onSocketTimeout),t.resume()}_processResponse(){if(!this._responseQueue.length)return!1;const e=(this._responseQueue.shift()||"").toString();if(!e.trim())return void setImmediate(()=>this._processResponse());if(function(e){return b(e.slice(e.lastIndexOf("\n")+1))}(e))return void this._responseQueue.unshift(e);const t=this.lastServerResponse=I(e);(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},t.replace(/\r?\n$/,""));const i=this._responseActions.shift();if("function"!=typeof i)return this._onError(new Error("Unexpected Response"),"EPROTOCOL",t,"CONN");i.call(this,t),setImmediate(()=>this._processResponse())}_sendCommand(e,t){if(this._destroyed)return;const i=this._socket;if(i.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,"")),i.write(Buffer.from(e+"\r\n","utf-8"))}_setEnvelope(e,t){const i=[];let n=!1;if(this._envelope=e||{},this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim(),this._envelope.to=[].concat(this._envelope.to||[]).map(e=>(e&&e.address||e||"").toString().trim()),!this._envelope.to.length)return t(this._formatError("No recipients defined","EENVELOPE",!1,"API"));if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from))return t(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.from)&&(n=!0);for(let e=0,i=this._envelope.to.length;e<i;e++){if(!this._envelope.to[e]||/[\r\n<>]/.test(this._envelope.to[e]))return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[e]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[e])&&(n=!0)}if(this._envelope.rcptQueue=[].concat(this._envelope.to||[]),this._envelope.rejected=[],this._envelope.rejectedErrors=[],this._envelope.accepted=[],this._envelope.dsn)try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(e){return t(this._formatError("Invalid DSN "+e.message,"EENVELOPE",!1,"API"))}if(this._envelope.requireTLSExtensionEnabled){if(!this.secure)return t(this._formatError("REQUIRETLS can only be used over TLS connections (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"));if(!this._supportedExtensions.includes("REQUIRETLS"))return t(this._formatError("Server does not support REQUIRETLS extension (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"))}if(this._responseActions.push(e=>{this._actionMAIL(e,t)}),n&&this._supportedExtensions.includes("SMTPUTF8")&&(i.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(i.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")){const e=Number(this._envelope.size)||0;e>0&&i.push("SIZE="+e)}this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&i.push("RET="+M.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&i.push("ENVID="+M.encodeXText(this._envelope.dsn.envid))),this._envelope.requireTLSExtensionEnabled&&i.push("REQUIRETLS"),this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(e){let t=(e.ret||e.return||"").toString().toUpperCase()||null;if(t)switch(t){case"HDRS":case"HEADERS":t="HDRS";break;case"FULL":case"BODY":t="FULL"}if(t&&!["FULL","HDRS"].includes(t))throw new Error("ret: "+JSON.stringify(t));const i=(e.envid||e.id||"").toString()||null;let n=e.notify||null;if(n){"string"==typeof n&&(n=n.split(",")),n=n.map(e=>e.trim().toUpperCase());const e=["NEVER","SUCCESS","FAILURE","DELAY"];if(n.filter(t=>!e.includes(t)).length||n.length>1&&n.includes("NEVER"))throw new Error("notify: "+JSON.stringify(n.join(",")));n=n.join(",")}let s=(e.recipient||e.orcpt||"").toString()||null;return s&&s.indexOf(";")<0&&(s="rfc822;"+s),{ret:t,envid:i,notify:n,orcpt:s}}_getDsnRcptToArgs(){const e=this._envelope,t=[];return e.dsn&&this._supportedExtensions.includes("DSN")&&(e.dsn.notify&&t.push("NOTIFY="+M.encodeXText(e.dsn.notify)),e.dsn.orcpt&&t.push("ORCPT="+M.encodeXText(e.dsn.orcpt))),t.length?" "+t.join(" "):""}_createSendStream(e){const t=this._envelope,i=new f.default;if(this.options.lmtp?t.accepted.forEach((i,n)=>{const s=n===t.accepted.length-1;this._responseActions.push(t=>{this._actionLMTPStream(i,s,t,e)})}):this._responseActions.push(t=>{this._actionSMTPStream(t,e)}),this._currentDataStream=i,i.pipe(this._socket,{end:!1}),this.options.debug){const e=new g.PassThrough;e.on("readable",()=>{let t;for(;t=e.read();)this.logger.debug({tnx:"message"},t.toString("binary").replace(/\r?\n$/,""))}),i.pipe(e)}return i.once("end",()=>{this._currentDataStream===i&&(this._currentDataStream=!1),this.logger.info({tnx:"message",inByteCount:i.inByteCount,outByteCount:i.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",i.outByteCount,i.inByteCount)}),i}_actionGreeting(e){clearTimeout(this._greetingTimeout),"220"===e.substr(0,3)?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN")}_actionLHLO(e){"2"===e.charAt(0)?this._actionEHLO(e):this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO")}_actionEHLO(e){let t;if("421"===e.substr(0,3))return void this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");if("2"!==e.charAt(0))return this.options.requireTLS?void this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO"):(this._responseActions.push(this._actionHELO),void this._sendCommand("HELO "+this.name));if(this._ehloLines=e.split(/\r?\n/).map(e=>e.replace(/^\d+[ -]/,"").trim()).filter(e=>e).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS))return this._sendCommand("STARTTLS"),void this._responseActions.push(this._actionSTARTTLS);/[ -]SMTPUTF8\b/im.test(e)&&this._supportedExtensions.push("SMTPUTF8"),/[ -]DSN\b/im.test(e)&&this._supportedExtensions.push("DSN"),/[ -]8BITMIME\b/im.test(e)&&this._supportedExtensions.push("8BITMIME"),/[ -]REQUIRETLS\b/im.test(e)&&this._supportedExtensions.push("REQUIRETLS"),/[ -]PIPELINING\b/im.test(e)&&this._supportedExtensions.push("PIPELINING"),/[ -]AUTH\b/i.test(e)&&(this.allowsAuth=!0);const i=new Set;for(const e of this._ehloLines){const t=/^AUTH[\s=](.*)/i.exec(e);if(t)for(const e of t[1].split(/[\s=]+/))i.add(e.toUpperCase())}for(const e of["PLAIN","LOGIN","CRAM-MD5","XOAUTH2"])i.has(e)&&this._supportedAuth.push(e);(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(t[1])||0),this.emit("connect")}_actionHELO(e){"2"===e.charAt(0)?(this.allowsAuth=!0,this.emit("connect")):this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO")}_actionSTARTTLS(e){if("2"!==e.charAt(0))return this.options.opportunisticTLS?(this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),void this.emit("connect")):void this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");this._upgradeConnection((e,t)=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"STARTTLS"):(this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),t?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this.emit("connect"))})}_actionAUTH_LOGIN_USER(e,t){/^334[ -]/.test(e)?(this._responseActions.push(e=>{this._actionAUTH_LOGIN_PASS(e,t)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))):t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"))}_actionAUTH_CRAM_MD5(e,t){const i=e.match(/^334\s+(.+)$/);if(!i)return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"));const n=Buffer.from(i[1],"base64").toString("ascii"),s=h.default.createHmac("md5",this._auth.credentials.pass);s.update(n);const r=this._auth.credentials.user+" "+s.digest("hex");this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5_PASS(e,t)}),this._sendCommand(Buffer.from(r).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(e,t){if(!e.match(/^235\s+/))return t(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",e,"AUTH CRAM-MD5"));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0)}_actionAUTH_LOGIN_PASS(e,t){if(!/^334[ -]/.test(e))return t(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",e,"AUTH LOGIN"));this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,i){return i||"function"!=typeof t||(i=t,t=!1),"334"===e.substr(0,3)?(this._responseActions.push(e=>{t||"XOAUTH2"!==this._authMethod?this._actionAUTHComplete(e,!0,i):setImmediate(()=>this._handleXOauth2Token(!0,i))}),void this._sendCommand("")):"2"!==e.charAt(0)?(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),i(this._formatError("Invalid login","EAUTH",e,"AUTH "+this._authMethod))):(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,void i(null,!0))}_actionMAIL(e,t){const i=this._envelope;if(2!==Number(e.charAt(0))){const n=this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(i.from)?"Internationalized mailbox name not allowed":"Mail command failed";return t(this._formatError(n,"EENVELOPE",e,"MAIL FROM"))}if(!i.rcptQueue.length)return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"));this._recipientQueue=[];const n=this._supportedExtensions.includes("PIPELINING");do{const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}while(n&&i.rcptQueue.length)}_actionRCPT(e,t){const i=this._envelope;let n;const s=this._recipientQueue.shift();if(2!==Number(e.charAt(0))){const t=this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(s)?"Internationalized mailbox name not allowed":"Recipient command failed";i.rejected.push(s),n=this._formatError(t,"EENVELOPE",e,"RCPT TO"),n.recipient=s,i.rejectedErrors.push(n)}else i.accepted.push(s);if(i.rcptQueue.length||this._recipientQueue.length){if(i.rcptQueue.length){const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}}else{if(!(i.rejected.length<i.to.length)){const s=i.rejectedErrors.find(e=>e.responseCode&&e.responseCode<500),r=s?.response??e;return n=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",r,"RCPT TO"),n.rejected=i.rejected,n.rejectedErrors=i.rejectedErrors,t(n)}this._responseActions.push(e=>{this._actionDATA(e,t)}),this._sendCommand("DATA")}}_actionDATA(e,t){const i=this._envelope;if(!/^[23]/.test(e))return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"));const n={accepted:i.accepted,rejected:i.rejected};this._ehloLines&&this._ehloLines.length&&(n.ehlo=this._ehloLines),i.rejectedErrors.length&&(n.rejectedErrors=i.rejectedErrors),t(null,n)}_actionSMTPStream(e,t){return 2!==Number(e.charAt(0))?t(this._formatError("Message failed","EMESSAGE",e,"DATA")):t(null,e)}_actionLMTPStream(e,t,i,n){const s=this._envelope;let r;if(2!==Number(i.charAt(0))){r=this._formatError("Message failed for recipient "+e,"EMESSAGE",i,"DATA"),r.recipient=e,s.rejected.push(e),s.rejectedErrors.push(r);for(let t=0,i=s.accepted.length;t<i;t++)s.accepted[t]===e&&s.accepted.splice(t,1)}if(t)return n(null,i)}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,(i,n)=>{if(i)return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),t(this._formatError(i,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(i=>{this._actionAUTHComplete(i,e,t)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(n),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))})}_isDestroyedMessage(e){if(this._destroyed)return"Cannot "+e+" - smtp connection is already destroyed.";if(this._socket){if(this._socket.destroyed)return"Cannot "+e+" - smtp connection socket is already destroyed.";if(!this._socket.writable)return"Cannot "+e+" - smtp connection socket is already half-closed."}}_getHostname(){let e;try{e=m.default.hostname()||""}catch(t){e="localhost"}return(!e||e.indexOf(".")<0)&&(e="[127.0.0.1]"),e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(e="["+e+"]"),e}}t.default=C,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ru,ru.exports)),ru.exports}var cu,lu,uu={exports:{}};function pu(){return cu||(cu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=w,c=o(ll()),l=o(x),u=r(ul()),p=r(nl());class d extends a.Stream{constructor(e,t){if(super(),this.options=e||{},this.configError=!1,e&&e.serviceClient){if(!e.privateKey||!e.user){const e=new Error('Options "privateKey" and "user" are required for service account!');e.code=p.EOAUTH2,this.configError=e}const t=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=t||300}if(this.logger=u.getLogger({logger:t},{component:this.options.component||"OAuth2"}),this.provisionCallback="function"==typeof this.options.provisionCallback&&this.options.provisionCallback,this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token",this.options.customHeaders=this.options.customHeaders||{},this.options.customParams=this.options.customParams||{},this.accessToken=this.options.accessToken||!1,this.options.expires&&Number(this.options.expires))this.expires=this.options.expires;else{const e=Math.max(Number(this.options.timeout)||0,0);this.expires=e&&Date.now()+1e3*e||0}this.renewing=!1,this.renewalQueue=[]}getToken(e,t){const i=t;if(this.configError)return i(this.configError);if(!e&&this.accessToken&&(!this.expires||this.expires>Date.now()))return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token for %s",this.options.user),t(null,this.accessToken);if(!this.provisionCallback&&!this.options.refreshToken&&!this.options.serviceClient){if(this.accessToken)return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token (no refresh capability) for %s",this.options.user),t(null,this.accessToken);this.logger.error({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Cannot renew access token for %s: No refresh mechanism available",this.options.user);const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,i(e)}if(this.renewing)return void this.renewalQueue.push({renew:e,callback:i});this.renewing=!0;const n=(e,t)=>{this.renewalQueue.forEach(i=>i.callback(e,t)),this.renewalQueue=[],this.renewing=!1,e?this.logger.error({err:e,tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user):this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user),i(e,t)};this.provisionCallback?this.provisionCallback(this.options.user,!!e,(e,t,i)=>{!e&&t&&(this.accessToken=t,this.expires=i||0),n(e,t)}):this.generateToken(n)}updateToken(e,t){this.accessToken=e,t=Math.max(Number(t)||0,0),this.expires=t&&Date.now()+1e3*t||0,this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){const t=e;let i,n;if(this.options.serviceClient){const e=Math.floor(Date.now()/1e3),s={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:e,exp:e+this.options.serviceRequestTimeout};let r;try{r=this.jwtSignRS256(s)}catch(e){const i=new Error("Can't generate token. Check your auth options");return i.code=p.EOAUTH2,t(i)}i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r},n={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:s}}else{if(!this.options.refreshToken){const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,t(e)}i={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"},n={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.assign(i,this.options.customParams),Object.assign(n,this.options.customParams),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(n)),this.postRequest(this.options.accessUrl,i,this.options,(i,n)=>{let s;if(i)return t(i);try{s=JSON.parse(n.toString())}catch(e){return t(e)}if(!s||"object"!=typeof s){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(n||"").toString());const e=new Error("Invalid authentication response");return e.code=p.EOAUTH2,t(e)}const r=Object.assign({},s);if(r.access_token&&(r.access_token=(r.access_token||"").toString().substr(0,6)+"..."),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(r)),s.error){let e=s.error;s.error_description&&(e+=": "+s.error_description),s.error_uri&&(e+=" ("+s.error_uri+")");const i=new Error(e);return i.code=p.EOAUTH2,t(i)}if(s.access_token)return this.updateToken(s.access_token,s.expires_in),e(null,this.accessToken);const o=new Error("No access token");return o.code=p.EOAUTH2,t(o)})}buildXOAuth2Token(e){const t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,i,n){let s=!1;const r=[];let o=0;const a={method:"post",headers:i.customHeaders,body:t,allowErrorResponse:!0,timeout:i.requestTimeout};/^https:/i.test(e)&&(a.tls=Object.assign({rejectUnauthorized:!0},i.tls||{}));const l=(0,c.default)(e,a);l.on("readable",()=>{let e;for(;null!==(e=l.read());)r.push(e),o+=e.length}),l.once("error",e=>{if(!s)return s=!0,n(e)}),l.once("end",()=>{if(!s)return s=!0,n(null,Buffer.concat(r,o))})}toBase64URL(e){return"string"==typeof e&&(e=Buffer.from(e)),e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){const t=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map(e=>this.toBase64URL(e)).join("."),i=l.default.createSign("RSA-SHA256").update(t).sign(this.options.privateKey);return t+"."+this.toBase64URL(i)}}t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(uu,uu.exports)),uu.exports}var du,mu,hu,fu={exports:{}},gu={};function wu(){return mu||(mu=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e=s(e.split("@").pop()),n[e]||!1};const i=(du||(du=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.services=void 0,gu.services={126:{description:"126 Mail (NetEase)",host:"smtp.126.com",port:465,secure:!0},163:{description:"163 Mail (NetEase)",host:"smtp.163.com",port:465,secure:!0},"1und1":{description:"1&1 Mail (German hosting provider)",host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},Aliyun:{description:"Alibaba Cloud Mail",domains:["aliyun.com"],host:"smtp.aliyun.com",port:465,secure:!0},AliyunQiye:{description:"Alibaba Cloud Enterprise Mail",host:"smtp.qiye.aliyun.com",port:465,secure:!0},AOL:{description:"AOL Mail",domains:["aol.com"],host:"smtp.aol.com",port:587},Aruba:{description:"Aruba PEC (Italian email provider)",domains:["aruba.it","pec.aruba.it"],aliases:["Aruba PEC"],host:"smtps.aruba.it",port:465,secure:!0,authMethod:"LOGIN"},Bluewin:{description:"Bluewin (Swiss email provider)",host:"smtpauths.bluewin.ch",domains:["bluewin.ch"],port:465},BOL:{description:"BOL Mail (Brazilian provider)",domains:["bol.com.br"],host:"smtp.bol.com.br",port:587,requireTLS:!0},DebugMail:{description:"DebugMail (email testing service)",host:"debugmail.io",port:25},Disroot:{description:"Disroot (privacy-focused provider)",domains:["disroot.org"],host:"disroot.org",port:587,secure:!1,authMethod:"LOGIN"},DynectEmail:{description:"Dyn Email Delivery",aliases:["Dynect"],host:"smtp.dynect.net",port:25},ElasticEmail:{description:"Elastic Email",aliases:["Elastic Email"],host:"smtp.elasticemail.com",port:465,secure:!0},Ethereal:{description:"Ethereal Email (email testing service)",aliases:["ethereal.email"],host:"smtp.ethereal.email",port:587},FastMail:{description:"FastMail",domains:["fastmail.com","fastmail.fm"],host:"smtp.fastmail.com",port:465,secure:!0},"Feishu Mail":{description:"Feishu Mail (Lark)",aliases:["Feishu","FeishuMail"],domains:["www.feishu.cn"],host:"smtp.feishu.cn",port:465,secure:!0},"Forward Email":{description:"Forward Email (email forwarding service)",aliases:["FE","ForwardEmail"],domains:["forwardemail.net"],host:"smtp.forwardemail.net",port:465,secure:!0},GandiMail:{description:"Gandi Mail",aliases:["Gandi","Gandi Mail"],host:"mail.gandi.net",port:587},Gmail:{description:"Gmail",aliases:["Google Mail"],domains:["gmail.com","googlemail.com"],host:"smtp.gmail.com",port:465,secure:!0},GmailWorkspace:{description:"Gmail Workspace",aliases:["Google Workspace Mail"],host:"smtp-relay.gmail.com",port:465,secure:!0},GMX:{description:"GMX Mail",domains:["gmx.com","gmx.net","gmx.de"],host:"mail.gmx.com",port:587},Godaddy:{description:"GoDaddy Email (US)",host:"smtpout.secureserver.net",port:25},GodaddyAsia:{description:"GoDaddy Email (Asia)",host:"smtp.asia.secureserver.net",port:25},GodaddyEurope:{description:"GoDaddy Email (Europe)",host:"smtp.europe.secureserver.net",port:25},"hot.ee":{description:"Hot.ee (Estonian email provider)",host:"mail.hot.ee"},Hotmail:{description:"Outlook.com / Hotmail",aliases:["Outlook","Outlook.com","Hotmail.com"],domains:["hotmail.com","outlook.com"],host:"smtp-mail.outlook.com",port:587},iCloud:{description:"iCloud Mail",aliases:["Me","Mac"],domains:["icloud.com","me.com","mac.com"],host:"smtp.mail.me.com",port:587},Infomaniak:{description:"Infomaniak Mail (Swiss hosting provider)",host:"mail.infomaniak.com",domains:["ik.me","ikmail.com","etik.com"],port:587},KolabNow:{description:"KolabNow (secure email service)",domains:["kolabnow.com"],aliases:["Kolab"],host:"smtp.kolabnow.com",port:465,secure:!0,authMethod:"LOGIN"},Loopia:{description:"Loopia (Swedish hosting provider)",host:"mailcluster.loopia.se",port:465},Loops:{description:"Loops",host:"smtp.loops.so",port:587},"mail.ee":{description:"Mail.ee (Estonian email provider)",host:"smtp.mail.ee"},"Mail.ru":{description:"Mail.ru",host:"smtp.mail.ru",port:465,secure:!0},"Mailcatch.app":{description:"Mailcatch (email testing service)",host:"sandbox-smtp.mailcatch.app",port:2525},Maildev:{description:"MailDev (local email testing)",port:1025,ignoreTLS:!0},MailerSend:{description:"MailerSend",host:"smtp.mailersend.net",port:587},Mailgun:{description:"Mailgun",host:"smtp.mailgun.org",port:465,secure:!0},Mailjet:{description:"Mailjet",host:"in.mailjet.com",port:587},Mailosaur:{description:"Mailosaur (email testing service)",host:"mailosaur.io",port:25},Mailtrap:{description:"Mailtrap",host:"live.smtp.mailtrap.io",port:587},Mandrill:{description:"Mandrill (by Mailchimp)",host:"smtp.mandrillapp.com",port:587},Naver:{description:"Naver Mail (Korean email provider)",host:"smtp.naver.com",port:587},OhMySMTP:{description:"OhMySMTP (email delivery service)",host:"smtp.ohmysmtp.com",port:587,secure:!1},One:{description:"One.com Email",host:"send.one.com",port:465,secure:!0},OpenMailBox:{description:"OpenMailBox",aliases:["OMB","openmailbox.org"],host:"smtp.openmailbox.org",port:465,secure:!0},Outlook365:{description:"Microsoft 365 / Office 365",host:"smtp.office365.com",port:587,secure:!1},Postmark:{description:"Postmark",aliases:["PostmarkApp"],host:"smtp.postmarkapp.com",port:2525},Proton:{description:"Proton Mail",aliases:["ProtonMail","Proton.me","Protonmail.com","Protonmail.ch"],domains:["proton.me","protonmail.com","pm.me","protonmail.ch"],host:"smtp.protonmail.ch",port:587,requireTLS:!0},"qiye.aliyun":{description:"Alibaba Mail Enterprise Edition",host:"smtp.mxhichina.com",port:"465",secure:!0},QQ:{description:"QQ Mail",domains:["qq.com"],host:"smtp.qq.com",port:465,secure:!0},QQex:{description:"QQ Enterprise Mail",aliases:["QQ Enterprise"],domains:["exmail.qq.com"],host:"smtp.exmail.qq.com",port:465,secure:!0},Resend:{description:"Resend",host:"smtp.resend.com",port:465,secure:!0},Runbox:{description:"Runbox (Norwegian email provider)",domains:["runbox.com"],host:"smtp.runbox.com",port:465,secure:!0},SendCloud:{description:"SendCloud (Chinese email delivery)",host:"smtp.sendcloud.net",port:2525},SendGrid:{description:"SendGrid",host:"smtp.sendgrid.net",port:587},SendinBlue:{description:"Brevo (formerly Sendinblue)",aliases:["Brevo"],host:"smtp-relay.brevo.com",port:587},SendPulse:{description:"SendPulse",host:"smtp-pulse.com",port:465,secure:!0},SES:{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-1":{description:"AWS SES Asia Pacific (Tokyo)",host:"email-smtp.ap-northeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-2":{description:"AWS SES Asia Pacific (Seoul)",host:"email-smtp.ap-northeast-2.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-3":{description:"AWS SES Asia Pacific (Osaka)",host:"email-smtp.ap-northeast-3.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTH-1":{description:"AWS SES Asia Pacific (Mumbai)",host:"email-smtp.ap-south-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-1":{description:"AWS SES Asia Pacific (Singapore)",host:"email-smtp.ap-southeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-2":{description:"AWS SES Asia Pacific (Sydney)",host:"email-smtp.ap-southeast-2.amazonaws.com",port:465,secure:!0},"SES-CA-CENTRAL-1":{description:"AWS SES Canada (Central)",host:"email-smtp.ca-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-CENTRAL-1":{description:"AWS SES Europe (Frankfurt)",host:"email-smtp.eu-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-NORTH-1":{description:"AWS SES Europe (Stockholm)",host:"email-smtp.eu-north-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-1":{description:"AWS SES Europe (Ireland)",host:"email-smtp.eu-west-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-2":{description:"AWS SES Europe (London)",host:"email-smtp.eu-west-2.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-3":{description:"AWS SES Europe (Paris)",host:"email-smtp.eu-west-3.amazonaws.com",port:465,secure:!0},"SES-SA-EAST-1":{description:"AWS SES South America (São Paulo)",host:"email-smtp.sa-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-1":{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-2":{description:"AWS SES US East (Ohio)",host:"email-smtp.us-east-2.amazonaws.com",port:465,secure:!0},"SES-US-GOV-EAST-1":{description:"AWS SES GovCloud (US-East)",host:"email-smtp.us-gov-east-1.amazonaws.com",port:465,secure:!0},"SES-US-GOV-WEST-1":{description:"AWS SES GovCloud (US-West)",host:"email-smtp.us-gov-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-1":{description:"AWS SES US West (N. California)",host:"email-smtp.us-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-2":{description:"AWS SES US West (Oregon)",host:"email-smtp.us-west-2.amazonaws.com",port:465,secure:!0},Seznam:{description:"Seznam Email (Czech email provider)",aliases:["Seznam Email"],domains:["seznam.cz","email.cz","post.cz","spoluzaci.cz"],host:"smtp.seznam.cz",port:465,secure:!0},SMTP2GO:{description:"SMTP2GO",host:"mail.smtp2go.com",port:2525},Sparkpost:{description:"SparkPost",aliases:["SparkPost","SparkPost Mail"],domains:["sparkpost.com"],host:"smtp.sparkpostmail.com",port:587,secure:!1},Tipimail:{description:"Tipimail (email delivery service)",host:"smtp.tipimail.com",port:587},TurboSMTP:{description:"TurboSMTP",host:"pro.turbo-smtp.com",port:465,secure:!0},"TurboSMTP-EU":{description:"TurboSMTP (EU region)",host:"pro.eu.turbo-smtp.com",port:465,secure:!0},Tutanota:{description:"Tutanota (Tuta Mail)",domains:["tutanota.com","tuta.com","tutanota.de","tuta.io"],host:"smtp.tutanota.com",port:465,secure:!0},Yahoo:{description:"Yahoo Mail",domains:["yahoo.com"],host:"smtp.mail.yahoo.com",port:465,secure:!0},Yandex:{description:"Yandex Mail",domains:["yandex.ru"],host:"smtp.yandex.ru",port:465,secure:!0},Zimbra:{description:"Zimbra Mail Server",aliases:["Zimbra Collaboration"],host:"smtp.zimbra.com",port:587,requireTLS:!0},Zoho:{description:"Zoho Mail",host:"smtp.zoho.com",port:465,secure:!0,authMethod:"LOGIN"}}),gu),n={};function s(e){return e.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}Object.keys(i.services).forEach(e=>{const t=i.services[e],r=function(e){const t={};return Object.keys(e).forEach(i=>{["domains","aliases"].includes(i)||(t[i]=e[i])}),t}(t);n[s(e)]=r,[].concat(t.aliases||[]).forEach(e=>{n[s(e)]=r}),[].concat(t.domains||[]).forEach(e=>{n[s(e)]=r})}),e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(fu,fu.exports)),fu.exports}function Mu(){return hu||(hu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=o((lu||(lu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(au()),c=ul(),u=o(pu()),p=r(nl()),d=l;class m extends d.EventEmitter{constructor(e){if(super(),this.pool=e,this.options=e.options,this.logger=this.pool.logger,this.options.auth)switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{const e=new u.default(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"},e.on("token",e=>this.pool.mailer.emit("token",e)),e.on("error",e=>this._fail(e));break}default:if(!this.options.auth.user&&!this.options.auth.pass)break;this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||!1}}this._connection=!1,this._connected=!1,this.messages=0,this.available=!0,this._failed=!1}_fail(e){this._failed||(this._failed=!0,this.emit("error",e))}connect(e){this.pool.getSocket(this.options,(t,i)=>{if(t)return this._fail(t),e(t);let n=!1,s=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,s.host||"",s.port||""),s=Object.assign((0,c.assign)(!1,s),i)),this.connection=new a.default(s),this.connection.on("error",t=>{if(this._fail(t),!n)return n=!0,e(t)}),this.connection.once("end",()=>{this.close(),n=!0}),this.connection.connect(t=>{if(!n){if(!t)return this.auth&&(this.connection.allowsAuth||s.forceAuth)?void this.connection.login(this.auth,t=>{if(!n){if(n=!0,t)return this.connection.close(),this._fail(t),e(t);this._connected=!0,e(null,!0)}}):(n=!0,this._connected=!0,e(null,!0));n=!0}})})}send(e,t){if(!this._connected)return this.connect(i=>i?t(i):this.send(e,t));const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n,cid:this.id},"Sending message %s using #%s to <%s>",n,this.id,s.join(", ")),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.connection.send(i,e.message.createReadStream(),(e,s)=>{if(this.messages++,e)return this.connection.close(),this._fail(e),t(e);s.envelope={from:i.from,to:i.to},s.messageId=n,setImmediate(()=>{if(this.messages>=this.options.maxMessages){const e=new Error("Resource exhausted");e.code=p.EMAXLIMIT,this.connection.close(),this._fail(e)}else this.pool._checkRateLimit(()=>{this.available=!0,this.emit("available")})}),t(null,s)})}close(){this._connected=!1,this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.connection&&this.connection.close(),this.emit("close")}}t.default=m,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(su,su.exports)),su.exports)),u=o(au()),p=o(wu()),d=r(ul()),m=r(nl()),h=r(el());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=d.parseConnectionUrl(e.url),i=i||t.service),this.options=d.assign(!1,e,t,i&&(0,p.default)(i)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.options.maxRequeues="number"==typeof this.options.maxRequeues?this.options.maxRequeues:5,this.logger=d.getLogger(this.options,{component:this.options.component||"smtp-pool"}),this.name="SMTP (pool)",this.version=h.version+"[client:"+h.version+"]",this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:!1,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0},this._closed=!1,this._queue=[],this._connections=[],this._connectionCounter=0,this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}getSocket(e,t){setImmediate(()=>t(null,!1))}send(e,t){if(this._closed){const e=new Error("Connection pool was closed");return e.code=m.ECONNECTION,setImmediate(()=>t(e)),!1}return this._queue.push({mail:e,requeueAttempts:0,callback:t}),this.idling&&this._queue.length>=this.options.maxConnections&&(this.idling=!1),setImmediate(()=>this._processMessages()),!0}close(){let e;const t=this._connections.length;if(this._closed=!0,this._clearRateLimit(),!t&&!this._queue.length)return;for(let i=t-1;i>=0;i--)this._connections[i]&&this._connections[i].available&&(e=this._connections[i],e.close(),this.logger.info({tnx:"connection",cid:e.id,action:"removed"},"Connection #%s removed",e.id));if(t&&!this._connections.length&&this.logger.debug({tnx:"connection"},"All connections removed"),!this._queue.length)return;const i=()=>{if(!this._queue.length)return void this.logger.debug({tnx:"connection"},"Pending queue entries cleared");const e=this._queue.shift();if(e&&"function"==typeof e.callback)try{e.callback(new Error("Connection pool was closed"))}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error: %s",e.message)}setImmediate(i)};setImmediate(i)}_processMessages(){if(this._closed)return;if(!this._queue.length)return void(this.idling||(this.idling=!0,this.emit("idle")));let e=this._connections.find(e=>e.available);if(!e&&this._connections.length<this.options.maxConnections&&(e=this._createConnection()),!e)return void(this.idling=!1);!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));const t=e.queueEntry=this._queue.shift();t.messageId=(e.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,""),e.available=!1,this.logger.debug({tnx:"pool",cid:e.id,messageId:t.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",t.messageId,e.id,e.messages+1),this._rateLimit.limit&&(this._rateLimit.counter++,this._rateLimit.checkpoint||(this._rateLimit.checkpoint=Date.now())),e.send(t.mail,(i,n)=>{if(t===e.queueEntry){try{t.callback(i,n)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}})}_createConnection(){const e=new c.default(this);return e.id=++this._connectionCounter,this.logger.info({tnx:"pool",cid:e.id,action:"conection"},"Created new pool resource #%s",e.id),e.on("available",()=>{this.logger.debug({tnx:"connection",cid:e.id,action:"available"},"Connection #%s became available",e.id),this._closed?this.close():this._processMessages()}),e.once("error",t=>{if(t.code!==m.EMAXLIMIT?this.logger.warn({err:t,tnx:"pool",cid:e.id},"Pool Error for #%s: %s",e.id,t.message):this.logger.debug({tnx:"pool",cid:e.id,action:"maxlimit"},"Max messages limit exchausted for #%s",e.id),e.queueEntry){try{e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}this._removeConnection(e),this._continueProcessing()}),e.once("close",()=>{this.logger.info({tnx:"connection",cid:e.id,action:"closed"},"Connection #%s was closed",e.id),this._removeConnection(e),e.queueEntry?setTimeout(()=>{let t=0;e.queueEntry&&(this._shouldRequeuOnConnectionClose(e.queueEntry)?t=this._requeueEntryOnConnectionClose(e):this._failDeliveryOnConnectionClose(e)),t?setTimeout(()=>this._continueProcessing(),t):this._continueProcessing()},50):(this._closed||!this.idling||this._connections.length||this.emit("clear"),this._continueProcessing())}),this._connections.push(e),e}_shouldRequeuOnConnectionClose(e){return this.options.maxRequeues<0||e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{const t=new Error("Reached maximum number of retries after connection was closed");t.code=m.ECONNECTION,e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",messageId:e.queueEntry.messageId,cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}}_requeueEntryOnConnectionClose(e){const t=Math.min(50*2**e.queueEntry.requeueAttempts,2e3);return e.queueEntry.requeueAttempts+=1,this.logger.debug({tnx:"pool",cid:e.id,messageId:e.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",e.queueEntry.messageId,e.id,e.queueEntry.requeueAttempts),this._queue.unshift(e.queueEntry),e.queueEntry=!1,t}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(e){const t=this._connections.indexOf(e);-1!==t&&this._connections.splice(t,1)}_checkRateLimit(e){if(!this._rateLimit.limit)return e();const t=Date.now();return this._rateLimit.counter<this._rateLimit.limit?e():(this._rateLimit.waiting.push(e),this._rateLimit.checkpoint<=t-this._rateLimit.delta?this._clearRateLimit():void(this._rateLimit.timeout||(this._rateLimit.timeout=setTimeout(()=>this._clearRateLimit(),this._rateLimit.delta-(t-this._rateLimit.checkpoint)),this._rateLimit.checkpoint=t)))}_clearRateLimit(){for(clearTimeout(this._rateLimit.timeout),this._rateLimit.timeout=null,this._rateLimit.counter=0,this._rateLimit.checkpoint=!1;this._rateLimit.waiting.length;){const e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=new c.default(this).auth;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let s=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,s.host||"",s.port||""),s=Object.assign(d.assign(!1,s),t));const r=new u.default(s);let o=!1;r.once("error",e=>{if(!o)return o=!0,r.close(),i(e)}),r.once("end",()=>{if(!o)return o=!0,i(new Error("Connection closed"))});const a=()=>{if(!o)return o=!0,r.quit(),i(null,!0)};r.connect(e=>{if(!o){if(e)return o=!0,r.close(),i(e);if(n&&(r.allowsAuth||s.forceAuth))r.login(n,e=>{if(!o)return e?(o=!0,r.close(),i(e)):void a()});else{if(!n&&r.allowsAuth&&s.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,r.close(),i(e)}a()}}})}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(nu,nu.exports)),nu.exports}var yu,Du={exports:{}};var xu,Lu={exports:{}};var vu,Iu={exports:{}};var bu,Cu={exports:{}};var Eu,Tu,Au={exports:{}};function Su(){return Eu||(Eu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(l),c=r(el()),u=r(ul()),p=r(nl()),d=o(kl()),m=o(Fl());function h(e){return e&&"object"==typeof e&&!e.code&&(e.code=p.ESES),e}class f extends a.default{constructor(e){if(super(),!e||!e.SES||!e.SES.sesClient){const e=new Error("Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=p.ECONFIG,e}this.options=e,this.ses=this.options.SES,this.name="SESTransport",this.version=c.version,this.logger=u.getLogger(this.options,{component:this.options.component||"ses-transport"})}getRegion(e){if(!this.ses.sesClient.config||"function"!=typeof this.ses.sesClient.config.region)return e(null,!1);this.ses.sesClient.config.region().then(t=>e(null,t),t=>e(t))}send(e,t){let i=e.message._headers.find(e=>/^from$/i.test(e.key));if(i){const e=new m.default("text/plain");i=e._convertAddresses(e._parseAddresses(i.value))}const n=e.message.getEnvelope(),s=e.message.messageId(),r=[].concat(n.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:s},"Sending message %s to <%s>",s,r.join(", "));setImmediate(()=>(t=>{e.data._dkim||(e.data._dkim={}),e.data._dkim.skipFields&&"string"==typeof e.data._dkim.skipFields?e.data._dkim.skipFields+=":date:message-id":e.data._dkim.skipFields="date:message-id";const i=e.message.createReadStream(),n=i.pipe(new d.default),s=[];let r=0;n.on("readable",()=>{let e;for(;null!==(e=n.read());)s.push(e),r+=e.length}),i.once("error",e=>n.emit("error",e)),n.once("error",e=>t(e)),n.once("end",()=>t(null,Buffer.concat(s,r)))})((r,o)=>{if(r)return this.logger.error({err:r,tnx:"send",messageId:s},"Failed creating message for %s. %s",s,r.message),t(r);const a=u.copyOwnKeys({Content:{Raw:{Data:o}},FromEmailAddress:i||n.from,Destination:{ToAddresses:n.to}},e.data.ses);this.getRegion((e,i)=>{let r;!e&&i||(i="us-east-1");try{const e=new this.ses.SendEmailCommand(a);r=this.ses.sesClient.send(e)}catch(e){return h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",s,e.message),void setImmediate(()=>t(e))}r.then(e=>{"us-east-1"===i&&(i="email");const s={envelope:{from:n.from,to:n.to},messageId:"<"+e.MessageId+(/@/.test(e.MessageId)?"":"@"+i+".amazonses.com")+">",response:e.MessageId,raw:o};setImmediate(()=>t(null,s))}).catch(e=>{h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",s,e.message),setImmediate(()=>t(e))})})}))}verify(e){let t;e||(t=new Promise((t,i)=>{e=u.callbackPromise(t,i)}));const i=e,n=e=>e&&!["InvalidParameterValue","MessageRejected"].includes(e.code||e.Code||e.name)?i(h(e)):i(null,!0),s={Content:{Raw:{Data:Buffer.from("From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid")}},FromEmailAddress:"invalid@invalid",Destination:{ToAddresses:["invalid@invalid"]}};return this.getRegion(()=>{let e;try{const t=new this.ses.SendEmailCommand(s);e=this.ses.sesClient.send(t)}catch(e){return void setImmediate(()=>n(e))}e.then(()=>setImmediate(()=>n(null))).catch(e=>setImmediate(()=>n(e)))}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Au,Au.exports)),Au.exports}function Nu(){return Tu||(Tu=1,function(e){var t,i=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=Nn&&Nn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var r=t(e),o=0;o<r.length;o++)"default"!==r[o]&&i(s,e,r[o]);return n(s,e),s}),r=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createTransport=I,e.createTestAccount=b,e.getTestMessageUrl=C;const o=r(eu()),a=s(ul()),c=r(Mu()),u=r((yu||(yu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=l,c=o(au()),u=o(wu()),p=r(ul()),d=o(pu()),m=r(nl()),h=r(el());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=p.parseConnectionUrl(e.url),i=i||t.service),this.options=p.assign(!1,e,t,i&&(0,u.default)(i)),this.logger=p.getLogger(this.options,{component:this.options.component||"smtp-transport"}),this.name="SMTP",this.version=h.version+"[client:"+h.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){setImmediate(()=>t(null,!1))}getAuth(e){if(!e)return this.auth&&this.auth.oauth2&&this.mailer&&(this.auth.oauth2.provisionCallback=this.mailer.get("oauth2_provision_cb")||this.auth.oauth2.provisionCallback),this.auth;const t=Object.assign({},this.options.auth&&"object"==typeof this.options.auth?this.options.auth:{},"object"==typeof e?e:{});if(0===Object.keys(t).length)return!1;if("OAUTH2"===(t.type||"").toString().toUpperCase()){if(!t.service&&!t.user)return!1;const e=new d.default(t,this.logger);return e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback,e.on("token",e=>this.mailer.emit("token",e)),e.on("error",e=>this.emit("error",e)),{type:"OAUTH2",user:t.user,oauth2:e,method:"XOAUTH2"}}return{type:(t.type||"").toString().toUpperCase()||"LOGIN",user:t.user,credentials:{user:t.user||"",pass:t.pass,options:t.options},method:(t.method||"").trim().toUpperCase()||this.options.authMethod||!1}}send(e,t){this.getSocket(this.options,(i,n)=>{if(i)return t(i);let s=!1,r=this.options;n&&n.connection&&(this.logger.info({tnx:"proxy",remoteAddress:n.connection.remoteAddress,remotePort:n.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",n.connection.remoteAddress,n.connection.remotePort,r.host||"",r.port||""),r=Object.assign(p.assign(!1,r),n));const o=new c.default(r);let a;const l=()=>{a&&a!==this.auth&&a.oauth2&&a.oauth2.removeAllListeners(),a=null};o.once("error",e=>{if(!s)return s=!0,l(),o.close(),t(e)});const u=()=>{const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,r.join(", ")),o.send(i,e.message.createReadStream(),(e,r)=>{if(!s){if(s=!0,l(),o.close(),e)return this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",n,e.message),t(e);r.envelope={from:i.from,to:i.to},r.messageId=n;try{return t(null,r)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",n,e.message)}}})};o.connect(i=>{if(!s){if(i)return s=!0,o.close(),t(i);a=this.getAuth(e.data.auth),a&&(o.allowsAuth||r.forceAuth)?o.login(a,e=>{if(l(),!s)return e?(s=!0,o.close(),t(e)):void u()}):u()}})})}verify(e){let t;e||(t=new Promise((t,i)=>{e=p.callbackPromise(t,i)}));const i=e;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let n=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:n.host||"",destPort:n.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,n.host||"",n.port||""),n=Object.assign(p.assign(!1,n),t));const s=new c.default(n);let r,o=!1;const a=()=>{r&&r!==this.auth&&r.oauth2&&r.oauth2.removeAllListeners(),r=null};s.once("error",e=>{if(!o)return o=!0,a(),s.close(),i(e)}),s.once("end",()=>{if(!o)return o=!0,a(),i(new Error("Connection closed"))});const l=()=>{if(!o)return o=!0,a(),s.quit(),i(null,!0)};s.connect(e=>{if(!o){if(e)return o=!0,s.close(),i(e);if(r=this.getAuth({}),r&&(s.allowsAuth||n.forceAuth))s.login(r,e=>{if(a(),!o)return e?(o=!0,s.close(),i(e)):void l()});else{if(!r&&s.allowsAuth&&n.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,a(),s.close(),i(e)}l()}}})}),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Du,Du.exports)),Du.exports)),p=r((xu||(xu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=v,c=r(el()),l=r(ul()),u=r(nl()),p=o(kl()),d=o(Xl());t.default=class{constructor(e){e=e||{},this._spawn=a.spawn,this.options=e,this.name="Sendmail",this.version=c.version,this.path="sendmail",this.args=!1,this.logger=l.getLogger(this.options,{component:this.options.component||"sendmail"}),"string"==typeof e?this.path=e:"object"==typeof e&&(e.path&&(this.path=e.path),Array.isArray(e.args)&&(this.args=e.args)),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId();let s;if([].concat(i.from||[]).concat(i.to||[]).some(e=>/^"?-/.test(e))){const e=new Error("Can not send mail. Invalid envelope addresses.");return e.code=u.ESENDMAIL,t(e)}const r=this.args?["-i"].concat(this.args).concat(i.to):["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to),o=e=>{if(!s)return s=!0,"function"==typeof t?e?t(e):t(null,{envelope:i,messageId:n,response:"Messages queued for delivery"}):void 0};let a;try{a=this._spawn(this.path,r)}catch(e){return this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred while spawning sendmail. %s",e.message),o(e)}if(!a){const e=new Error("sendmail was not found");return e.code=u.ESENDMAIL,o(e)}{a.on("error",e=>{this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred when sending message %s. %s",n,e.message),o(e)}),a.once("exit",e=>{if(!e)return o();const t=new Error(127===e?"Sendmail command not found, process exited with code "+e:"Sendmail exited with code "+e);t.code=u.ESENDMAIL,this.logger.error({err:t,tnx:"stdin",messageId:n},"Error sending message %s to sendmail. %s",n,t.message),o(t)}),a.once("close",o),a.stdin.on("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when piping message %s to sendmail. %s",n,e.message),o(e)});const t=[].concat(i.to||[]);t.length>3&&t.push("...and "+t.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,t.join(", "));const s=e.message.createReadStream();let r=s;this.options.newline&&(r=s.pipe(this.winbreak?new p.default:new d.default),s.once("error",e=>r.emit("error",e))),r.once("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when generating message %s. %s",n,e.message),a.kill("SIGINT"),o(e)}),r.pipe(a.stdin)}}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Lu,Lu.exports)),Lu.exports)),d=r((vu||(vu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t}),o=Nn&&Nn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(el()),c=r(ul()),l=o(kl()),u=o(Xl());t.default=class{constructor(e){e=e||{},this.options=e,this.name="StreamTransport",this.version=a.version,this.logger=c.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s> using %s line breaks",n,s.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let s;try{if(s=e.message.createReadStream(),this.options.newline){const e=s;s=e.pipe(this.winbreak?new l.default:new u.default),e.once("error",e=>s.emit("error",e))}}catch(e){return this.logger.error({err:e,tnx:"send",messageId:n},"Creating send stream failed for %s. %s",n,e.message),t(e)}if(!this.options.buffer)return s.once("error",e=>{this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message)}),t(null,{envelope:i,messageId:n,message:s});const r=[];let o=0;s.on("readable",()=>{let e;for(;null!==(e=s.read());)r.push(e),o+=e.length}),s.once("error",e=>(this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message),t(e))),s.on("end",()=>t(null,{envelope:i,messageId:n,message:Buffer.concat(r,o)}))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Iu,Iu.exports)),Iu.exports)),m=r((bu||(bu=1,function(e,t){var i,n=Nn&&Nn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(t,i);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,s)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=Nn&&Nn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Nn&&Nn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o<r.length;o++)"default"!==r[o]&&n(t,e,r[o]);return s(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=r(el()),a=r(ul());t.default=class{constructor(e){e=e||{},this.options=e,this.name="JSONTransport",this.version=o.version,this.logger=a.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Composing JSON structure of %s to <%s>",n,s.join(", ")),setImmediate(()=>{e.normalize((e,s)=>e?(this.logger.error({err:e,tnx:"send",messageId:n},"Failed building JSON structure for %s. %s",n,e.message),t(e)):(delete s.envelope,delete s.normalizedHeaders,t(null,{envelope:i,messageId:n,message:this.options.skipEncoding?s:JSON.stringify(s)})))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Cu,Cu.exports)),Cu.exports)),h=r(Su()),f=s(nl()),g=r(ll()),w=s(el()),M=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),y=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),D=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,x=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let L=!1;function I(e,t){let i;if("object"==typeof e&&"function"!=typeof e.send||"string"==typeof e&&/^(smtps?|direct):/i.test(e)){const t="string"==typeof e?e:e.url;if(t){const n=a.parseConnectionUrl(t);i="object"==typeof e?a.assign(!1,a.copyOwnKeys({},e,e=>"url"===e),n):n}else i=e;if(i.pool)e=new c.default(i);else if(i.sendmail)e=new p.default(i);else if(i.streamTransport)e=new d.default(i);else if(i.jsonTransport)e=new m.default(i);else if(i.SES){const t=i.SES;if(t.ses&&t.aws){const e=new Error("Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=f.ECONFIG,e}e=new h.default(i)}else e=new u.default(i)}return new o.default(e,i,t)}function b(e,t){let i;t||"function"!=typeof e||(t=e,e=!1),t||(i=new Promise((e,i)=>{t=a.callbackPromise(e,i)}));const n=t;if(x&&L)return setImmediate(()=>n(null,L)),i;e=e||M;const s=[];let r=0;const o={},c={requestor:w.name,version:w.version};D&&(o.Authorization="Bearer "+D);const l={contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(c))};/^https:/i.test(e)&&(l.tls={rejectUnauthorized:!0});const u=(0,g.default)(e+"/user",l);return u.on("readable",()=>{let e;for(;null!==(e=u.read());)s.push(e),r+=e.length}),u.once("error",e=>n(e)),u.once("end",()=>{const e=Buffer.concat(s,r);let t;try{t=JSON.parse(e.toString())}catch(e){return n(e)}if("success"!==t.status||t.error)return n(new Error(t.error||"Request failed"));delete t.status,L=t,n(null,L)}),i}function C(e){if(!e||!e.response)return!1;const t=new Map,i=e.response.toString();if(i.length>2&&"]"===i.charAt(i.length-1)){const e=i.indexOf("[",i.lastIndexOf("]",i.length-2)+1);if(e>=0&&e<i.length-2){i.substring(e+1,i.length-1).replace(/\b([A-Z0-9]+)=([^\s]+)/g,(e,i,n)=>(t.set(i,n),e))}}return!(!t.has("STATUS")||!t.has("MSGID"))&&(L&&L.web||y)+"/message/"+t.get("MSGID")}const E={createTransport:I,createTestAccount:b,getTestMessageUrl:C};e.default=E,Object.defineProperty(e,"default",{value:e,enumerable:!1,writable:!0,configurable:!0})}(Kc)),Kc}
|
|
7
7
|
/*!
|
|
8
|
-
* w-email v1.1.
|
|
8
|
+
* w-email v1.1.7
|
|
9
9
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
10
10
|
* Released under the MIT License.
|
|
11
|
-
*/!function(e){e.exports=function(e){var t=Array.isArray,i="object"==typeof Nn&&Nn&&Nn.Object===Object&&Nn,n="object"==typeof self&&self&&self.Object===Object&&self,s=i||n||Function("return this")(),r=s.Symbol,o=Object.prototype,a=o.hasOwnProperty,c=o.toString,l=r?r.toStringTag:void 0,u=Object.prototype.toString,p=r?r.toStringTag:void 0;function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":p&&p in Object(e)?function(e){var t=a.call(e,l),i=e[l];try{e[l]=void 0;var n=!0}catch(e){}var s=c.call(e);return n&&(t?e[l]=i:delete e[l]),s}(e):function(e){return u.call(e)}(e)}function m(e){return null!=e&&"object"==typeof e}function h(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==d(e)}var f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var M,y=s["__core-js_shared__"],D=(M=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",x=Function.prototype.toString,L=/^\[object .+?Constructor\]$/,v=Function.prototype,I=Object.prototype,b=v.toString,C=I.hasOwnProperty,E=RegExp("^"+b.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T(e){if(!w(e)||D&&D in e)return!1;var t=function(e){if(!w(e))return!1;var t=d(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?E:L;return t.test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function A(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return T(i)?i:void 0}var S=A(Object,"create"),N=Object.prototype.hasOwnProperty,k=Object.prototype.hasOwnProperty;function j(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Z(e,t){return e===t||e!=e&&t!=t}function z(e,t){for(var i=e.length;i--;)if(Z(e[i][0],t))return i;return-1}j.prototype.clear=function(){this.__data__=S?S(null):{},this.size=0},j.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},j.prototype.get=function(e){var t=this.__data__;if(S){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return N.call(t,e)?t[e]:void 0},j.prototype.has=function(e){var t=this.__data__;return S?void 0!==t[e]:k.call(t,e)},j.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=S&&void 0===t?"__lodash_hash_undefined__":t,this};var Y=Array.prototype.splice;function X(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,i=z(t,e);return!(i<0||(i==t.length-1?t.pop():Y.call(t,i,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,i=z(t,e);return i<0?void 0:t[i][1]},X.prototype.has=function(e){return z(this.__data__,e)>-1},X.prototype.set=function(e,t){var i=this.__data__,n=z(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var F=A(s,"Map");function U(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function G(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function P(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var o=e.apply(this,n);return i.cache=r.set(s,o)||r,o};return i.cache=new(P.Cache||G),i}G.prototype.clear=function(){this.size=0,this.__data__={hash:new j,map:new(F||X),string:new j}},G.prototype.delete=function(e){var t=U(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return U(this,e).get(e)},G.prototype.has=function(e){return U(this,e).has(e)},G.prototype.set=function(e,t){var i=U(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},P.Cache=G;var K,O,_,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/\\(\\)?/g,B=(K=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,i,n,s){t.push(n?s.replace(H,"$1"):i||e)}),t},O=P(K,function(e){return 500===_.size&&_.clear(),e}),_=O.cache,O),V=B,Q=r?r.prototype:void 0,R=Q?Q.toString:void 0;function J(e){if("string"==typeof e)return e;if(t(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,s=Array(n);++i<n;)s[i]=t(e[i],i,e);return s}(e,J)+"";if(h(e))return R?R.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}function q(e){return null==e?"":J(e)}function $(e,i){return t(e)?e:function(e,i){if(t(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!h(e))||g.test(e)||!f.test(e)||null!=i&&e in Object(i)}(e,i)?[e]:V(q(e))}function ee(e){if("string"==typeof e||h(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function te(e,t,i){var n=null==e?void 0:function(e,t){for(var i=0,n=(t=$(t,e)).length;null!=e&&i<n;)e=e[ee(t[i++])];return i&&i==n?e:void 0}(e,t);return void 0===n?i:n}function ie(e){return"[object String]"===Object.prototype.toString.call(e)}function ne(e){return"[object Array]"===Object.prototype.toString.call(e)}function se(e){return"[object Object]"===Object.prototype.toString.call(e)}var re=/\s/,oe=/^\s+/;function ae(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}(e)+1).replace(oe,""):e}var ce=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ue=/^0o[0-7]+$/i,pe=parseInt;function de(e){if("number"==typeof e)return e;if(h(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ae(e);var i=le.test(e);return i||ue.test(e)?pe(e.slice(2),i?2:8):ce.test(e)?NaN:+e}var me=1/0;function he(e){return e?(e=de(e))===me||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fe(e){var t=he(e),i=t%1;return t==t?i?t-i:t:0}function ge(e){return!0===(t=e)||!1===t||m(t)&&"[object Boolean]"==d(t);var t}function we(e){return!(!ie(e)||""===e)}function Me(e){let t=!1;if(we(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(function(e){return e!=e}(e))return!1;t=!0}return t}function ye(e){return Me(e)?he(e):0}function De(e,t={}){let i=te(t,"useLimitSafe",null);return ge(i)||(i=!1),!!Me(e)&&(e=ye(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==fe(n));var n}var xe=s.isFinite,Le=Math.min,ve=function(){var e=Math.round;return function(t,i){if(t=de(t),(i=null==i?0:Le(fe(i),292))&&xe(t)){var n=(q(t)+"e").split("e");return+((n=(q(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}(),Ie=ve;function be(e,t={}){let i=te(t,"useClampSafe",null);ge(i)||(i=!1);let n=te(t,"useLimitSafe",null);ge(n)||(n=!1);let s=te(t,"returnWithStateAndMsg",null);ge(s)||(s=!1);let r=e=>s?{state:"success",msg:e}:e,o=e=>{if(s)return{state:"error",msg:e};throw new Error(e)};if(!Me(e))return r(0);let a=null;try{e=ye(e),a=Ie(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),r(a))}let Ce=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function Ee(e,t,i){let n=te(e,t);return null==n?i:n}function Te(e){return ie(e)?e:"number"==typeof e&&Number.isFinite(e)?String(e):null}function Ae(e){return!e||ie(e)&&""===e.trim()}function Se(e){if(!ie(e))return null;let t=e.trim(),i=t.lastIndexOf("@");if(i<0)return null;let n=t.slice(0,i),s=t.slice(i+1);if(r=s,[...r].some(e=>e.charCodeAt(0)>127)){if(function(e){return[...e].some(e=>{let t=e.charCodeAt(0);return t<=32||127===t||"/\\?#%:@[]".includes(e)})}(s))return null;try{s=new URL(`http://${s}`).hostname}catch(e){return null}}var r;return t=`${n}@${s}`,function(e){return!!we(e)&&!(e.length>254)&&!(e.indexOf("@")>64)&&Ce.test(e)}(t)?t:null}function Ne(e,t){let i=te(e,t);if(!i)return{emails:[]};let n=ne(i);if(ie(i)&&(i=[i]),!ne(i))return{err:`${t} is not string or array`};let s=[];for(let e=0;e<i.length;e++){if(Ae(i[e]))continue;let r=Se(i[e]);if(null===r)return{err:n?`${t}[${e}] is not email`:`${t} is not email`};s.push(r)}return{emails:s}}function ke(e){if(!se(e))return!1;let t=e.filename;if(null!=t&&!1!==t&&!ie(t))return!1;if(e.raw)return!0;if(ie(e.path)&&""!==e.path)return!0;if(ie(e.href)&&""!==e.href)return!0;let i=e.content;return ie(i)||Buffer.isBuffer(i)||!!i&&"function"==typeof i.pipe}return function(t={}){let i=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}(),n=e=>(i.reject(e),i);try{let s=Se(te(t,"srcEmail"));if(null===s)return n("srcEmail is not email");let r=Te(Ee(t,"srcName","system by w-email"));if(null===r)return n("srcName is not string");r=r.replace(/[\r\n]+/g," ").trim();let o=Te(Ee(t,"srcPW",""));if(null===o)return n("srcPW is not string");let a=Ee(t,"srcHost","smtp.gmail.com");if(!ie(a)||""===a.trim())return n("srcHost is not effective string");a=a.trim();let c=Ee(t,"srcPort",587);if(!function(e,t={}){return!!De(e,t)&&be(e)>0}(c)||be(c)>65535)return n("srcPort is not valid port");c=be(c);let l=Te(Ee(t,"emTitle",""));if(null===l)return n("emTitle is not string");let u=Ee(t,"emContent","");if(!Buffer.isBuffer(u)&&(u=Te(u),null===u))return n("emContent is not string");let p=function(e){let t=te(e,"emAttachments");if(!t)return{atts:[]};let i=ne(t);if(se(t)&&(t=[t]),!ne(t))return{err:"emAttachments is not object or array"};let n=[];for(let e=0;e<t.length;e++)if(!Ae(t[e])){if(!ke(t[e]))return{err:i?`emAttachments[${e}] is not valid attachment`:"emAttachments is not valid attachment"};n.push(t[e])}return{atts:n}}(t);if(p.err)return n(p.err);let d=Ne(t,"toEmails");if(d.err)return n(d.err);let m=Ne(t,"toEmailsCC");if(m.err)return n(m.err);let h=Ne(t,"toEmailsBCC");if(h.err)return n(h.err);if(d.emails.length+m.emails.length+h.emails.length===0)return n("no recipients");let f=e.createTransport({host:a,port:c,auth:{user:s,pass:o},secure:465===c}),g={from:{name:r,address:s},to:d.emails,cc:m.emails,bcc:h.emails,subject:l,html:u,attachments:p.atts};f.sendMail(g,function(e,t){e?i.reject(e):i.resolve(t.response)})}catch(e){i.reject(e)}return i}}(Su())}(Gc);var Nu=kn(Gc.exports);let ku=["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"];function ju(e,t={}){let i=[],n=Ae(t,"useKeyForError",null);Oi(n)||(n=!1);let s=Ae(t,"useOnlyOneError",null);if(Oi(s)||(s=!1),Si(e)||(n?i.push("keyInvalidPassword"):i.push("密碼非有效字串")),wt(i)>0)throw new Error(i[0]);let r=Ae(t,"numLenMin","");(!Bi(r)||qi(r)<0)&&(r=8),r=qi(r);let o=Ae(t,"numLenMax","");if((!Bi(o)||qi(o)<0)&&(o=30),o=qi(o),r>o&&(n?i.push("keyLimNumLenMinOrMax"):i.push("設定密碼最小長度大於最大長度")),wt(i)>0)throw new Error(i[0]);let a=Ae(t,"noSpace",null);if(Oi(a)||(a=!0),a&&(Ni(c=e)&&null!==c.match(/^.*\s+.*$/)&&(n?i.push("keyLimHasSpace"):i.push("密碼不可包含空白字元")),s&&wt(i)>0))throw new Error(i[0]);var c;let l=Ae(t,"onlyAscii",null);if(Oi(l)||(l=!0),l&&(/[^\x20-\x7e]/.test(e)&&(n?i.push("keyLimNonAsciiChar"):i.push("密碼僅允許使用英文大小寫、數字及特殊符號")),s&&wt(i)>0))throw new Error(i[0]);if(wt(e)<r&&(n?i.push("keyLimNumLenMin"):i.push(`密碼長度須大於等於${r}個字元`)),s&&wt(i)>0)throw new Error(i[0]);if(wt(e)>o&&(n?i.push("keyLimNumLenMax"):i.push(`密碼長度須小於等於${o}個字元`)),s&&wt(i)>0)throw new Error(i[0]);let u=Ae(t,"requireLetter",null);Oi(u)||(u=!1);let p=Ae(t,"requireUppercase",null);Oi(p)||(p=!0);let d=Ae(t,"requireLowercase",null);Oi(d)||(d=!0);let m=Ae(t,"requireDigit",null);Oi(m)||(m=!0);let h=Ae(t,"requireSpecial",null);if(Oi(h)||(h=!0),u&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[a-zA-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireLetter"):i.push("密碼須包含至少一個英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(p&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[A-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireUppercase"):i.push("密碼須包含至少一個大寫英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(d&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[a-z]+.*$/))}(e)&&(n?i.push("keyLimRequireLowercase"):i.push("密碼須包含至少一個小寫英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(m&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[0-9]+.*$/))}(e)&&(n?i.push("keyLimRequireDigit"):i.push("密碼須包含至少一個數字")),s&&wt(i)>0)throw new Error(i[0]);if(h&&!function(e){return!!Ni(e)&&/[!-/:-@[-`{-~]/.test(e);
|
|
11
|
+
*/!function(e){e.exports=function(e){var t=Array.isArray,i="object"==typeof Nn&&Nn&&Nn.Object===Object&&Nn,n="object"==typeof self&&self&&self.Object===Object&&self,s=i||n||Function("return this")(),r=s.Symbol,o=Object.prototype,a=o.hasOwnProperty,c=o.toString,l=r?r.toStringTag:void 0,u=Object.prototype.toString,p=r?r.toStringTag:void 0;function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":p&&p in Object(e)?function(e){var t=a.call(e,l),i=e[l];try{e[l]=void 0;var n=!0}catch(e){}var s=c.call(e);return n&&(t?e[l]=i:delete e[l]),s}(e):function(e){return u.call(e)}(e)}function m(e){return null!=e&&"object"==typeof e}function h(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==d(e)}var f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var M,y=s["__core-js_shared__"],D=(M=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",x=Function.prototype.toString,L=/^\[object .+?Constructor\]$/,v=Function.prototype,I=Object.prototype,b=v.toString,C=I.hasOwnProperty,E=RegExp("^"+b.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T(e){if(!w(e)||D&&D in e)return!1;var t=function(e){if(!w(e))return!1;var t=d(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?E:L;return t.test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function A(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return T(i)?i:void 0}var S=A(Object,"create"),N=Object.prototype.hasOwnProperty,k=Object.prototype.hasOwnProperty;function j(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Z(e,t){return e===t||e!=e&&t!=t}function z(e,t){for(var i=e.length;i--;)if(Z(e[i][0],t))return i;return-1}j.prototype.clear=function(){this.__data__=S?S(null):{},this.size=0},j.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},j.prototype.get=function(e){var t=this.__data__;if(S){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return N.call(t,e)?t[e]:void 0},j.prototype.has=function(e){var t=this.__data__;return S?void 0!==t[e]:k.call(t,e)},j.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=S&&void 0===t?"__lodash_hash_undefined__":t,this};var Y=Array.prototype.splice;function X(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,i=z(t,e);return!(i<0||(i==t.length-1?t.pop():Y.call(t,i,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,i=z(t,e);return i<0?void 0:t[i][1]},X.prototype.has=function(e){return z(this.__data__,e)>-1},X.prototype.set=function(e,t){var i=this.__data__,n=z(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var F=A(s,"Map");function U(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function G(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function P(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var o=e.apply(this,n);return i.cache=r.set(s,o)||r,o};return i.cache=new(P.Cache||G),i}G.prototype.clear=function(){this.size=0,this.__data__={hash:new j,map:new(F||X),string:new j}},G.prototype.delete=function(e){var t=U(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return U(this,e).get(e)},G.prototype.has=function(e){return U(this,e).has(e)},G.prototype.set=function(e,t){var i=U(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},P.Cache=G;var K,O,_,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/\\(\\)?/g,B=(K=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,i,n,s){t.push(n?s.replace(H,"$1"):i||e)}),t},O=P(K,function(e){return 500===_.size&&_.clear(),e}),_=O.cache,O),V=B,Q=r?r.prototype:void 0,R=Q?Q.toString:void 0;function J(e){if("string"==typeof e)return e;if(t(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,s=Array(n);++i<n;)s[i]=t(e[i],i,e);return s}(e,J)+"";if(h(e))return R?R.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}function q(e){return null==e?"":J(e)}function $(e,i){return t(e)?e:function(e,i){if(t(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!h(e))||g.test(e)||!f.test(e)||null!=i&&e in Object(i)}(e,i)?[e]:V(q(e))}function ee(e){if("string"==typeof e||h(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function te(e,t,i){var n=null==e?void 0:function(e,t){for(var i=0,n=(t=$(t,e)).length;null!=e&&i<n;)e=e[ee(t[i++])];return i&&i==n?e:void 0}(e,t);return void 0===n?i:n}function ie(e){return"[object String]"===Object.prototype.toString.call(e)}function ne(e){return"[object Array]"===Object.prototype.toString.call(e)}function se(e){return"[object Object]"===Object.prototype.toString.call(e)}var re=/\s/,oe=/^\s+/;function ae(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}(e)+1).replace(oe,""):e}var ce=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ue=/^0o[0-7]+$/i,pe=parseInt;function de(e){if("number"==typeof e)return e;if(h(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ae(e);var i=le.test(e);return i||ue.test(e)?pe(e.slice(2),i?2:8):ce.test(e)?NaN:+e}var me=1/0;function he(e){return e?(e=de(e))===me||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fe(e){var t=he(e),i=t%1;return t==t?i?t-i:t:0}function ge(e){return!0===(t=e)||!1===t||m(t)&&"[object Boolean]"==d(t);var t}function we(e){return!(!ie(e)||""===e)}function Me(e){let t=!1;if(we(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(function(e){return e!=e}(e))return!1;t=!0}return t}function ye(e){return Me(e)?he(e):0}function De(e,t={}){let i=te(t,"useLimitSafe",null);return ge(i)||(i=!1),!!Me(e)&&(e=ye(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==fe(n));var n}var xe=s.isFinite,Le=Math.min,ve=function(){var e=Math.round;return function(t,i){if(t=de(t),(i=null==i?0:Le(fe(i),292))&&xe(t)){var n=(q(t)+"e").split("e");return+((n=(q(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}(),Ie=ve;function be(e,t={}){let i=te(t,"useClampSafe",null);ge(i)||(i=!1);let n=te(t,"useLimitSafe",null);ge(n)||(n=!1);let s=te(t,"returnWithStateAndMsg",null);ge(s)||(s=!1);let r=e=>s?{state:"success",msg:e}:e,o=e=>{if(s)return{state:"error",msg:e};throw new Error(e)};if(!Me(e))return r(0);let a=null;try{e=ye(e),a=Ie(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),r(a))}let Ce=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function Ee(e,t,i){let n=te(e,t);return null==n?i:n}function Te(e){return ie(e)?e:"number"==typeof e&&Number.isFinite(e)?String(e):null}function Ae(e){return!e||ie(e)&&""===e.trim()}function Se(e){if(!ie(e))return null;let t=e.trim(),i=t.lastIndexOf("@");if(i<0)return null;let n=t.slice(0,i),s=t.slice(i+1);if(r=s,[...r].some(e=>e.charCodeAt(0)>127)){if(function(e){return[...e].some(e=>{let t=e.charCodeAt(0);return t<=32||127===t||"/\\?#%:@[]".includes(e)})}(s))return null;try{s=new URL(`http://${s}`).hostname}catch(e){return null}}var r;return t=`${n}@${s}`,function(e){return!!we(e)&&!(e.length>254)&&!(e.indexOf("@")>64)&&Ce.test(e)}(t)?t:null}function Ne(e,t){let i=te(e,t);if(!i)return{emails:[]};let n=ne(i);if(ie(i)&&(i=[i]),!ne(i))return{err:`${t} is not string or array`};let s=[];for(let e=0;e<i.length;e++){if(Ae(i[e]))continue;let r=Se(i[e]);if(null===r)return{err:n?`${t}[${e}] is not email`:`${t} is not email`};s.push(r)}return{emails:s}}function ke(e){if(!se(e))return!1;let t=e.filename;if(null!=t&&!1!==t&&!ie(t))return!1;if(e.raw)return!0;if(ie(e.path)&&""!==e.path)return!0;if(ie(e.href)&&""!==e.href)return!0;let i=e.content;return ie(i)||Buffer.isBuffer(i)||!!i&&"function"==typeof i.pipe}return function(t={}){let i=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}(),n=e=>(i.reject(e),i);try{let s=Se(te(t,"srcEmail"));if(null===s)return n("srcEmail is not email");let r=Te(Ee(t,"srcName","system by w-email"));if(null===r)return n("srcName is not string");r=r.replace(/[\r\n]+/g," ").trim();let o=Te(Ee(t,"srcPW",""));if(null===o)return n("srcPW is not string");let a=Ee(t,"srcHost","smtp.gmail.com");if(!ie(a)||""===a.trim())return n("srcHost is not effective string");a=a.trim();let c=Ee(t,"srcPort",587);if(!function(e,t={}){return!!De(e,t)&&be(e)>0}(c)||be(c)>65535)return n("srcPort is not valid port");c=be(c);let l=Te(Ee(t,"emTitle",""));if(null===l)return n("emTitle is not string");let u=Ee(t,"emContent","");if(!Buffer.isBuffer(u)&&(u=Te(u),null===u))return n("emContent is not string");let p=function(e){let t=te(e,"emAttachments");if(!t)return{atts:[]};let i=ne(t);if(se(t)&&(t=[t]),!ne(t))return{err:"emAttachments is not object or array"};let n=[];for(let e=0;e<t.length;e++)if(!Ae(t[e])){if(!ke(t[e]))return{err:i?`emAttachments[${e}] is not valid attachment`:"emAttachments is not valid attachment"};n.push(t[e])}return{atts:n}}(t);if(p.err)return n(p.err);let d=Ne(t,"toEmails");if(d.err)return n(d.err);let m=Ne(t,"toEmailsCC");if(m.err)return n(m.err);let h=Ne(t,"toEmailsBCC");if(h.err)return n(h.err);if(d.emails.length+m.emails.length+h.emails.length===0)return n("no recipients");let f=e.createTransport({host:a,port:c,auth:{user:s,pass:o},secure:465===c}),g={from:{name:r,address:s},to:d.emails,cc:m.emails,bcc:h.emails,subject:l,html:u,attachments:p.atts};f.sendMail(g,function(e,t){e?i.reject(e):i.resolve(t.response)})}catch(e){i.reject(e)}return i}}(Nu())}(Pc);var ku=kn(Pc.exports);let ju=["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"];function Zu(e,t={}){let i=[],n=Ae(t,"useKeyForError",null);Oi(n)||(n=!1);let s=Ae(t,"useOnlyOneError",null);if(Oi(s)||(s=!1),Si(e)||(n?i.push("keyInvalidPassword"):i.push("密碼非有效字串")),wt(i)>0)throw new Error(i[0]);let r=Ae(t,"numLenMin","");(!Bi(r)||qi(r)<0)&&(r=8),r=qi(r);let o=Ae(t,"numLenMax","");if((!Bi(o)||qi(o)<0)&&(o=30),o=qi(o),r>o&&(n?i.push("keyLimNumLenMinOrMax"):i.push("設定密碼最小長度大於最大長度")),wt(i)>0)throw new Error(i[0]);let a=Ae(t,"noSpace",null);if(Oi(a)||(a=!0),a&&(Ni(c=e)&&null!==c.match(/^.*\s+.*$/)&&(n?i.push("keyLimHasSpace"):i.push("密碼不可包含空白字元")),s&&wt(i)>0))throw new Error(i[0]);var c;let l=Ae(t,"onlyAscii",null);if(Oi(l)||(l=!0),l&&(/[^\x20-\x7e]/.test(e)&&(n?i.push("keyLimNonAsciiChar"):i.push("密碼僅允許使用英文大小寫、數字及特殊符號")),s&&wt(i)>0))throw new Error(i[0]);if(wt(e)<r&&(n?i.push("keyLimNumLenMin"):i.push(`密碼長度須大於等於${r}個字元`)),s&&wt(i)>0)throw new Error(i[0]);if(wt(e)>o&&(n?i.push("keyLimNumLenMax"):i.push(`密碼長度須小於等於${o}個字元`)),s&&wt(i)>0)throw new Error(i[0]);let u=Ae(t,"requireLetter",null);Oi(u)||(u=!1);let p=Ae(t,"requireUppercase",null);Oi(p)||(p=!0);let d=Ae(t,"requireLowercase",null);Oi(d)||(d=!0);let m=Ae(t,"requireDigit",null);Oi(m)||(m=!0);let h=Ae(t,"requireSpecial",null);if(Oi(h)||(h=!0),u&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[a-zA-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireLetter"):i.push("密碼須包含至少一個英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(p&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[A-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireUppercase"):i.push("密碼須包含至少一個大寫英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(d&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[a-z]+.*$/))}(e)&&(n?i.push("keyLimRequireLowercase"):i.push("密碼須包含至少一個小寫英文字母")),s&&wt(i)>0)throw new Error(i[0]);if(m&&!function(e){return!!Ni(e)&&!(null===e.match(/^.*[0-9]+.*$/))}(e)&&(n?i.push("keyLimRequireDigit"):i.push("密碼須包含至少一個數字")),s&&wt(i)>0)throw new Error(i[0]);if(h&&!function(e){return!!Ni(e)&&/[!-/:-@[-`{-~]/.test(e);
|
|
12
12
|
//!"#$%&'()*+,-./ :;<=>?@ [\]^_` {|}~
|
|
13
|
-
}(e)&&(n?i.push("keyLimRequireSpecial"):i.push("密碼須包含至少一個特殊符號")),s&&wt(i)>0)throw new Error(i[0]);let f=Ae(t,"forbiddenChars",null);if(en(f)||(f=[]),wt(f)>0){for(let t of f)if(e.includes(t)){if(n){i.push("keyLimForbiddenChar");break}i.push(`密碼不可包含字元:${t}`)}if(s&&wt(i)>0)throw new Error(i[0])}let g=Ae(t,"commonPasswordBlacklist",null);if(en(g)||(g=ku),wt(g)>0){let t=e.toLowerCase();if(g.some(e=>Si(e)&&t===e.toLowerCase())&&(n?i.push("keyLimCommonPassword"):i.push("此密碼為常見弱密碼,不允許使用")),s&&wt(i)>0)throw new Error(i[0])}let w=Ae(t,"account",""),M=Ae(t,"noConsecutiveCharsFromAccount",null);Oi(M)||(M=!1);let y=Ae(t,"consecutiveCharsMinMatch","");if($i(y)||(y=3),y=qi(y),M&&Si(w)&&wt(w)>=y){let t=[...w.toLowerCase()],r=e.toLowerCase(),o=!1;for(let e=0;e<=t.length-y;e++){let i=t.slice(e,e+y).join("");if(r.includes(i)){o=!0;break}}if(o&&(n?i.push("keyLimConsecutiveCharsFromAccount"):i.push(`密碼不可包含與帳號相同之${y}個以上連續字元`)),s&&wt(i)>0)throw new Error(i[0])}if(wt(i)>0)throw new Error(i.join(" | "));return!0}function Zu(e,t){return Mi(e,t)}function zu(){let e=Kn(),t={};function i(t,i){Bn(e,t,[i],{tag:"cache"})}function n(e,n={}){if(ps(t,e))return;let s=Ae(n,"fun");wn(s)||(s=async()=>{});let r=Ae(n,"inputs");en(r)||(r=[]);let o=Ae(n,"timeExpired");$i(o)||(o=5e3),o=qi(o);let a=Ae(n,"timeFrom");"end"!==a&&(a="start");let c=Ae(n,"useCacheWhenError");Oi(c)||(c=!1);let l=Ae(n,"useCloneDeep");Oi(l)||(l=!0),t[e]={needExec:!0,fun:s,pm:null,gen:0,inputs:r,value:null,time:null,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l},i("message",{fun:"set",key:e,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l})}async function s(e,n={}){if(ps(t,e)){let s=t[e],r=Ae(n,"useCloneDeep");if(Oi(r)||(r=s.useCloneDeep),s.pm)return i("message",{fun:"get",key:e,msg:"waiting"}),await s.pm,r?vo(s.value):s.value;let o=Date.now(),a=s.needExec,c=o-s.time;if(a?i("message",{fun:"get",key:e,msg:"execute first"}):s.timeExpired>0&&c>s.timeExpired&&(i("message",{fun:"get",key:e,msg:"execute by timeExpired",timeDiff:c}),a=!0),a){i("message",{fun:"get",key:e,msg:"fun start"}),s.needExec=!1;let t=s.gen,n=async()=>{try{let n;try{n=await s.fun(...s.inputs)}catch(r){if(i("error",{fun:"get",key:e,msg:r}),!s.useCacheWhenError)throw s.gen===t&&(s.needExec=!0),r;n=void 0}s.gen===t&&(s.value=n,s.time="end"===s.timeFrom?Date.now():o)}finally{s.pm=null,i("message",{fun:"get",key:e,msg:"fun end"})}};s.pm=n(),await s.pm}else i("message",{fun:"get",key:e,msg:"use cache"});return r?vo(s.value):s.value}return i("error",{fun:"get",key:e,msg:"invalid key"}),null}return e.set=n,e.getProxy=async function(e,t={}){return n(e,t),s(e,t)},e.get=s,e.update=function(e,n){ps(t,e)&&(i("message",{fun:"updateValue",key:e}),t[e].value=n,t[e].time=Date.now(),t[e].gen+=1)},e.clear=function(e){ps(t,e)&&(i("message",{fun:"clear",key:e}),t[e].needExec=!0)},e.remove=function(e){ps(t,e)&&(i("message",{fun:"remove",key:e}),delete t[e])},e}function Yu(e={}){let t=Ae(e,"timeExpire",null);$i(t)||(t=18e5),t=qi(t),t=Math.min(t,On);let i=Ae(e,"timeDetect",null);$i(i)||(i=2e3),i=qi(i),i=Math.min(i,On);let n=Kn(),s={},r=e=>{if(ps(s,e)){return Hn(n,"checkWithSet",[{state:"error",msg:`checkWithSet: key in use: ${e}`}],{tag:"cacheSt"}),!1}return s[e]={time:Date.now(),value:!0},Hn(n,"checkWithSet",[{state:"success",msg:`checkWithSet: ${e}`}],{tag:"cacheSt"}),!0},o=setInterval(()=>{Hn(n,"detect",[{state:"start"}],{tag:"cacheSt"});let e=Date.now();for(let i of Object.keys(s)){let n=s[i];n&&e-n.time>t&&delete s[i]}Hn(n,"detect",[{state:"finish"}],{tag:"cacheSt"})},i);return n.checkWithSet=r,n.setWithFree=async(e,t)=>{Hn(n,"setWithFree",[{state:"start"}],{tag:"cacheSt"});let i=[];for(let t of e){if(!r(t)){for(let e of i)delete s[e];let e=`setWithFree: key in use: ${t}`;return Hn(n,"setWithFree",[{state:"error",msg:e}],{tag:"cacheSt"}),Promise.reject(e)}i.push(t)}try{let i=await t(),s=`setWithFree: ${e.join(", ")}`;return Hn(n,"setWithFree",[{state:"success",msg:s}],{tag:"cacheSt"}),i}catch(e){let t=`setWithFree: fn threw: ${e&&e.message||e}`;throw Hn(n,"setWithFree",[{state:"error",msg:t}],{tag:"cacheSt"}),e}finally{for(let e of i)delete s[e]}},n.set=async(e,t=!0)=>{s[e]={time:Date.now(),value:t},Hn(n,"set",[{state:"success",msg:`set: ${e}`}],{tag:"cacheSt"})},n.get=async e=>{let t=s[e],i=void 0===t?null:t.value;return Hn(n,"get",[{state:"success",msg:`get: ${e}`}],{tag:"cacheSt"}),i},n.check=async e=>{let t=ps(s,e);return Hn(n,"check",[{state:"success",msg:`check: ${e} = ${t}`}],{tag:"cacheSt"}),t},n.del=async e=>{delete s[e],Hn(n,"del",[{state:"success",msg:`del: ${e}`}],{tag:"cacheSt"})},n.waitExist=async(e,t={})=>{let i=Ae(t,"attemptNum",null);$i(i)||(i=30),i=qi(i);let r=Ae(t,"timeInterval",null);$i(r)||(r=100),r=qi(r),Hn(n,"waitExist",[{state:"start"}],{tag:"cacheSt"});try{await _n(()=>ps(s,e),{attemptNum:i,timeInterval:r})}catch(t){let s=`waitExist timeout (${i*r}ms): ${e}`;return Hn(n,"waitExist",[{state:"error",msg:s}],{tag:"cacheSt"}),Promise.reject(s)}Hn(n,"waitExist",[{state:"success",msg:`waitExist resolved: ${e}`}],{tag:"cacheSt"})},n.waitNotExist=async(e,t={})=>{let i=Ae(t,"attemptNum",null);$i(i)||(i=30),i=qi(i);let r=Ae(t,"timeInterval",null);$i(r)||(r=100),r=qi(r),Hn(n,"waitNotExist",[{state:"start"}],{tag:"cacheSt"});try{await _n(()=>!ps(s,e),{attemptNum:i,timeInterval:r})}catch(t){let s=`waitNotExist timeout (${i*r}ms): ${e}`;return Hn(n,"waitNotExist",[{state:"error",msg:s}],{tag:"cacheSt"}),Promise.reject(s)}Hn(n,"waitNotExist",[{state:"success",msg:`waitNotExist resolved: ${e}`}],{tag:"cacheSt"})},n.clear=()=>{clearInterval(o)},n}function Xu(e,t,i={}){let n=Ae(i,"mode","");if(Ni(n)||(n="scrypt"),"scrypt"!==n)throw new Error("暫時不支援scrypt以外方法");let s=I.randomBytes(16),r=`${e}:${t||""}`,o=I.scryptSync(r,s,64);return`scrypt:${s.toString("hex")}:${o.toString("hex")}`}function Fu(e,t,i){if(!Ni(t))return!1;let n=t.split(":");if(3!==n.length)return!1;let s,r,[o,a,c]=n;if("scrypt"!==o)return!1;if(!Ni(a)||!Ni(c))return!1;try{s=Buffer.from(a,"hex"),r=Buffer.from(c,"hex")}catch(e){return!1}if(16!==s.length||64!==r.length)return!1;let l=`${e}:${i||""}`,u=I.scryptSync(l,s,64);return u.length===r.length&&I.timingSafeEqual(u,r)}function Uu(e){return e[x.randomInt(e.length)]}function Gu(e){for(let t=e.length-1;t>0;t--){let i=x.randomInt(t+1),n=e[t];e[t]=e[i],e[i]=n}return e}let Pu=["readUsers","writeUsers","readTokens","writeTokens","readIps","writeIps","readStats"],Ku=["readUsers"];function Ou(e){return Ni(e)&&Pu.includes(e)}function _u(e){return null==e||""===e||!!en(e)&&e.every(Ou)}function Wu(e){return en(e)?Pu.filter(t=>e.includes(t)):[]}function Hu(e,t){return!!Ou(t)&&function(e){let t=Wu(Ae(e,"perms"));return Pu.filter(e=>Ku.includes(e)||t.includes(e))}(e).includes(t)}let Bu=["password","tokenVerify"];function Vu(e){return"string"!=typeof e&&(e=null==e?"":String(e)),e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Qu(e,t,{srLog:i,srEmail:n,salt:s,minExpired:r,kpLang:o,passwordPolicy:a,allowUserRegistration:c,siteUrl:l,verifyBaseUrl:u}){let p=new function(){let e=new Map,t=new Map;return async(i,n)=>{let s=(e.get(i)||Promise.resolve()).then(async()=>await n(),async()=>await n());e.set(i,s.catch(()=>{})),t.set(i,(t.get(i)||0)+1);try{return await s}finally{let n=t.get(i)-1;n<=0?(t.delete(i),e.delete(i)):t.set(i,n)}}},d=Yu(),m=function(e){return async(t,i,n,s={})=>{let r=Ae(s,"errKey","");Ni(r)||(r="saveInProgress");let o=`${t}:${i}`;return await e.setWithFree([o],n).catch(e=>e===`setWithFree: key in use: ${o}`?Promise.reject(r):Promise.reject(e))}}(d),h=new Map,f=new Map,g=(e,t)=>Ae(o,`${t}.${e}`,""),w=(e,t,i={})=>{"eng"!==t&&"cht"!==t&&(t="eng");let n=Ae(o,`${t}.${e}`,"");for(let e in i)n=n.replaceAll(`{${e}}`,Vu(i[e]));return n},M=async(t,n,s={})=>{let r=null,o=Ae(s,"deletePassword");Oi(o)||(o=!0);let a=await e.users.select({[t]:n,isActive:"y"}).catch(e=>{r=e});if(r)return console.log(r),console.log("keyUser",t),console.log("valueUser",Xc(t,n)),console.log("failed to find user"),Promise.reject("failed to find user");o&&(a=ks(a,e=>(delete e.password,e)));let c=wt(a);return 0===c?(i&&wn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userNotFound",keyUser:t,valueUser:n}),Promise.reject(`can not find the user by ${t}`)):c>=2?(i&&wn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userDuplicate",keyUser:t,valueUser:n}),Promise.reject(`duplicate ${t}`)):a[0]},y=async(e,t)=>await M(e,t),D=async(e,t={})=>await y("id",e),x=async t=>{let i=null;if(!an(r))return console.log("minExpired",r),console.log("invalid minExpired"),Promise.reject("invalid minExpired");let n=vc.tokens.funNew({userId:t});n.timeEnd=zn().add(r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");let s=Ae(n,"token","");return await e.tokens.insert(n).catch(e=>{i=e}),i?(console.log(i),console.log("can not create a token from userId"),Promise.reject("can not create a token from userId")):s},L=async(t,n={})=>{let s=await e.tokens.select({token:t}),r=wt(s);if(0===r)return console.log("invalid token"),Promise.reject("invalid token");if(r>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(s,0,""),a=Ae(o,"userId",""),c=await(async(e,t={})=>{let n=Ae(e,"timeEnd","");if(!Cc(n))return console.log("timeEnd",n),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let s=Ae(e,"isApp",""),r=Ae(t,"fun",null),o=Ae(t,"perm",""),a=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<n,c=!0;if("y"!==s){if(wn(r)){let t=Ae(e,"userId","");c=r(e,await D(t)),vn(c)&&(c=await c)}}else Ni(o)?c=Hu(e,o):wn(r)&&(c=!1),c||i.warn({event:"fun-checkToken",key:"appTokenPermDenied",token:zc(Ae(e,"token","")),userId:Ae(e,"userId",""),perm:o});return a&&c})(o,n);return i.info({event:"fun-checkToken",token:zc(t),userId:a,res:c}),c},v=async(e,t={})=>{if(!Ni(e))return Promise.reject("tokenExpired");let i=null;return await L(e,t).then(e=>{!1===e&&(i="tokenExpired")}).catch(e=>{console.log("checkToken inner reject",e),i="tokenExpired"}),null===i||Promise.reject(i)},I=(e,t,i={})=>{Ni(e)||(e="eng");let n=Ae(i,"account",""),s="";try{ju(t,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:a.minLength,numLenMax:a.maxLength,requireLetter:a.requireLetter,requireUppercase:a.requireUppercase,requireLowercase:a.requireLowercase,requireDigit:a.requireDigit,requireSpecial:a.requireSpecial,noSpace:a.noSpace,onlyAscii:a.onlyAscii,forbiddenChars:a.forbiddenChars,commonPasswordBlacklist:a.commonPasswordBlacklist,account:n,noConsecutiveCharsFromAccount:a.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:a.consecutiveCharsMinMatch})}catch(e){s=e.message}let r=null;return Ni(s)?(r={state:"error",key:`userPassword_${s}`},r):(r={state:"success",msg:"ok"},r)},b=async(n,r,o,a={})=>{let c=Ae(a,"resetOrder");Oi(c)||(c=!1);let l=Ae(a,"operatorId",""),u=Ae(a,"lang","eng");Ni(u)||(u="eng");let p=[];ms(r,e=>{!0===Ae(e,"_isNew")&&p.push(Ae(e,"id",""))}),r=function(e,t,i=""){return on(e)&&on(t)?ks(e,e=>wc(e,t,i)):[]}(r,vc[n].keys),c&&(r=ks(r,(e,t)=>(e.order=t+1,e)));let d=(e,t)=>{let i=null,n={};return ms(e,(e,s)=>{let r=Ae(e,t,"");return Ni(r)?ps(n,r)?(i=`rows[${s}].${t}[${r}] is duplicate`,!1):void(n[r]=!0):(i=`rows[${s}].${t} is not an effective string`,!1)}),i},m=null;if(function(e,t){function i(e){return en(e)?e:[e]}if(rn(e))return!1;if(0===(e=i(e)).length)return!1;if(rn(e))return!1;if(0===(t=i(t)).length)return!1;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)if(Zu(e[i],t[n]))return!0;return!1}(n,["users"])){if(m=d(r,"id"),null!==m)return Promise.reject(m);if(m=d(r,"email"),null!==m)return Promise.reject(m)}let h=await e[n].select();if(wt(p)>0){let e={};if(ms(h,t=>{e[Ae(t,"id","")]=!0}),p.some(t=>!0===e[t]))return Promise.reject("saveNewRowExists")}if("users"===n){let e={};ms(h,t=>{let i=Ae(t,"account","");Ni(i)&&(e[i]=Ae(t,"id",""))});let t={},i=null;if(ms(r,n=>{let s=Ae(n,"account",""),r=Ae(n,"id","");return Ni(s)?ps(t,s)||ps(e,s)&&e[s]!==r?(i="accountDuplicate",!1):void(t[s]=!0):(i="accountRequired",!1)}),null!==i)return Promise.reject(i)}if("users"===n){let e={};ms(h,t=>{e[t.id]=t}),ms(r,t=>{let i=e[t.id];i&&(t.password=i.password)})}let f=r,g=function(e,t,i,n={}){let s=Ae(n,"withInfor");Oi(s)||(s=!0);let r={del:[],add:[],same:[],diff:[]};if(!Ni(i))return console.log("invalid key"),s&&(r.infor={}),r;en(e)||(e=[e]),en(t)||(t=[t]),e=Qa(e,e=>ps(e,i)),t=Qa(t,e=>ps(e,i));let o=new Map(t.map(e=>[e[i],e]));for(let t of e){let e=o.get(t[i]);e?(JSON.stringify(t)===JSON.stringify(e)?r.same.push(e):r.diff.push(e),o.delete(t[i])):r.del.push(t)}if(r.add=Array.from(o.values()),s){let e={};for(let t of r.del)e[t[i]]="del";for(let t of r.add)e[t[i]]="add";for(let t of r.diff)e[t[i]]="diff";for(let t of r.same)e[t[i]]="same";r.infor=e}return r}(h,f,o);if(wt(g.del)>0&&(await t(l,n,"del",g.del),"users"===n))for(let t of g.del){let n=Ae(t,"id","");if(Ni(n))try{let t=await e.tokens.select({userId:n});for(let i of t)await e.tokens.del({id:i.id})}catch(m){i.error({event:"fun-updateTabItems-revokeTokenOnDelete",userId:n,err:ts(m)})}}if(wt(g.add)>0){if("users"===n){for(let e of g.add){let t=Ae(e,"password",""),i=Ae(e,"account",""),n=I(u,t,{account:i});if("error"===n.state)return Promise.reject(n.key);e.password=Xu(t,s)}ms(g.add,e=>{Ni(Ae(e,"timeVerified",""))||(e.timeVerified=Yo())})}await t(l,n,"insert",g.add)}if(wt(g.diff)>0){let e={};ms(h,t=>{e[Ae(t,o,"")]=t});let i=[];ms(g.diff,t=>{let n=Ae(t,o,""),s=null;ms(t,(t,i)=>{let r=Ae(e,[n,i]);en(t)&&en(r)&&t.length<r.length&&(null===s&&(s={[o]:n}),s[i]=null)}),null!==s&&i.push(s)}),wt(i)>0&&await t(l,n,"save",i),await t(l,n,"save",g.diff)}return"users"===n&&(f=ks(f,e=>{let t={...e};return delete t.password,t})),f},C=async t=>{let i=await e.tokens.select({token:t}),n=wt(i);if(0===n)return console.log("invalid token"),Promise.reject("invalid token");if(n>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let s=Ae(i,0,null),r=Ae(s,"isApp",""),o=null;if("y"!==r){let e=Ae(s,"userId","");o=await D(e)}else{let e=Ae(s,"userId","");if(!Ni(e))return console.log("invalid userId from token"),Promise.reject("invalid userId from token");o={id:e,account:"no account",name:"no name",email:"no email",description:"no description",from:"no from",redir:"no redir",isAdmin:"y",timeVerified:"2000-01-01T00:00:00.000+08:00",timeExpired:"",timeBlocked:"",isActive:"y"}}return{id:o.id,account:o.account,name:o.name,email:o.email,description:o.description,from:o.from,redir:o.redir,isApp:"y"===r?"y":"n",isAdmin:o.isAdmin,timeVerified:o.timeVerified,timeExpired:o.timeExpired,timeBlocked:o.timeBlocked,isActive:o.isActive,isForceChangePw:o.isForceChangePw}},E=async(e,t,i={})=>{let n=await y(e,t).catch(()=>null);return Ai(n)?{id:n.id,account:n.account,name:n.name,email:n.email,description:n.description,from:n.from,redir:n.redir,isAdmin:n.isAdmin,timeVerified:n.timeVerified,timeExpired:n.timeExpired,timeBlocked:n.timeBlocked,isActive:n.isActive}:null},T=async(t={})=>{let i=Ae(t,"needActive");Oi(i)||(i=!1);let n=Ae(t,"deletePassword");Oi(n)||(n=!0);let s={};i&&(s={isActive:"y"});let r=await e.users.select(s);return n&&(r=ks(r,e=>(delete e.password,e))),r},A=zu(),S=async(e,t={})=>(await v(e,t),await T(t)),N=async(e,t={})=>e=await b("users",e,"id",{resetOrder:!0,...t}),k=async()=>await e.tokens.select(),j=zu(),Z=async()=>await e.ips.select(),z=zu(),Y={getTokenByKV:async(t,i)=>{let n=null,s=await e.tokens.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("failed to find token"),Promise.reject("failed to find token");let r=wt(s);return 0===r?Promise.reject(`can not find the token by keyToken[${t}]`):r>=2?(console.log(`duplicate token by keyToken[${t}]`),Promise.reject(`duplicate token by keyToken[${t}]`)):s[0]},createUser:async(i,r)=>{if(Ni(i)||(i="eng"),!c)return Promise.reject("userRegistrationNotAllowed");let a=Ae(r,"account","");if(!Ni(a))return Promise.reject("userRegistrationAccountInvalid");let l=Ae(r,"email","");if(!Ni(l)||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l))return Promise.reject("userRegistrationEmailFormatInvalid");let p=Ae(r,"password",""),m=Ae(r,"confirmPassword","");if(p!==m)return Promise.reject("userChangePasswordNotSame");let h=I(i,p,{account:a});if("error"===h.state)return Promise.reject(h.key);let f=Ae(r,"name","");if(!Ni(f))return Promise.reject("userRegistrationNameInvalid");let M,y=`createUser:account:${a}`,D=`createUser:email:${l}`;await d.setWithFree([y,D],async()=>{let i=await e.users.select(),n=i.some(e=>Ae(e,"account","")===a);if(n)return Promise.reject("userRegistrationAccountExists");let r=i.some(e=>Ae(e,"email","")===l);if(r)return Promise.reject("userRegistrationEmailExists");let o=Xu(p,s);M=`${gc()}`;let c=vc.users.funNew({account:a,password:o,name:f,email:l,tokenVerify:M,isAdmin:"n",isActive:"y"});await t(c.id,"users","insert",[c])}).catch(e=>{let t=e&&"string"==typeof e?e:e&&e.message||String(e);return t.includes(y)?Promise.reject("userRegistrationAccountExists"):t.includes(D)?Promise.reject("userRegistrationEmailExists"):Promise.reject(e)});try{let e=Ae(o,`${i}.webName`,""),t=g("regVerifyEmTitle",i),s=w("regVerifyEmContent",i,{sender:e,name:f,verifyUrl:`${u}/api/verifyEmail?token=${M}&lang=${i}`});await n.send(e,t,s,l)}catch(e){console.log("send verify email error",e)}return{state:"success",msg:"ok"}},verifyEmail:async t=>{if(!Ni(t))return Promise.reject("verifyEmailInvalidToken");let i=await e.users.select({tokenVerify:t});if(0===wt(i))return Promise.reject("verifyEmailInvalidToken");let n=i[0];return Ni(Ae(n,"timeVerified",""))?Promise.reject("verifyEmailAlreadyVerified"):(await e.users.save({id:n.id,timeVerified:Yo()}),{state:"success",msg:"ok"})},resendVerifyEmail:async(t,i,s)=>(Ni(t)||(t="eng"),Ni(i)&&Ni(s)?await p(`resendVerifyEmail:${i}`,async()=>{let r=Date.now(),a=h.get(i);if(a&&r-a<3e4)return Promise.reject("userRegistrationResendThrottled");let c=null;try{c=await M("account",i)}catch(e){}if(!c)return Promise.reject("userRegistrationResendInvalidEmail");if(Ae(c,"email","")!==s)return Promise.reject("userRegistrationResendInvalidEmail");if(Ni(Ae(c,"timeVerified","")))return Promise.reject("userRegistrationAlreadyVerified");let l=Ae(c,"id",""),p=Ae(c,"name",""),d=`${gc()}`;await e.users.save({id:l,tokenVerify:d}),h.set(i,r);try{let e=Ae(o,`${t}.webName`,""),i=g("regVerifyEmTitle",t),r=w("regVerifyEmContent",t,{sender:e,name:p,verifyUrl:`${u}/api/verifyEmail?token=${d}&lang=${t}`});await n.send(e,i,r,s)}catch(e){return console.log("resend verify email error",e),Promise.reject("userRegistrationResendFailed")}return{state:"success",msg:"ok"}}):Promise.reject("userRegistrationResendInvalidEmail")),checkUserPassword:I,checkTokenAndChangePassword:async(t,r,a,c)=>{if(await v(t),Ni(r)||(r="eng"),!Ni(a))return Promise.reject("userChangePasswordFail");let l=Ae(await C(t),"id","");return await p(`changeUserPassword:${l}`,async()=>{let u=await M("id",l,{deletePassword:!1}),p=Ae(u,"account",""),d=I(r,c,{account:p});if("error"===d.state)return Promise.reject(d.key);let m=Ae(u,"password","");if(!Fu(a,m,s))return Promise.reject("userChangePasswordIncorrectOld");let h=Ae(u,"email","");if(!Ni(h))return Promise.reject("anUnexpectedErrorOccurred");let f=Xu(c,s);await e.users.save({id:l,password:f,isForceChangePw:"n"});try{let e=Ae(o,`${r}.webName`,"");if(!Ni(e))throw console.log("get(kpLang, lang)",Ae(o,r)),console.log("lang",r),new Error("invalid sender");let t=Ae(u,"name","unknow"),i=g("chpwEmTitle",r);if(!Ni(i))throw console.log("chpwEmTitle 取不到, lang",r),new Error("invalid title");let s=w("chpwEmContent",r,{sender:e,name:t});await n.send(e,i,s,h)}catch(e){console.log(e),i.error({event:"fun-changePassword-sendEmail",token:zc(t),lang:r,err:ts(e)})}})},adminResetUserPassword:async(t,r,c)=>{if(await v(t,{perm:"writeUsers"}),Ni(r)||(r="eng"),!Ni(c))return Promise.reject("anUnexpectedErrorOccurred");let l=await C(t),u=Ae(l,"id","");return"y"!==Ae(l,"isAdmin","")?Promise.reject("adminResetPasswordForbidden"):u===c?Promise.reject("adminResetPasswordCannotResetSelf"):await p(`adminResetUserPassword:${c}`,async()=>{let l=Date.now(),u=f.get(c);if(u&&l-u<3e4)return Promise.reject("adminResetPasswordAlreadyTriggered");let p=null;try{p=await M("id",c,{deletePassword:!0})}catch(e){return Promise.reject("adminResetPasswordUserNotFound")}if(!Ai(p))return Promise.reject("adminResetPasswordUserNotFound");let d=Ae(p,"account",""),m=Ae(p,"name","unknow"),h=Ae(p,"email",""),y=function(e,t=""){let i=e.minLength||8,n=e.maxLength||16,s=Math.min(Math.max(i,12),n),r="abcdefghijklmnopqrstuvwxyz".split(""),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),a="0123456789".split(""),c="!@#$%^&*()_+-=[]{}|;:,.<>?".split(""),l=e.forbiddenChars||[];c=c.filter(e=>!l.includes(e));let u=[];(e.requireLowercase||e.requireLetter)&&(u=u.concat(r)),e.requireUppercase&&(u=u.concat(o)),!e.requireLetter||e.requireUppercase||e.requireLowercase||(u=u.concat(o)),e.requireDigit&&(u=u.concat(a)),e.requireSpecial&&(u=u.concat(c)),0===u.length&&(u=r.concat(o).concat(a));for(let i=0;i<20;i++){let i=[];for(e.requireLetter&&i.push(Uu(r.concat(o))),e.requireUppercase&&i.push(Uu(o)),e.requireLowercase&&i.push(Uu(r)),e.requireDigit&&i.push(Uu(a)),e.requireSpecial&&i.push(Uu(c));i.length<s;)i.push(Uu(u));Gu(i);let n=i.join("");try{return ju(n,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:e.minLength,numLenMax:e.maxLength,requireLetter:e.requireLetter,requireUppercase:e.requireUppercase,requireLowercase:e.requireLowercase,requireDigit:e.requireDigit,requireSpecial:e.requireSpecial,noSpace:e.noSpace,onlyAscii:e.onlyAscii,forbiddenChars:e.forbiddenChars,commonPasswordBlacklist:e.commonPasswordBlacklist,account:t,noConsecutiveCharsFromAccount:e.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:e.consecutiveCharsMinMatch}),n}catch(e){}}throw new Error("cannot generate random password matching policy")}(a,d),D=Xu(y,s);await e.users.save({id:c,password:D,isForceChangePw:"y"}),f.set(c,l);try{if(Ni(h)){let e=Ae(o,`${r}.webName`,"");if(!Ni(e))throw new Error("invalid sender");let t=g("resetPwEmTitle",r);if(!Ni(t))throw new Error("invalid title");let i=w("resetPwEmContent",r,{sender:e,name:m,account:d,newPassword:y});await n.send(e,t,i,h)}else i.error({event:"fun-adminResetUserPassword-noEmail",token:zc(t),targetUserId:c})}catch(e){console.log(e),i.error({event:"fun-adminResetUserPassword-sendEmail",token:zc(t),targetUserId:c,err:ts(e)})}return{state:"success"}})},getIpByKV:async(t,i)=>{let n=null,s=await e.ips.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("keyIp",t),console.log("valueIp",i),console.log("failed to find ip"),Promise.reject("failed to find ip");let r=wt(s);return 0===r?Promise.reject(`can not find the ip by keyIp[${t}]`):r>=2?(console.log("keyIp",t),console.log("valueIp",i),console.log(`duplicate ip by keyIp[${t}]`),Promise.reject(`duplicate ip by keyIp[${t}]`)):s[0]},getGenUserByKV:y,getGenUserByUserId:D,getGenUserByAccount:async(e,t={})=>await y("account",e),loginByAccountAndPassword:async(t,i)=>{if(!Ni(t)||!Ni(i))return Promise.reject("failedLoginForCatch");let n=await e.users.select({account:t});if(0===wt(n))return Promise.reject("failedLoginForCatch");let r=n[0];if(!Fu(i,Ae(r,"password",""),s))return Promise.reject("failedLoginForCatch");if(!Ni(Ae(r,"timeVerified","")))return Promise.reject("userRegistrationNotVerified");let o=Ae(r,"timeExpired","");if(Ni(o)&&Cc(o)){if(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>o)return Promise.reject("loginAccountExpired")}let a=Ae(r,"id",""),c=await x(a);return{id:r.id,account:r.account,name:r.name,email:r.email,description:r.description,from:r.from,redir:r.redir,isAdmin:r.isAdmin,isActive:r.isActive,isForceChangePw:r.isForceChangePw,token:c}},logoutByToken:async t=>{if(!Ni(t))return Promise.reject("tokenExpired");let n=null,s=await e.tokens.select({token:t}),r=wt(s);if(0===r)return console.log("invalid token"),Promise.reject("invalid token");if(r>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(s,0,""),a=Ae(o,"userId",""),c=await e.tokens.del({id:o.id}).catch(e=>{n=e});return n?(console.log(n),console.log("failed to delete token"),Promise.reject("failed to delete token")):(c=Ae(c,"0.nDeleted",0),1!==c?(console.log("can not delete the token"),Promise.reject("can not delete the token")):(i.info({event:"fun-logout",token:zc(t),userId:a}),!0))},checkToken:v,refreshToken:async t=>{if(!Ni(t))return Promise.reject("tokenExpired");let i=null,n=await e.tokens.select({token:t}),s=wt(n);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(n,0,""),a=Ae(o,"timeEnd","");if(!Cc(a))return console.log("timeEnd",a),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let c=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ");if(c>=a)return console.log("tn",c),console.log("timeEnd",a),console.log("token expired"),Promise.reject("tokenExpired");let l=zn().add(r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),u=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ");return await e.tokens.save({id:o.id,timeEnd:l,timeUpdate:u}).catch(e=>{i=e}),i?(console.log(i),console.log("can not update timeEnd for token"),Promise.reject("can not update timeEnd for token")):l},getUserByToken:C,checkTokenAndGetUserByToken:async(e,t,i={})=>(await v(e,i),await C(t).catch(()=>null)),getUserInfor:E,checkTokenAndGetUserInfor:async(e,t,i,n={})=>(await v(e,n),await E(t,i)),getUsersList:T,getUsersListCache:async()=>await A.getProxy("fun",{fun:T,inputs:null,timeExpired:3e4}),checkTokenAndGetUsersList:S,checkTokenAndGetActiveUsersList:async(e,t={})=>await S(e,{...t,needActive:!0}),omitUserCredential:e=>{let t={...e};for(let e of Bu)delete t[e];return t},updateUsersList:N,checkTokenAndUpdateUsersList:async(t,n,s,r={})=>{await v(t,r),Ni(n)||(n="eng");let o=await C(t),a=Ae(o,"id","");if(!("y"===Ae(o,"isApp",""))){let e=null;if(ms(s,t=>{if(Ae(t,"id","")===a)return e=t,!1}),Ni(a)&&!Ai(e))return Promise.reject("cannotDeleteSelf");if(Ai(e)){if("y"!==Ae(e,"isAdmin",""))return Promise.reject("cannotDemoteSelf");if("y"!==Ae(e,"isActive",""))return Promise.reject("cannotDisableSelf")}}return await m("updateUsersList",a,async()=>{s=await N(s,{lang:n,operatorId:a});for(let t of s){if("n"!==Ae(t,"isActive",""))continue;let n=Ae(t,"id","");if(Ni(n))try{let t=await e.tokens.select({userId:n});for(let i of t)await e.tokens.del({id:i.id})}catch(e){i.error({event:"fun-updateUsersList-revokeToken",userId:n,err:ts(e)})}}return A.clear("fun"),s})},getTokensList:k,getTokensListCache:async()=>await j.getProxy("fun",{fun:k,inputs:null,timeExpired:3e4}),checkTokenAndGetTokensList:async(e,t={})=>(await v(e,t),await k()),checkTokenAndUpdateTokensList:async(t,i,n={})=>{await v(t,n);let s=Ae(await C(t),"id","");return await m("updateTokensList",s,async()=>(i=await(async t=>{let i={};ms(await e.tokens.select(),e=>{i[e.id]=JSON.stringify(Ae(e,"perms"))});for(let e of t){let t=Ae(e,"perms"),n=Ae(e,"id","");if(!(ps(i,n)&&i[n]===JSON.stringify(t)||_u(t)))return Promise.reject("tokenPermsInvalid")}return t=ks(t,e=>({...e,perms:Wu(Ae(e,"perms"))})),await b("tokens",t,"id",{resetOrder:!1})})(i),j.clear("fun"),i))},getIpsList:Z,getIpsListCache:async()=>await z.getProxy("fun",{fun:Z,inputs:null,timeExpired:3e4}),checkTokenAndGetIpsList:async(e,t={})=>(await v(e,t),await Z()),checkTokenAndUpdateIpsList:async(e,t,i={})=>{await v(e,i);let n=Ae(await C(e),"id","");return await m("updateIpsList",n,async()=>(t=await(async e=>await b("ips",e,"id",{resetOrder:!1}))(t),z.clear("fun"),t))}};return Y}let Ru={csIng:{eng:"Connecting...",cht:"連線中..."},csLogin:{eng:"Logged in",cht:"已登入"},csLogout:{eng:"Logged out",cht:"已登出"},csErrConn:{eng:"Unable to connect",cht:"無法連線"},csErrLogin:{eng:"Login denied",cht:"拒絕登入"},aggridLanguage:{eng:"en",cht:"zh-tw"},id:{eng:"ID",cht:"主鍵"},systemMessage:{eng:"System message",cht:"系統確認訊息"},ok:{eng:"OK",cht:"確認"},no:{eng:"No",cht:"取消"},yes:{eng:"Yes",cht:"確定"},y:{eng:"Yes",cht:"是"},n:{eng:"No",cht:"否"},empty:{eng:"Empty",cht:"無"},to:{eng:"To",cht:"至"},at:{eng:"At",cht:"於"},unknow:{eng:"Unknown",cht:"未知"},waitingData:{eng:"Waiting data...",cht:"等待數據中..."},saveChanges:{eng:"Save changes",cht:"儲存變更"},from:{eng:"From",cht:"來源"},save:{eng:"Save",cht:"儲存"},close:{eng:"Close",cht:"關閉"},send:{eng:"Send",cht:"送出"},cancel:{eng:"Cancel",cht:"取消"},processing:{eng:"Processing...",cht:"處理中請稍後..."},anUnexpectedErrorOccurred:{eng:"An unexpected error occurred, please contact the administrator",cht:"發生非預期錯誤,請洽管理員"},getDataError:{eng:"Failed to get data, please try again later",cht:"取得數據失敗,請稍後再試"},timeCreate:{eng:"Created time",cht:"創建時間"},userIdUpdate:{eng:"ID of the updated user",cht:"最新變更使用者主鍵"},timeUpdate:{eng:"Updated time",cht:"最新變更時間"},userId:{eng:"ID of the user",cht:"使用者主鍵"},account:{eng:"Account",cht:"帳號"},password:{eng:"Password",cht:"密碼"},toggleToShowPassword:{eng:"To show password",cht:"變更為顯示密碼模式"},toggleToHidePassword:{eng:"To hide password",cht:"變更為隱藏密碼模式"},username:{eng:"Username",cht:"使用者姓名"},email:{eng:"Email",cht:"電子郵件"},name:{eng:"Name",cht:"名稱"},description:{eng:"Description",cht:"說明"},redir:{eng:"Redirect",cht:"登入後轉至網址"},login:{eng:"Log in",cht:"登入"},logout:{eng:"Log out",cht:"登出"},menuTreeShow:{eng:"Show menu",cht:"顯示選單"},menuTreeHide:{eng:"Hide menu",cht:"隱藏選單"},menuUser:{eng:"User menu",cht:"使用者選單"},language:{eng:"Language",cht:"語系"},mmStaInfor:{eng:"Statistics information",cht:"統計資訊"},mmUserInfor:{eng:"User information",cht:"使用者資訊"},mmUsersList:{eng:"Users list",cht:"使用者清單"},mmUsersListMsg:{eng:"Provide a list of users, which can be added, edited, deleted, etc.",cht:"提供目前使用者資料清單,可進行新增、編輯、刪除等作業。"},mmTokensList:{eng:"Tokens list",cht:"金鑰清單"},mmTokensListMsg:{eng:"Provide a list of tokens, which can be deleted, etc.",cht:"提供目前金鑰資料清單,可進行強制登出等作業。"},mmIpsList:{eng:"Ips list",cht:"IP清單"},mmIpsListMsg:{eng:"Provide a list of IPs, which can be blocked, etc.",cht:"提供目前存取IP清單,可進行封鎖等作業。"},failedLoginForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLoginForNoToken:{eng:"Can not get the token",cht:"無有效金鑰"},failedLoginForNoRedir:{eng:"Can not get the url for redirection",cht:"無有效轉址"},failedLoginForCatch:{eng:"User account or password is incorrect",cht:"使用者帳密錯誤無法登入"},failedLogoutForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLogoutForCatch:{eng:"Can not logout",cht:"使用者登出失敗"},userStatus:{eng:"Status",cht:"帳號狀態"},isVerified:{eng:"Verified",cht:"帳號是否驗證"},isVerifiedY:{eng:"Verified",cht:"帳號已驗證"},isVerifiedN:{eng:"Not verified",cht:"帳號未驗證"},userTimeVerified:{eng:"Verified time",cht:"帳號驗證狀態與時間"},isVerifiedWaiting:{eng:"Waiting for verification",cht:"等待驗證中"},isExpired:{eng:"Expired",cht:"帳號是否過期"},isExpiredY:{eng:"Expired",cht:"帳號已過期"},isExpiredN:{eng:"Not expired",cht:"帳號未過期"},userTimeExpired:{eng:"Expired time",cht:"帳號過期狀態與時間"},isExpiredDeny:{eng:"Account login prohibited",cht:"禁止帳號登入"},isExpiredNever:{eng:"Never expires",cht:"永不過期"},isBlocked:{eng:"Blocked",cht:"帳號是否被封鎖"},isBlockedY:{eng:"Blocked",cht:"帳號已封鎖"},isBlockedN:{eng:"Not blocked",cht:"帳號未封鎖"},userTimeBlocked:{eng:"Blocked time",cht:"帳號封鎖狀態與時間"},isBlockedNormalStatus:{eng:"Normal status",cht:"狀態正常"},isAdmin:{eng:"Administrator",cht:"是否為系統管理者"},userRole:{eng:"Role",cht:"角色"},userRoleAdmin:{eng:"Administrator",cht:"系統管理者"},userRoleGeneral:{eng:"General",cht:"一般使用者"},isActive:{eng:"Active",cht:"帳號是否有效"},isActiveY:{eng:"Active",cht:"帳號有效"},isActiveMsgY:{eng:"Enabling",cht:"啟用中"},isActiveN:{eng:"Inactive",cht:"帳號無效"},isActiveMsgN:{eng:"Deactivated",cht:"已停用"},errInAccounts:{eng:"Account errors",cht:"帳號出現錯誤待修復"},errItemsByRedir:{eng:"Redirect errors",cht:"登入後轉址出現錯誤待修復"},modeEdit:{eng:"Edit mode",cht:"編輯模式"},showTabCols:{eng:"Show columns",cht:"顯示欄位"},selectDate:{eng:"Select date",cht:"請選擇日期"},dtPickerYear:{eng:"y",cht:"年"},dtPickerMonth:{eng:"m",cht:"月"},dtPickerWeekdays:{eng:"Su,Mo,Tu,We,Th,Fr,Sa",cht:"日,一,二,三,四,五,六"},userName:{eng:"Name of user",cht:"使用者名稱"},userAccountEmpty:{eng:"Invalid account of user",cht:"尚未給予有效使用者帳號"},userAccountDuplicate:{eng:"Duplicate account of user",cht:"使用者帳號出現重複"},userEmailEmpty:{eng:"Empty email of user",cht:"尚未給予使用者Email"},userEmailError:{eng:"Invalid email of user",cht:"使用者Email格式錯誤"},userEmailDuplicate:{eng:"Duplicate email of user",cht:"使用者Email出現重複"},userRedirEmpty:{eng:"Invalid redirect of user",cht:"尚未給予有效登入後轉址"},userPasswordEmpty:{eng:"Empty password of user",cht:"尚未給予使用者密碼"},userAddEmpty:{eng:"No user",cht:"尚未新增使用者資料"},userAdd:{eng:"Add user",cht:"新增使用者"},userAddNameNew:{eng:"New user",cht:"新使用者"},userAddIdNew:{eng:"Waiting generation",cht:"待自動給予"},userCopy:{eng:"Copy user",cht:"複製使用者"},userCopyNameNew:{eng:"copy",cht:"複製"},userDeleteCheckUsers:{eng:"Delete user(s)",cht:"刪除勾選使用者"},userResetPassword:{eng:"Reset password",cht:"重設密碼"},userSaveUsersFail:{eng:"Failed to save users",cht:"儲存使用者數據失敗"},userSaveUsersSuccess:{eng:"Save users successfully",cht:"儲存使用者數據成功"},userEditNoUserId:{eng:"Can not find the id of user",cht:"無法找到使用者Id"},userEditNoUserData:{eng:"Can not find the data of user",cht:"無法找到使用者數據"},userPassword_keyInvalidPassword:{eng:"Invalid password",cht:"密碼非有效字串"},userPassword_keyLimNumLenMinOrMax:{eng:"The minimum password length is greater than the maximum length",cht:"設定密碼最小長度大於最大長度"},userPassword_keyLimHasSpace:{eng:"Password must not contain whitespace characters",cht:"密碼不可包含空白字元"},userPassword_keyLimNonAsciiChar:{eng:"Password may only contain ASCII printable characters (letters, digits, symbols)",cht:"密碼僅允許使用英文大小寫、數字及特殊符號"},userPassword_keyLimNumLenMin:{eng:"Password length must be at least {minLength} characters",cht:"密碼長度須大於等於{minLength}個字元"},userPassword_keyLimNumLenMax:{eng:"Password length must not exceed {maxLength} characters",cht:"密碼長度須小於等於{maxLength}個字元"},userPassword_keyLimRequireLetter:{eng:"Password must contain at least one letter",cht:"密碼須包含至少一個英文字母"},userPassword_keyLimRequireUppercase:{eng:"Password must contain at least one uppercase letter",cht:"密碼須包含至少一個大寫英文字母"},userPassword_keyLimRequireLowercase:{eng:"Password must contain at least one lowercase letter",cht:"密碼須包含至少一個小寫英文字母"},userPassword_keyLimRequireDigit:{eng:"Password must contain at least one digit",cht:"密碼須包含至少一個數字"},userPassword_keyLimRequireSpecial:{eng:"Password must contain at least one special character",cht:"密碼須包含至少一個特殊符號"},userPassword_keyLimForbiddenChar:{eng:"Password must not contain forbidden characters",cht:"密碼不可包含禁止字元"},userPassword_keyLimCommonPassword:{eng:"This password is too common and not allowed",cht:"此密碼為常見弱密碼,不允許使用"},userPassword_keyLimConsecutiveCharsFromAccount:{eng:"Password must not contain {consecutiveCharsMinMatch} or more consecutive characters from your account name",cht:"密碼不可包含與帳號相同之{consecutiveCharsMinMatch}個以上連續字元"},userChangePassword:{eng:"Change Password",cht:"變更密碼"},userChangePasswordOldPassword:{eng:"Old password",cht:"舊密碼"},userChangePasswordNewPassword:{eng:"New password",cht:"新密碼"},userChangePasswordConfirmPassword:{eng:"Confirm password",cht:"確認新密碼"},userChangePasswordForNoOldPassword:{eng:"Please enter old password",cht:"尚未給予舊密碼"},userChangePasswordForNoNewPassword:{eng:"Please enter new password",cht:"尚未給予新密碼"},userChangePasswordForNoConfirmPassword:{eng:"Please enter confirm password",cht:"尚未給予確認密碼"},userChangePasswordNotSame:{eng:"New password and confirm password do not match",cht:"新密碼與確認密碼不一致"},userChangePasswordSuccess:{eng:"Password change successful, please log in again.",cht:"密碼變更成功,請使用新密碼重新登入。"},userChangePasswordFail:{eng:"Password change failed.",cht:"密碼變更失敗,請確認輸入密碼是否正確"},userChangePasswordIncorrectOld:{eng:"The old password is incorrect.",cht:"舊密碼不正確。"},userChangePasswordForNetError:{eng:"Password validation failed. Please try again later.",cht:"密碼檢測失敗,請稍後再試"},userRegistration:{eng:"Register",cht:"申請帳號"},userRegistrationName:{eng:"Name",cht:"姓名"},userRegistrationEmail:{eng:"Email",cht:"電子郵件"},userRegistrationConfirmPassword:{eng:"Confirm password",cht:"確認密碼"},userRegistrationSubmit:{eng:"Submit",cht:"送出申請"},userRegistrationSuccess:{eng:"Registration successful. Please check your email to verify your account.",cht:"帳號申請成功,請至信箱收取驗證信以啟用帳號。"},userRegistrationNotAllowed:{eng:"User registration is not available.",cht:"目前不開放使用者自行申請帳號。"},userRegistrationAccountInvalid:{eng:"Please enter a valid account.",cht:"請輸入有效的帳號。"},userRegistrationEmailFormatInvalid:{eng:"Please enter a valid email address.",cht:"請輸入有效的電子郵件格式。"},userRegistrationNameInvalid:{eng:"Please enter a valid name.",cht:"請輸入有效的姓名。"},userRegistrationAccountExists:{eng:"This account already exists.",cht:"此帳號已存在。"},userRegistrationEmailExists:{eng:"This email already exists.",cht:"此電子郵件已存在。"},userRegistrationBackToLogin:{eng:"Back to login",cht:"返回登入"},userRegistrationNotVerified:{eng:"Your account has not been verified. Please check your email and click the verification link.",cht:"您的帳號尚未完成 email 驗證,請至信箱點擊驗證連結。"},userRegistrationResendVerify:{eng:"Resend verification email",cht:"重寄驗證信"},userRegistrationResendSuccess:{eng:"Verification email has been resent. Please check your inbox.",cht:"驗證信已重新寄出,請至信箱收取。"},userRegistrationAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationResendSubmit:{eng:"Send verification email",cht:"寄送驗證信"},userRegistrationResendInvalidEmail:{eng:"The email address does not match the account. Please check and try again.",cht:"電子郵件與帳號不符,請確認後再試。"},userRegistrationResendFailed:{eng:"Failed to send verification email. Please try again later.",cht:"驗證信寄送失敗,請稍後再試。"},userRegistrationResendThrottled:{eng:"A verification email was just sent. Please wait a moment before trying again.",cht:"剛才已寄出驗證信,請稍候片刻再試。"},verifyEmailInvalidToken:{eng:"Invalid or expired verification link.",cht:"驗證連結無效或已失效。"},verifyEmailAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationVerifySuccess:{eng:"Email verified successfully. Please log in.",cht:"電子郵件驗證成功,請登入。"},loginAccountBlocked:{eng:"Your account has been temporarily locked due to multiple failed login attempts. Please try again later.",cht:"您的帳號因多次登入失敗已被暫時鎖定,請稍後再試。"},loginAccountExpired:{eng:"Your account has expired. Please contact the administrator.",cht:"您的帳號已過期,請聯繫管理員。"},loginUnknownError:{eng:"An unexpected error occurred during login. Please try again later.",cht:"登入時發生未預期的錯誤,請稍後再試。"},tokenExpired:{eng:"Your session has expired. Please log in again.",cht:"登入逾時,請重新登入。"},tokenNoPermission:{eng:"Token does not have permission.",cht:"權杖無存取權限。"},invalidUrl:{eng:"Invalid url.",cht:"網址無效。"},invalidTokenSelf:{eng:"Invalid self token.",cht:"自身權杖無效。"},invalidTokenTar:{eng:"Invalid target token.",cht:"目標權杖無效。"},invalidUserIdTar:{eng:"Invalid target user id.",cht:"目標使用者 Id 無效。"},noTokenKeyValueInUrl:{eng:"Missing token={sysToken}, key=token or value={token} in url.",cht:"網址缺少 token={sysToken}、key=token 或 value={token}。"},noTokenKeyUserIdInUrl:{eng:"Missing token={sysToken}, key=id or value={userId} in url.",cht:"網址缺少 token={sysToken}、key=id 或 value={userId}。"},noTokenInUrl:{eng:"Missing token={sysToken} in url.",cht:"網址缺少 token={sysToken}。"},cannotGetUserByUrl:{eng:"Cannot get user by url.",cht:"無法由網址取得使用者。"},cannotGetUsersByUrl:{eng:"Cannot get users by url.",cht:"無法由網址取得使用者清單。"},cannotGetUserDataByUrl:{eng:"Cannot get user data by url.",cht:"無法由網址取得使用者資料。"},cannotGetUsersDataByUrl:{eng:"Cannot get users data by url.",cht:"無法由網址取得使用者清單資料。"},noUserDataByUrl:{eng:"No user data by url.",cht:"該網址無使用者資料。"},noUsersDataByUrl:{eng:"No users data by url.",cht:"該網址無使用者清單資料。"},noUserDataAfterConvert:{eng:"No user data after conversion.",cht:"轉換後無使用者資料。"},invalidRows:{eng:"Invalid data format.",cht:"資料格式錯誤。"},accountRequired:{eng:"Account is required.",cht:"帳號為必填。"},accountDuplicate:{eng:"Account already exists.",cht:"帳號已存在。"},getStaDataFailed:{eng:"Failed to retrieve statistics data.",cht:"統計資料取得失敗。"},token:{eng:"Token",cht:"金鑰"},isApp:{eng:"For app",cht:"是否為應用系統金鑰"},tokenTimeCreate:{eng:"Created time",cht:"金鑰創建時間"},tokenTimeEnd:{eng:"End time",cht:"金鑰到期時間"},tokenTimeUpdate:{eng:"Updated time",cht:"金鑰更新時間"},tokenDeleteCheckTokens:{eng:"Delete checked token(s)",cht:"刪除勾選金鑰"},tokenSaveTokensFail:{eng:"Failed to save tokens",cht:"儲存金鑰數據失敗"},tokenSaveTokensSuccess:{eng:"Save tokens successfully",cht:"儲存金鑰數據成功"},tokenPerms:{eng:"App permissions",cht:"應用系統權限"},tokenPermsBase:{eng:"Basic permission, always granted",cht:"基本權限,恆具備"},tokenPermsHigh:{eng:"Equivalent to administrator",cht:"等同管理者權限"},tokenPermsInvalid:{eng:"Invalid app token permissions.",cht:"應用系統金鑰權限設定無效。"},appPerm_readUsers:{eng:"Read users",cht:"讀使用者"},appPerm_writeUsers:{eng:"Write users",cht:"寫使用者"},appPerm_readTokens:{eng:"Read tokens",cht:"讀金鑰"},appPerm_writeTokens:{eng:"Write tokens",cht:"寫金鑰"},appPerm_readIps:{eng:"Read IPs",cht:"讀IP"},appPerm_writeIps:{eng:"Write IPs",cht:"寫IP"},appPerm_readStats:{eng:"Read statistics",cht:"讀統計"},ip:{eng:"IP",cht:"IP"},ipTimeBlocked:{eng:"Blocked time",cht:"IP封鎖時間"},ipDeleteCheckIps:{eng:"Delete checked IP(s)",cht:"刪除勾選IP"},ipSaveIpsFail:{eng:"Failed to save IPs",cht:"儲存IP數據失敗"},ipSaveIpsSuccess:{eng:"Save IPs successfully",cht:"儲存IP數據成功"},statisticsInformation:{eng:"Statistics Information",cht:"統計資訊"},statisticsInformationDescription:{eng:"Provides an overview of system usage and security metrics.",cht:"提供系統使用情況和安全指標的總覽。"},userGroupInfor:{eng:"User Information",cht:"使用者資訊區"},totalUsers:{eng:"Total Users",cht:"總使用者"},activeUsers:{eng:"Active Users",cht:"活躍使用者"},blockedUsers:{eng:"Blocked Users",cht:"已封鎖使用者"},expiredUsers:{eng:"Expired Users",cht:"已過期使用者"},accessActivityMonitoring:{eng:"Access Activity Monitoring",cht:"存取活動監測"},userLoginFrequency:{eng:"User Login Frequency",cht:"使用者登入頻率"},last7Days:{eng:"Last 7 days",cht:"最近7天"},tokenUsageFrequency:{eng:"Token Usage Frequency",cht:"金鑰使用頻率"},ipConnectionFrequency:{eng:"IP Connection Frequency",cht:"IP 連線頻率"},controlStatus:{eng:"Control Status",cht:"管控狀態"},tokenCharacteristic:{eng:"Token Characteristic",cht:"金鑰狀態"},activeTokens:{eng:"Active Tokens",cht:"有效金鑰數量"},createdLast24h:{eng:"Created in last 24h",cht:"最近24小時內創建"},endingNext24h:{eng:"Ending in next 24h",cht:"未來24小時內到期"},endedTokens:{eng:"Ended Tokens",cht:"已到期金鑰數量"},ipCharacteristic:{eng:"IP Characteristic",cht:"IP狀態"},conn24h:{eng:"Connections in last 24h",cht:"最近24小時內連線數量"},blockedIps:{eng:"Blocked IPs",cht:"當前已封鎖IP數量"},selectItem1hr:{eng:"1 hour",cht:"1小時"},selectItem4hr:{eng:"4 hour",cht:"4小時"},selectItem8hr:{eng:"8 hour",cht:"8小時"},selectItem1day:{eng:"1 day",cht:"1日"},countAttempt:{eng:"Attempt",cht:"嘗試登入"},countSuccess:{eng:"Success",cht:"登入成功"},countError:{eng:"Error",cht:"登入失敗"},count:{eng:"Count",cht:"總次數"},showIndividually:{eng:"Show individually",cht:"個別顯示"},numberOrder:{eng:"No.",cht:"排序"},total:{eng:"Total",cht:"總計"},last1Day:{eng:"Last 1 day",cht:"最近1天"},last8Hour:{eng:"Last 8 hour",cht:"最近8小時"},last4Hour:{eng:"Last 4 hour",cht:"最近4小時"},last1Hour:{eng:"Last 1 hour",cht:"最近1小時"},showMax5:{eng:"Show max 5 rows",cht:"顯示前5筆"},showAll:{eng:"Show all",cht:"顯示全部"},regVerifyEmTitle:{eng:"Please verify your email",cht:"請驗證您的電子郵件"},regVerifyEmContent:{eng:'Dear {name},<br><br>Thank you for registering at {sender}.<br><br>Please click the link below to verify your email and activate your account:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>If you did not register, please ignore this email.<br><br>This is an automated notification. Please do not reply.',cht:'{name} 您好:<br><br>感謝您註冊「{sender}」。<br><br>請點擊以下連結以驗證您的電子郵件並啟用帳號:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>若您未曾進行此操作,請忽略此信。<br><br>此為系統自動通知信件,請勿直接回覆。'},chpwEmTitle:{eng:"Password has been changed",cht:"密碼已進行變更"},chpwEmContent:{eng:"Dear User {name},<br><br>This is to inform you that the password for your {sender} account has been successfully changed.<br><br>If you did not perform this action or have any concerns regarding your account security, please contact the system administrator as soon as possible to ensure the safety of your account.<br><br>This is an automated system notification. Please do not reply to this email.",cht:"使用者 {name} 您好:<br><br>您於「{sender}」的密碼已成功變更。<br><br>若您未曾進行此操作,或對帳號安全有任何疑慮,請您儘速聯絡系統管理單位,以確保帳號安全。<br><br>此為系統自動通知信件,請勿直接回覆。"},resetPwEmTitle:{eng:"Your password has been reset",cht:"您的密碼已被重設"},resetPwEmContent:{eng:"Dear {name},<br><br>The administrator has reset the password for your {sender} account.<br><br>Account: {account}<br>New password: <strong>{newPassword}</strong><br><br>Please log in with this password and immediately set your own new password upon login.<br><br>If you did not expect this change, please contact the administrator.<br><br>This is an automated notification.",cht:"使用者 {name} 您好:<br><br>管理員已重設您於「{sender}」的密碼。<br><br>帳號:{account}<br>新密碼:<strong>{newPassword}</strong><br><br>請以此密碼登入後,立即變更為您自己的新密碼。<br><br>若非您預期之操作,請聯繫管理員。<br><br>此為系統自動通知信件。"},adminResetPasswordConfirm:{eng:"Confirm to reset password for {account}?",cht:"確定對 {account} 重設密碼?"},adminResetPasswordSuccess:{eng:"Password reset and new password sent to {email}",cht:"已重設並寄送新密碼至 {email}"},adminResetPasswordCannotResetSelf:{eng:"Cannot reset your own password via this action",cht:"不可對自己重設密碼"},adminResetPasswordForbidden:{eng:"Forbidden: admin permission required",cht:"權限不足:須具管理員身分"},adminResetPasswordUserNotFound:{eng:"User not found",cht:"查無使用者"},adminResetPasswordFailed:{eng:"Failed to reset password",cht:"重設密碼失敗"},adminResetPasswordAlreadyTriggered:{eng:"A password reset was just triggered. Please wait a moment before trying again.",cht:"剛才已觸發重設密碼,請稍候片刻再試。"},userForceChangePwPrompt:{eng:"Your password has been reset by the administrator. Please change it to your own new password.",cht:"您的密碼已由管理員重設,請按確認後變更為您自己的新密碼。"},cannotDemoteSelf:{eng:"Cannot demote yourself from admin",cht:"不可解除自己的管理員權限"},cannotDisableSelf:{eng:"Cannot disable yourself",cht:"不可停用自己的帳號"},cannotDeleteSelf:{eng:"Admin cannot delete yourself",cht:"管理員不得刪除自己"},saveInProgress:{eng:"The previous save is still in progress. Please do not submit again.",cht:"上一次儲存仍在處理中,請勿重複送出"},saveNewRowExists:{eng:"The newly added data has already been saved. Please reload the page before making changes.",cht:"新增之資料已儲存過,請重新整理頁面後再操作"}},Ju=(e={})=>{let t=Ae(e,"kpLangExtEmail");Ai(t)||(t={});let i=Ae(e,"kpLangExt");Ai(i)||(i={});let n=Ae(e,"webName");Ai(n)||(n={});let s=Ae(e,"webDescription");Ai(s)||(s={});let r={};r={...r,...Ru},Ai(t)&&ms(t,(e,t)=>{r[t]={...Ae(r,t,{}),...e}}),Ai(i)&&(r={...r,...i}),Ai(n)&&(r={...r,webName:{...n}}),Ai(s)&&(r={...r,webDescription:{...s}});let o={};return ms(["eng","cht"],e=>{let t={};ms(r,(i,n)=>{t[n]=i[e]}),o[e]=t}),o};function qu(e,t,i={}){let{srLog:n,minForAccountLoginFailed:s,numForAccountLoginFailed:r,minBlockForAccountLoginFailed:o,minForTokenCallApi:a,numForTokenCallApi:c,minBlockForTokenCallApi:l,minForIpCallApi:u,numForIpCallApi:p,minBlockForIpCallApi:d}=i,m={},h=async e=>{if(!Ai(e))return Promise.reject("invalid u");let t=Ae(e,"timeBlocked","");if(Cc(t)){return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},f=async e=>{let i=await t.getGenUserByAccount(e);return await h(i)},g=!1;setInterval(async()=>{if(g)return;g=!0;let e=zn().add(-s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(m,async(t,i)=>{let n=t.filter(t=>t>=e);0===wt(n)?delete m[i]:m[i]=n}).finally(()=>{g=!1})},2e3);let w={},M=async e=>Ae(w,e,[]),y=!1;setInterval(async()=>{if(y)return;y=!0;let i=zn().add(-a,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(w,async(s,r)=>{let o=s.filter(e=>e>=i);w[r]=o,wt(o)>c&&await(async i=>{let s=await t.getTokenByKV("token",i);if("y"===Ae(s,"isApp",""))return void(n&&wn(n.debug)&&n.debug({event:"fun-blockAccountByToken",key:"appTokenSkipRateLimit",token:zc(i)}));let r=Ae(s,"userId","");if(!Ni(r))return Promise.reject("invalid userId");let o=await t.getGenUserByUserId(r);if(await h(o))return;let a=zn().add(l,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await e.users.save({id:o.id,timeBlocked:a}),await e.tokens.del({id:s.id})})(r).catch(e=>{console.log(e)})}).finally(()=>{y=!1})},2e3);let D={},x=async e=>{if(!Ai(e))return Promise.reject("invalid oip");let t=Ae(e,"timeBlocked","");if(Cc(t)){return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},L=async e=>Ae(D,e,[]),v=!1;setInterval(async()=>{if(v)return;v=!0;let i=Ot(D),n=await t.getIpsList(),s={};ms(n,e=>{let t=e.ip;s[t]=!0});let r={};ms(i,e=>{r[e]=!0});let o=[];ms(r,(e,t)=>{ps(s,t)||o.push(t)});let a=ks(o,e=>vc.ips.funNew({ip:e}));await e.ips.insert(a).catch(e=>{console.log(e)}).finally(()=>{v=!1})},2e3);let I=!1;setInterval(async()=>{if(I)return;I=!0;let i=zn().add(-u,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(D,async(n,s)=>{let r=n.filter(e=>e>=i);D[s]=r,wt(r)>p&&await(async i=>{let n=null,s=()=>zn().add(d,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),r=null;if(await t.getIpByKV("ip",i).then(e=>{r=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?r=null:n=t}),null!==n)return Promise.reject(n);if(null===r){let t=s();return r=vc.ips.funNew({ip:i,timeBlocked:t}),await e.ips.insert(r).catch(e=>{n=e}),null!==n?Promise.reject(n):void 0}if(await x(r))return;let o=s();await e.ips.save({id:r.id,timeBlocked:o})})(s).catch(e=>{console.log(e)})}).catch(e=>{console.log(e)}).finally(()=>{I=!1})},2e3);let b={loginByAccountAndPassword:async(i,n)=>{let a=!1;try{a=await f(i)}catch(e){return Promise.reject("failedLoginForCatch")}if(a)return Promise.reject("failedLoginForCatch");let c=null;return await t.loginByAccountAndPassword(i,n).then(e=>{c={state:"success",msg:e},m[i]=[]}).catch(async n=>{m[i]||(m[i]=[]),m[i].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"));let a=zn().add(-s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),l=m[i].filter(e=>e>=a);m[i]=l,wt(l)>r&&await(async i=>{let n=await t.getGenUserByAccount(i);if(await h(n))return;let s=zn().add(o,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await e.users.save({id:n.id,timeBlocked:s});let r=await e.tokens.select({userId:n.id});for(let t of r)await e.tokens.del({id:t.id})})(i).catch(e=>{console.log(e)}),c={state:"error",msg:n}}),"success"===c.state?c.msg:Promise.reject(c.msg)},cleanKpAccountLoginFailed:async()=>{m={}},cleanKpIpCallApi:async()=>{D={}},getBlockedByAccount:f,getBlockedByIp:async e=>{let i=null;if(!Ni(e))return Promise.reject("invalid ip");let n=null;return await t.getIpByKV("ip",e).then(e=>{n=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?n=null:i=t}),null!==i?Promise.reject(i):null!==n&&await x(n)},callApiByToken:async e=>{w[e]||(w[e]=[]),w[e].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByTokenCallApi:M,getCountsByTokenCallApi:async e=>wt(await M(e)),getIpByHeaders:e=>{let t=Ae(e,"headers"),i="";if(!Ni(i)){let e=Ae(t,"x-forwarded-for","");i=Ae(Rs(e,","),0,""),i=Qs(i)}return Ni(i)||e&&e.info&&e.info.remoteAddress&&(i=e.info.remoteAddress,i=Qs(i)),Ni(i)||e&&e.socket&&e.socket.remoteAddress&&(i=e.socket.remoteAddress,i=Qs(i)),Ni(i)||e&&e.connection&&e.connection.remoteAddress&&(i=e.connection.remoteAddress,i=Qs(i)),Ni(i)||(console.log("headers(keys)",Object.keys(t||{})),console.log("can not get ip of user")),i},callApiByIp:async e=>{D[e]||(D[e]=[]),D[e].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByIpCallApi:L,getCountsByIpCallApi:async e=>wt(await L(e))};return b}function $u(i,n=1){return function(e,t=1,i={}){let n=1,s=Ae(i,"path"),r=Ae(i,"fs");if(!Cn(e,{fs:r}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&$i(t)&&(t=qi(t))<1&&(t=1),function e(i){let o=[];return Cn(i,{fs:r})?(ms(r.readdirSync(i),function(a){let c=s.resolve(i,a),l=null;try{l=r.statSync(c)}catch(e){}l&&l.isDirectory()?(o.push({isFolder:!0,level:n,path:c,name:s.basename(c)}),n+=1,(n<=t||null===t)&&(o=o.concat(e(c))),n-=1):o.push({isFolder:!1,level:n,path:c,name:s.basename(c)})}),o):o}(e)}(i,n,{path:e,fs:t})}let ep=new Map,tp=new Map;function ip(e,i,n){let s=$u(e);s=s.filter(e=>!Ae(e,"isFolder",!1)),s=function(e,t,i){let n=t.format(i);return Qa(e,e=>{let t=Ae(e,"name","").replace(/\.log$/,"");return!/^\d{4}-\d{2}-\d{2}/.test(t)||t>=n.slice(0,t.length)})}(s,i,n);let r=[];for(let e of s)try{let i=t.statSync(e.path);if(!i.isFile())continue;r.push({path:e.path,name:e.name,size:i.size,mtimeMs:i.mtimeMs})}catch(e){}return r}function np(e){let t=new Map;return i=>{let n=Math.floor(i/6e4),s=t.get(n);return void 0===s&&(s=zn(6e4*n).format(e),t.set(n,s)),s}}async function sp(e,i,n,s=null){wn(s)||(s=np(n));let r={minTimeMs:null,token:{},ip:{},login:{}};return await function(e,i){return new Promise((n,s)=>{let r=null,o=t.createReadStream(e,{encoding:"utf8"}),a=b.createInterface({input:o,crlfDelay:1/0});a.on("line",i);let c=e=>{r=e,a.close()};o.on("error",c),a.on("error",c),o.on("close",()=>{r?s(r):n()})})}(e,e=>{let t=null;try{t=JSON.parse(e)}catch(e){return}if(null===t||"object"!=typeof t)return;let n=t.event,o=0;if("fun-checkToken"===n?o=1:"verifyConn"===n?o=2:"kpfun-loginByAccountAndPassword-before"===n?o=3:"kpfun-loginByAccountAndPassword-success"===n?o=4:"kpfun-loginByAccountAndPassword-error"===n&&(o=5),0===o)return;let a=function(e){return"number"==typeof e?e:Ni(e)?zn(e).valueOf():NaN}(t.time);if(Number.isNaN(a))return;if((null===r.minTimeMs||a<r.minTimeMs)&&(r.minTimeMs=a),!(a>i))return;let c=s(a);if(1===o){let e=r.token[c];void 0===e&&(e={count:0,kp:{}},r.token[c]=e),e.count+=1;let i=t.userId;e.kp[i]=(e.kp[i]||0)+1}else if(2===o){let e=r.ip[c];void 0===e&&(e={count:0,kp:{}},r.ip[c]=e),e.count+=1;let i=t.ip;e.kp[i]=(e.kp[i]||0)+1}else{let e=r.login[c];void 0===e&&(e={attempt:0,success:0,error:0},r.login[c]=e),3===o?e.attempt+=1:4===o?e.success+=1:e.error+=1}}),r}async function rp(e,t,i){let n=np(i),s=[];for(let r of e)try{let e=await sp(r.path,t,i,n);s.push({name:r.name,ok:!0,agg:e})}catch(e){s.push({name:r.name,ok:!1,err:String(Ae(e,"message",e))})}return s}function op(e,t){for(let i in t.token){let n=t.token[i],s=e.token[i];void 0===s&&(s={count:0,kp:{}},e.token[i]=s),s.count+=n.count;for(let e in n.kp)s.kp[e]=(s.kp[e]||0)+n.kp[e]}for(let i in t.ip){let n=t.ip[i],s=e.ip[i];void 0===s&&(s={count:0,kp:{}},e.ip[i]=s),s.count+=n.count;for(let e in n.kp)s.kp[e]=(s.kp[e]||0)+n.kp[e]}for(let i in t.login){let n=t.login[i],s=e.login[i];void 0===s&&(s={attempt:0,success:0,error:0},e.login[i]=s),s.attempt+=n.attempt,s.success+=n.success,s.error+=n.error}return e}async function ap(t,i={}){let n=!1!==Ae(i,"useCache"),s=Ae(i,"scanFiles");wn(s)||(s=rp);let r=Ae(i,"srLog",null),o=ip(t.fdLog,t.tStart,t.fmt),a=function(e){let t=ep.get(e);return t||(t=new Map,ep.set(e,t)),t}((c=t.fdLog,l=t.fmt,`${e.resolve(c)}|${l}`));var c,l;let u=[],p={};for(let e of o){let i=n?a.get(e.name):void 0;void 0!==i&&i.size===e.size&&i.mtimeMs===e.mtimeMs&&(null===i.minTimeMs||i.minTimeMs>i.scanTStartMs&&i.minTimeMs>t.tStartMs)?p[e.name]=i.agg:u.push(e)}if(n){let e=new Set(o.map(e=>e.name));for(let t of a.keys())e.has(t)||a.delete(t)}let d=[];if(u.length>0){let e=await s(u.map(e=>({path:e.path,name:e.name})),t.tStartMs,t.fmt),i={};for(let t of e)i[t.name]=t;for(let e of u){let s=i[e.name];if(s&&s.ok)p[e.name]=s.agg,n&&a.set(e.name,{size:e.size,mtimeMs:e.mtimeMs,minTimeMs:s.agg.minTimeMs,scanTStartMs:t.tStartMs,agg:s.agg});else{let t=Ae(s,"err","no result");d.push({name:e.name,err:t}),n&&a.delete(e.name),r&&wn(r.warn)&&r.warn({event:"fun-staLogs",key:"staLogsFileSkipped",name:e.name,err:t})}}}let m={token:{},ip:{},login:{}};for(let e of o){let t=p[e.name];t&&op(m,t)}let h=function(e,t){let i=(e,i,n)=>{let s={};for(let i of t)s[i]=e();for(let e in i)s[e]=n(i[e]);return Object.keys(s).sort().map(e=>({time:e,data:s[e]}))};return{token:i(()=>({count:0}),e.token,e=>({count:e.count,...e.kp})),ip:i(()=>({count:0}),e.ip,e=>({count:e.count,...e.kp})),login:i(()=>({attempt:0,success:0,error:0}),e.login,e=>({attempt:e.attempt,success:e.success,error:e.error}))}}(m,t.kpTime);return h.stat={nFiles:o.length,nScanned:u.length,nCached:o.length-u.length,errors:d},h}function cp(t=7,i="hr",n={}){let s=function(e=7,t="hr",i={}){let n=Ae(i,"fdLog");Ni(n)||(n="./logs");let s=function(e){return"day"===e?"day":"hr"}(t),r="day"===s?"YYYY-MM-DD":"YYYY-MM-DDTHH",o="day"===s?"day":"hour",a=Ae(i,"timeNow"),c="number"==typeof a?zn(a):zn(),l=c.subtract(e,"day"),u=l.valueOf(),p=l.startOf(o),d=c.startOf(o),m=[];for(;!p.isAfter(d);)m.push(p.format(r)),p=p.add(1,o);return{fdLog:n,timeInterval:s,fmt:r,unit:o,tStart:l,tStartMs:u,kpTime:m,timeNow:c.valueOf()}}(t,i,n),r=JSON.stringify([e.resolve(s.fdLog),t,s.timeInterval,Ae(n,"timeNow",null)]);if(tp.has(r))return tp.get(r);let o=ap(s,n).finally(()=>{tp.delete(r)});return tp.set(r,o),o}let lp=a.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(lp).href:"undefined"==typeof document?location.href:C&&"SCRIPT"===C.tagName.toUpperCase()&&C.src||new URL("w-web-sso.umd.js",document.baseURI).href),up=e.dirname(lp),pp=e.resolve(up,"staLogsCore.shellWorker.mjs");async function dp(e,t,i){return 0===e.length?[]:function(e,t=pp){let i=Ln(),n=new o.Worker(t),s=!1,r=(e,t)=>{s||(s=!0,e(t));try{n.terminate()}catch(e){}};return n.on("message",e=>{"done"===e.mode?r(i.resolve,e.payload):"error"===e.mode&&r(i.reject,e.payload)}),n.on("error",e=>{r(i.reject,e)}),n.on("exit",e=>{r(i.reject,new Error(`staLogs worker exited without result, code=${e}`))}),n.postMessage(e),i}({files:e,tStartMs:t,fmt:i})}function mp(e=7,t="hr",i={}){return cp(e,t,{...i,scanFiles:dp})}function hp(e,t,i={}){let{srLog:n,logFd:s}=i,r=async()=>{let e=await t.getUsersListCache(),i=wt(e),n=0;n=wt(Qa(e,e=>Ac(e)));let s=0;s=wt(Qa(e,e=>Tc(e)));let r=0;r=wt(Qa(e,e=>Ec(e)));return{total:i,active:n,blocked:s,expired:r}},o=async()=>{let e=zn().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),n=zn().add(24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),s=await t.getTokensListCache(),r=wt(s),o=0;{let t=Qa(s,t=>t.timeCreate>=e);o=wt(t)}let a=0;{let e=Qa(s,e=>e.timeEnd>=i&&e.timeEnd<=n);a=wt(e)}let c=0;{let e=Qa(s,e=>function(e){let t=Ae(e,"timeEnd","");return!!Cc(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>t}(e));c=wt(e)}return{active:r-c,created24h:o,ending24h:a,ended:c}},a=async()=>{let e=zn().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=await t.getIpsListCache(),n=0;{let t=Qa(await g(),t=>zn(t.time,"YYYY-MM-DDTHH").format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=e);r="data.count",n=(s=t)&&s.length?function(e,t){for(var i,n=-1,s=e.length;++n<s;){var r=t(e[n]);void 0!==r&&(i=void 0===i?r:i+r)}return i}(s,Ci(r)):0}var s,r;let o=0;o=wt(Qa(i,e=>Tc(e)));return{conn24h:n,blocked:o}},c=async()=>{let e=await async function(e=7,t="hr",i={}){return(await mp(e,t,i)).login}(7,"hr",{fdLog:s,srLog:n});return e},l=zu(),u=async()=>await l.getProxy("fun",{fun:c,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaUserAccountLogin",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),p=async()=>{let e=await async function(e=7,t="hr",i={}){return(await mp(e,t,i)).token}(7,"hr",{fdLog:s,srLog:n}),i={};ms(e,e=>{ms(e.data,(e,t)=>{if("count"===t)return!0;i[t]=0})});let r=await t.getUsersListCache(),o={count:0};return ms(r,e=>{o[e.id]=e.name}),e=ks(e,e=>{let t=vo(i);var n,s,r;return ms(e.data,(e,i)=>{t[i]=e}),n=t,r={},s=Ci(s=(e,t)=>"count"===t?t:Ae(o,t,t)),_t(n,function(e,t,i){Er(r,s(e,t,i),e)}),t=r,{time:e.time,data:{count:e.count,...t}}}),e},d=zu(),m=async()=>await d.getProxy("fun",{fun:p,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaToken",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),h=async()=>{let e=await async function(e=7,t="hr",i={}){return(await mp(e,t,i)).ip}(7,"hr",{fdLog:s,srLog:n}),t={};return ms(e,e=>{ms(e.data,(e,i)=>{if("count"===i)return!0;t[i]=0})}),e=ks(e,e=>{let i=vo(t);return ms(e.data,(e,t)=>{i[t]=e}),{time:e.time,data:{count:e.count,...i}}}),e},f=zu(),g=async()=>await f.getProxy("fun",{fun:h,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaIp",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),w={getStaUserSummary:r,checkTokenAndGetStaUserSummary:async(e,i={})=>(await t.checkToken(e,i),await r()),getStaTokenSummary:o,checkTokenAndGetStaTokenSummary:async(e,i={})=>(await t.checkToken(e,i),await o()),getStaIpSummary:a,checkTokenAndGetStaIpSummary:async(e,i={})=>(await t.checkToken(e,i),await a()),getStaUserAccountLogin:u,checkTokenAndGetStaUserAccountLogin:async(e,i={})=>(await t.checkToken(e,i),await u()),getStaToken:m,checkTokenAndGetStaToken:async(e,i={})=>(await t.checkToken(e,i),await m()),getStaIp:g,checkTokenAndGetStaIp:async(e,i={})=>(await t.checkToken(e,i),await g())};return w}var fp={exports:{}};!function(e){e.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),i=e(function(e){var t=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)});i.version;var n=function(e){return"object"==typeof e?null!==e:"function"==typeof e},s=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e},r=function(e){try{return!!e()}catch(e){return!0}},o=!r(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a=t.document,c=n(a)&&n(a.createElement),l=function(e){return c?a.createElement(e):{}},u=!o&&!r(function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!n(e))return e;var i,s;if(t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;if("function"==typeof(i=e.valueOf)&&!n(s=i.call(e)))return s;if(!t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;throw TypeError("Can't convert object to primitive value")},d=Object.defineProperty,m={f:o?Object.defineProperty:function(e,t,i){if(s(e),t=p(t,!0),s(i),u)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},h=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f=o?function(e,t,i){return m.f(e,t,h(1,i))}:function(e,t,i){return e[t]=i,e},g={}.hasOwnProperty,w=function(e,t){return g.call(e,t)},M=0,y=Math.random(),D=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++M+y).toString(36))},x=e(function(e){var n="__core-js_shared__",s=t[n]||(t[n]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),L=x("native-function-to-string",Function.toString),v=e(function(e){var n=D("src"),s="toString",r=(""+L).split(s);i.inspectSource=function(e){return L.call(e)},(e.exports=function(e,i,s,o){var a="function"==typeof s;a&&(w(s,"name")||f(s,"name",i)),e[i]!==s&&(a&&(w(s,n)||f(s,n,e[i]?""+e[i]:r.join(String(i)))),e===t?e[i]=s:o?e[i]?e[i]=s:f(e,i,s):(delete e[i],f(e,i,s)))})(Function.prototype,s,function(){return"function"==typeof this&&this[n]||L.call(this)})}),I=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},b=function(e,t,i){if(I(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,s){return e.call(t,i,n,s)}}return function(){return e.apply(t,arguments)}},C="prototype",E=function(e,n,s){var r,o,a,c,l=e&E.F,u=e&E.G,p=e&E.S,d=e&E.P,m=e&E.B,h=u?t:p?t[n]||(t[n]={}):(t[n]||{})[C],g=u?i:i[n]||(i[n]={}),w=g[C]||(g[C]={});for(r in u&&(s=n),s)a=((o=!l&&h&&void 0!==h[r])?h:s)[r],c=m&&o?b(a,t):d&&"function"==typeof a?b(Function.call,a):a,h&&v(h,r,a,e&E.U),g[r]!=a&&f(g,r,c),d&&w[r]!=a&&(w[r]=a)};t.core=i,E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128;var T,A=E,S=Math.ceil,N=Math.floor,k=function(e){return isNaN(e=+e)?0:(e>0?N:S)(e)},j=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Z=(T=!1,function(e,t){var i,n,s=String(j(e)),r=k(t),o=s.length;return r<0||r>=o?T?"":void 0:(i=s.charCodeAt(r))<55296||i>56319||r+1===o||(n=s.charCodeAt(r+1))<56320||n>57343?T?s.charAt(r):i:T?s.slice(r,r+2):n-56320+(i-55296<<10)+65536});A(A.P,"String",{codePointAt:function(e){return Z(this,e)}}),i.String.codePointAt;var z=Math.max,Y=Math.min,X=function(e,t){return(e=k(e))<0?z(e+t,0):Y(e,t)},F=String.fromCharCode,U=String.fromCodePoint;A(A.S+A.F*(!!U&&1!=U.length),"String",{fromCodePoint:function(e){for(var t,i=arguments,n=[],s=arguments.length,r=0;s>r;){if(t=+i[r++],X(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?F(t):F(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}}),i.String.fromCodePoint;var G,P,K,O,_,W,H,B,V,Q,R,J,q,$,ee={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\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DCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u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E9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDE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uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},te={isSpaceSeparator:function(e){return"string"==typeof e&&ee.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||ee.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||ee.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}},ie=function(e,t){G=String(e),P="start",K=[],O=0,_=1,W=0,H=void 0,B=void 0,V=void 0;do{H=se(),me[P]()}while("eof"!==H.type);return"function"==typeof t?ne({"":V},"",t):V};function ne(e,t,i){var n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(var s=0;s<n.length;s++){var r=String(s),o=ne(n,r,i);void 0===o?delete n[r]:Object.defineProperty(n,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var a in n){var c=ne(n,a,i);void 0===c?delete n[a]:Object.defineProperty(n,a,{value:c,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}function se(){for(Q="default",R="",J=!1,q=1;;){$=re();var e=ae[Q]();if(e)return e}}function re(){if(G[O])return String.fromCodePoint(G.codePointAt(O))}function oe(){var e=re();return"\n"===e?(_++,W=0):e?W+=e.length:W++,e&&(O+=e.length),e}var ae={default:function(){switch($){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void oe();case"/":return oe(),void(Q="comment");case void 0:return oe(),ce("eof")}if(!te.isSpaceSeparator($))return ae[P]();oe()},comment:function(){switch($){case"*":return oe(),void(Q="multiLineComment");case"/":return oe(),void(Q="singleLineComment")}throw ge(oe())},multiLineComment:function(){switch($){case"*":return oe(),void(Q="multiLineCommentAsterisk");case void 0:throw ge(oe())}oe()},multiLineCommentAsterisk:function(){switch($){case"*":return void oe();case"/":return oe(),void(Q="default");case void 0:throw ge(oe())}oe(),Q="multiLineComment"},singleLineComment:function(){switch($){case"\n":case"\r":case"\u2028":case"\u2029":return oe(),void(Q="default");case void 0:return oe(),ce("eof")}oe()},value:function(){switch($){case"{":case"[":return ce("punctuator",oe());case"n":return oe(),le("ull"),ce("null",null);case"t":return oe(),le("rue"),ce("boolean",!0);case"f":return oe(),le("alse"),ce("boolean",!1);case"-":case"+":return"-"===oe()&&(q=-1),void(Q="sign");case".":return R=oe(),void(Q="decimalPointLeading");case"0":return R=oe(),void(Q="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return R=oe(),void(Q="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",1/0);case"N":return oe(),le("aN"),ce("numeric",NaN);case'"':case"'":return J='"'===oe(),R="",void(Q="string")}throw ge(oe())},identifierNameStartEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":break;default:if(!te.isIdStartChar(e))throw Me()}R+=e,Q="identifierName"},identifierName:function(){switch($){case"$":case"_":case"":case"":return void(R+=oe());case"\\":return oe(),void(Q="identifierNameEscape")}if(!te.isIdContinueChar($))return ce("identifier",R);R+=oe()},identifierNameEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":case"":case"":break;default:if(!te.isIdContinueChar(e))throw Me()}R+=e,Q="identifierName"},sign:function(){switch($){case".":return R=oe(),void(Q="decimalPointLeading");case"0":return R=oe(),void(Q="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return R=oe(),void(Q="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",q*(1/0));case"N":return oe(),le("aN"),ce("numeric",NaN)}throw ge(oe())},zero:function(){switch($){case".":return R+=oe(),void(Q="decimalPoint");case"e":case"E":return R+=oe(),void(Q="decimalExponent");case"x":case"X":return R+=oe(),void(Q="hexadecimal")}return ce("numeric",0*q)},decimalInteger:function(){switch($){case".":return R+=oe(),void(Q="decimalPoint");case"e":case"E":return R+=oe(),void(Q="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},decimalPointLeading:function(){if(te.isDigit($))return R+=oe(),void(Q="decimalFraction");throw ge(oe())},decimalPoint:function(){switch($){case"e":case"E":return R+=oe(),void(Q="decimalExponent")}return te.isDigit($)?(R+=oe(),void(Q="decimalFraction")):ce("numeric",q*Number(R))},decimalFraction:function(){switch($){case"e":case"E":return R+=oe(),void(Q="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},decimalExponent:function(){switch($){case"+":case"-":return R+=oe(),void(Q="decimalExponentSign")}if(te.isDigit($))return R+=oe(),void(Q="decimalExponentInteger");throw ge(oe())},decimalExponentSign:function(){if(te.isDigit($))return R+=oe(),void(Q="decimalExponentInteger");throw ge(oe())},decimalExponentInteger:function(){if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},hexadecimal:function(){if(te.isHexDigit($))return R+=oe(),void(Q="hexadecimalInteger");throw ge(oe())},hexadecimalInteger:function(){if(!te.isHexDigit($))return ce("numeric",q*Number(R));R+=oe()},string:function(){switch($){case"\\":return oe(),void(R+=ue());case'"':return J?(oe(),ce("string",R)):void(R+=oe());case"'":return J?void(R+=oe()):(oe(),ce("string",R));case"\n":case"\r":throw ge(oe());case"\u2028":case"\u2029":ye($);break;case void 0:throw ge(oe())}R+=oe()},start:function(){switch($){case"{":case"[":return ce("punctuator",oe())}Q="value"},beforePropertyName:function(){switch($){case"$":case"_":return R=oe(),void(Q="identifierName");case"\\":return oe(),void(Q="identifierNameStartEscape");case"}":return ce("punctuator",oe());case'"':case"'":return J='"'===oe(),void(Q="string")}if(te.isIdStartChar($))return R+=oe(),void(Q="identifierName");throw ge(oe())},afterPropertyName:function(){if(":"===$)return ce("punctuator",oe());throw ge(oe())},beforePropertyValue:function(){Q="value"},afterPropertyValue:function(){switch($){case",":case"}":return ce("punctuator",oe())}throw ge(oe())},beforeArrayValue:function(){if("]"===$)return ce("punctuator",oe());Q="value"},afterArrayValue:function(){switch($){case",":case"]":return ce("punctuator",oe())}throw ge(oe())},end:function(){throw ge(oe())}};function ce(e,t){return{type:e,value:t,line:_,column:W}}function le(e){for(var t=0,i=e;t<i.length;t+=1){var n=i[t];if(re()!==n)throw ge(oe());oe()}}function ue(){switch(re()){case"b":return oe(),"\b";case"f":return oe(),"\f";case"n":return oe(),"\n";case"r":return oe(),"\r";case"t":return oe(),"\t";case"v":return oe(),"\v";case"0":if(oe(),te.isDigit(re()))throw ge(oe());return"\0";case"x":return oe(),pe();case"u":return oe(),de();case"\n":case"\u2028":case"\u2029":return oe(),"";case"\r":return oe(),"\n"===re()&&oe(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw ge(oe())}return oe()}function pe(){var e="",t=re();if(!te.isHexDigit(t))throw ge(oe());if(e+=oe(),t=re(),!te.isHexDigit(t))throw ge(oe());return e+=oe(),String.fromCodePoint(parseInt(e,16))}function de(){for(var e="",t=4;t-- >0;){var i=re();if(!te.isHexDigit(i))throw ge(oe());e+=oe()}return String.fromCodePoint(parseInt(e,16))}var me={start:function(){if("eof"===H.type)throw we();he()},beforePropertyName:function(){switch(H.type){case"identifier":case"string":return B=H.value,void(P="afterPropertyName");case"punctuator":return void fe();case"eof":throw we()}},afterPropertyName:function(){if("eof"===H.type)throw we();P="beforePropertyValue"},beforePropertyValue:function(){if("eof"===H.type)throw we();he()},beforeArrayValue:function(){if("eof"===H.type)throw we();"punctuator"!==H.type||"]"!==H.value?he():fe()},afterPropertyValue:function(){if("eof"===H.type)throw we();switch(H.value){case",":return void(P="beforePropertyName");case"}":fe()}},afterArrayValue:function(){if("eof"===H.type)throw we();switch(H.value){case",":return void(P="beforeArrayValue");case"]":fe()}},end:function(){}};function he(){var e;switch(H.type){case"punctuator":switch(H.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=H.value}if(void 0===V)V=e;else{var t=K[K.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,B,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)K.push(e),P=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var i=K[K.length-1];P=null==i?"end":Array.isArray(i)?"afterArrayValue":"afterPropertyValue"}}function fe(){K.pop();var e=K[K.length-1];P=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function ge(e){return xe(void 0===e?"JSON5: invalid end of input at "+_+":"+W:"JSON5: invalid character '"+De(e)+"' at "+_+":"+W)}function we(){return xe("JSON5: invalid end of input at "+_+":"+W)}function Me(){return xe("JSON5: invalid identifier character at "+_+":"+(W-=5))}function ye(e){console.warn("JSON5: '"+De(e)+"' in strings is not valid ECMAScript; consider escaping")}function De(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var i=e.charCodeAt(0).toString(16);return"\\x"+("00"+i).substring(i.length)}return e}function xe(e){var t=new SyntaxError(e);return t.lineNumber=_,t.columnNumber=W,t}var Le=function(e,t,i){var n,s,r,o=[],a="",c="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,r=t.quote,t=t.replacer),"function"==typeof t)s=t;else if(Array.isArray(t)){n=[];for(var l=0,u=t;l<u.length;l+=1){var p=u[l],d=void 0;"string"==typeof p?d=p:("number"==typeof p||p instanceof String||p instanceof Number)&&(d=String(p)),void 0!==d&&n.indexOf(d)<0&&n.push(d)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):"string"==typeof i&&(c=i.substr(0,10)),m("",{"":e});function m(e,t){var i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),s&&(i=s.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?h(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?w(i):f(i):void 0}function h(e){for(var t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},n="",s=0;s<e.length;s++){var o=e[s];switch(o){case"'":case'"':t[o]++,n+=o;continue;case"\0":if(te.isDigit(e[s+1])){n+="\\x00";continue}}if(i[o])n+=i[o];else if(o<" "){var a=o.charCodeAt(0).toString(16);n+="\\x"+("00"+a).substring(a.length)}else n+=o}var c=r||Object.keys(t).reduce(function(e,i){return t[e]<t[i]?e:i});return c+(n=n.replace(new RegExp(c,"g"),i[c]))+c}function f(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,s,r=[],l=0,u=n||Object.keys(e);l<u.length;l+=1){var p=u[l],d=m(p,e);if(void 0!==d){var h=g(p)+":";""!==c&&(h+=" "),h+=d,r.push(h)}}if(0===r.length)i="{}";else if(""===c)i="{"+(s=r.join(","))+"}";else{var f=",\n"+a;s=r.join(f),i="{\n"+a+s+",\n"+t+"}"}return o.pop(),a=t,i}function g(e){if(0===e.length)return h(e);var t=String.fromCodePoint(e.codePointAt(0));if(!te.isIdStartChar(t))return h(e);for(var i=t.length;i<e.length;i++)if(!te.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return h(e);return e}function w(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,n=[],s=0;s<e.length;s++){var r=m(String(s),e);n.push(void 0!==r?r:"null")}if(0===n.length)i="[]";else if(""===c)i="["+n.join(",")+"]";else{var l=",\n"+a,u=n.join(l);i="[\n"+a+u+",\n"+t+"]"}return o.pop(),a=t,i}},ve={parse:ie,stringify:Le},Ie=ve,be=Ie;return be}()}(fp);var gp=kn(fp.exports);let wp=e.resolve(),Mp=e.resolve(wp,"settings.json"),yp=e=>{Mp=e},Dp=()=>{let e=t.readFileSync(Mp,"utf8");return gp.parse(e)},xp={minLength:8,maxLength:16,requireLetter:!0,requireUppercase:!1,requireLowercase:!1,requireDigit:!0,requireSpecial:!0,noSpace:!0,onlyAscii:!0,forbiddenChars:["\\"],noConsecutiveCharsFromAccount:!0,consecutiveCharsMinMatch:2,commonPasswordBlacklist:["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"]};return function(i,n,s,r,o={}){let a=null;if(!wn(i))throw console.log("invalid WOrm",i),new Error("invalid WOrm");if(!Ni(n))throw console.log("invalid url",n),new Error("invalid url");if(!Ni(s))throw console.log("invalid db",s),new Error("invalid db");An(r)||(r="./settings.json"),yp(r);let c=Dp();Ai(o)&&(c={...c,...o});let l=Ae(c,"serverPort");$i(l)||(l=11007),l=qi(l);let u=Zc(c),p=(e,t)=>{console.log(`[${e.toUpperCase()}] ${t}`),u[e]({event:"boot",msg:t})},d=Ae(c,"useCheckUser",!1),m=Ae(c,"getUserById",null),h=Ae(c,"useExcludeWhenNotAdmin",!1),f=Ae(c,"webName",{}),g=Ae(c,"webDescription",{}),w=Ae(c,"webLogo",""),M=Ae(c,"webBackgoundGradientColors",[]);on(M)||(M=["#FFE0B2","#FFCC80","#FFF59D","#F2D6A2","#F0CC88"]);let y=Ae(c,"webKey",""),D=Ae(c,"salt","");Ni(process.env.SALT)&&(D=process.env.SALT);let x=Ae(c,"minExpired","");an(x)||(x=30);let L=Ae(c,"minForAccountLoginFailed","");an(L)||(L=10);let v=Ae(c,"numForAccountLoginFailed","");an(v)||(v=3);let I=Ae(c,"minBlockForAccountLoginFailed","");an(I)||(I=30);let b=Ae(c,"minForTokenCallApi","");an(b)||(b=10);let C=Ae(c,"numForTokenCallApi","");an(C)||(C=1e3);let T=Ae(c,"minBlockForTokenCallApi","");an(T)||(T=30);let A=Ae(c,"minForIpCallApi","");an(A)||(A=10);let S=Ae(c,"numForIpCallApi","");an(S)||(S=1e4);let N=Ae(c,"minBlockForIpCallApi","");an(N)||(N=30);let k=Ae(c,"cleanKpIpCallApiForIps",[]);on(k)||(k=["127.0.0.1","::1","::ffff:127.0.0.1"]);let j=Ae(c,"cleanKpIpCallApiForToken",""),Z=Ae(c,"cleanKpAccountLoginFailedForIps",[]);on(Z)||(Z=["127.0.0.1","::1","::ffff:127.0.0.1"]);let z=Ae(c,"cleanKpAccountLoginFailedForToken",""),Y=!0===Ae(c,"allowUserRegistration",!1),X=Ae(c,"siteUrl","");Ni(X)||(X="");let F=Ae(c,"passwordPolicy");Ai(F)?F={...xp,...F}:(F=xp,p("info","settings 未提供 passwordPolicy, 採用程式內建預設密碼政策"));let U=Ae(F,"minLength");if(!$i(U)||qi(U)<1)throw new Error("invalid passwordPolicy.minLength: must be a positive integer >= 1");let G=Ae(F,"maxLength");if(!$i(G)||qi(G)<qi(U))throw new Error("invalid passwordPolicy.maxLength: must be a positive integer >= minLength");if(!Oi(Ae(F,"requireLetter")))throw new Error("invalid passwordPolicy.requireLetter: must be a boolean");if(!Oi(Ae(F,"requireUppercase")))throw new Error("invalid passwordPolicy.requireUppercase: must be a boolean");if(!Oi(Ae(F,"requireLowercase")))throw new Error("invalid passwordPolicy.requireLowercase: must be a boolean");if(!Oi(Ae(F,"requireDigit")))throw new Error("invalid passwordPolicy.requireDigit: must be a boolean");if(!Oi(Ae(F,"requireSpecial")))throw new Error("invalid passwordPolicy.requireSpecial: must be a boolean");if(!Oi(Ae(F,"noSpace")))throw new Error("invalid passwordPolicy.noSpace: must be a boolean");if(!Oi(Ae(F,"onlyAscii")))throw new Error("invalid passwordPolicy.onlyAscii: must be a boolean");let P=Ae(F,"forbiddenChars");if(!en(P))throw new Error("invalid passwordPolicy.forbiddenChars: must be an array");for(let e=0;e<wt(P);e++)if(!Si(P[e])||1!==wt(P[e]))throw new Error(`invalid passwordPolicy.forbiddenChars[${e}]: each element must be a single character string`);let K=Ae(F,"noConsecutiveCharsFromAccount");if(!Oi(K))throw new Error("invalid passwordPolicy.noConsecutiveCharsFromAccount: must be a boolean");if(K){let e=Ae(F,"consecutiveCharsMinMatch");if(!$i(e)||qi(e)<2)throw new Error("invalid passwordPolicy.consecutiveCharsMinMatch: must be a positive integer >= 2")}let O=Ae(F,"commonPasswordBlacklist");if(!en(O))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: must be an array");if(!function(e,t,i){var n=E(e)?Mt:Bt;return i&&Ei(e,t,i)&&(t=void 0),n(e,Ci(t))}(O,e=>Si(e)))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: each element must be a string");let _=Ae(c,"userLogo",""),W=Ae(c,"subfolder","");Ni(W)&&("/"===Dn(W,1)&&(W=xn(W,1)),"/"!==yn(W,1)&&(W=`/${W}`));let H=Ae(c,"showLanguage","n"),B=Ae(c,"language","eng"),V=Ae(c,"showModeEditUsers","n"),Q=Ae(c,"modeEditUsers","n"),R=Ae(c,"showModeEditTokens","n"),J=Ae(c,"modeEditTokens","n"),q=Ae(c,"showModeEditIps","n"),$=Ae(c,"modeEditIps","n");Ae(c,"mappingBy","");let ee=Ae(c,"kpLangExt",{}),te=(e=>{let t=Ae(e,"emSrcEmail","");if(!Ni(t))throw new Error(`invalid srcEmail[${t}]`);let i=Ae(e,"emSrcPW","");if(!Ni(i))throw new Error(`invalid srcPW[${i}]`);let n=Ae(e,"emSrcHost","");if(!Ni(n))throw new Error(`invalid srcHost[${n}]`);let s=Ae(e,"emSrcPort","");if(!$i(s))throw new Error(`invalid srcPort[${s}]`);return{send:async(e,r,o,a)=>{if(!Ni(e))return Promise.reject(`invalid srcName[${e}]`);if(!Ni(r))return Promise.reject(`invalid emTitle[${r}]`);if(!Ni(o))return Promise.reject(`invalid emContent[${o}]`);if(Ni(a)&&(a=[a]),!on(a))return Promise.reject(`invalid toEmails[${a}]`);let c={srcName:e,srcEmail:t,srcPW:i,srcHost:n,srcPort:s,emTitle:r,emContent:o,toEmails:a};return await new Nu(c)}}})(c),ie=(i,n="")=>{if(!Ni(i))return i;let s=e.resolve(i);return An(s)?t.readFileSync(s,"utf8"):((/^(\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/])/.test(i)||/\.(html|txt)$/i.test(i))&&p("warn",`settings.${n} 疑似檔案路徑但檔案不存在(${s}), 將原樣視為文字`),i)},ne={},se=["chpwEmTitle","chpwEmContent","regVerifyEmTitle","regVerifyEmContent","resetPwEmTitle","resetPwEmContent","userRegistrationVerifySuccess","verifyEmailAlreadyVerified","verifyEmailInvalidToken"];se.forEach(e=>{let t=(e=>{let t=Ae(c,e);if(!Ai(t))return{};let i={};return Object.keys(t).forEach(n=>{i[n]=ie(t[n],`${e}.${n}`)}),i})(e);wt(t)>0&&(ne[e]=t)});let re=Ju({kpLangExtEmail:ne,kpLangExt:ee,webName:f,webDescription:g}),oe={};Object.keys(re).forEach(e=>{let t={...re[e]};se.forEach(e=>{delete t[e]}),oe[e]=t});let ae={useCheckUser:d,getUserById:m,useExcludeWhenNotAdmin:h},ce={};try{ce=cc(vc,i,n,s,ae)}catch(e){throw console.log("WServOrm init failed",e),e}let{woItems:le,procOrm:ue}=ce,pe=Ae(c,"verifyBaseUrl","");Ni(pe)||(pe=`http://localhost:${l}`,Y&&p("warn",`settings 未提供 verifyBaseUrl, 註冊驗證信連結將採 ${pe}, 非本機部署時收信人將無法完成驗證, 請於 settings 提供對外可連之後端 base URL`));let de="./server/template",me="./node_modules/w-web-sso/server/template";En(me)&&(de=me);let he=Ae(c,"pathTemplate","");Ni(he)&&En(he)||(Ni(he)&&p("warn",`settings.pathTemplate 指定之資料夾不存在(${he}), 改採套件內建模板`),he=de);let fe=ie(Ae(c,"verifyEmailResultContent",""),"verifyEmailResultContent");if(!Ni(fe)){let i=e.resolve(he,"verifyEmailResult.html");An(i)||(i=e.resolve(de,"verifyEmailResult.html")),fe=t.readFileSync(i,"utf8")}let ge=Qu(le,ue,{srLog:u,srEmail:te,salt:D,minExpired:x,kpLang:re,passwordPolicy:F,allowUserRegistration:Y,siteUrl:X,verifyBaseUrl:pe}),we=qu(le,ge,{srLog:u,minForAccountLoginFailed:L,numForAccountLoginFailed:v,minBlockForAccountLoginFailed:I,minForTokenCallApi:b,numForTokenCallApi:C,minBlockForTokenCallApi:T,minForIpCallApi:A,numForIpCallApi:S,minBlockForIpCallApi:N}),Me=Ae(c,"logFd",""),ye=hp(0,ge,{srLog:u,logFd:Me}),De=(...e)=>e.every(e=>Ni(e)),xe=(e,t)=>Sc(t),Le="dist",ve="./node_modules/w-web-sso/dist";En(ve)&&(Le=ve);let Ie="index.html";try{let i=e.resolve(Le,"index.tmp");if(An(i)||(i=e.resolve(Le,Ie)),!An(i))throw console.log("fpEntryIn",i),new Error("invalid fpEntryIn");let n=e.resolve(Le,Ie),s=t.readFileSync(i,"utf8");s=Sn(s,"/msso/","{sfd}/"),s=Sn(s,"{sfd}",W),s=Sn(s,"{language}",B),t.writeFileSync(n,s,"utf8")}catch(e){console.log(e),console.log(`can not generate ${Ie}`)}let be=[{method:"GET",path:"/api/cleanKpIpCallApi",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");if(!Ni(j))return Promise.reject("invalid cleanKpIpCallApiForToken");if(t!==j)return Promise.reject("cleanKpIpCallApi invalid token");let i=Ae(e,"info.remoteAddress","");return Ni(i)||(i=Ae(e,"socket.remoteAddress","")),Ni(i)||(i=Ae(e,"connection.remoteAddress","")),k.includes(i)?(u.info({event:"api/cleanKpIpCallApi",realIp:i}),await we.cleanKpIpCallApi(),!0):Promise.reject(`cleanKpIpCallApi only allowed from cleanKpIpCallApiForIps, got realIp[${i}]`)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/cleanKpAccountLoginFailed",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");if(!Ni(z))return Promise.reject("invalid cleanKpAccountLoginFailedForToken");if(t!==z)return Promise.reject("cleanKpAccountLoginFailed invalid token");let i=Ae(e,"info.remoteAddress","");return Ni(i)||(i=Ae(e,"socket.remoteAddress","")),Ni(i)||(i=Ae(e,"connection.remoteAddress","")),Z.includes(i)?(u.info({event:"api/cleanKpAccountLoginFailed",realIp:i}),await we.cleanKpAccountLoginFailed(),!0):Promise.reject(`cleanKpAccountLoginFailed only allowed from cleanKpAccountLoginFailedForIps, got realIp[${i}]`)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutSsoUser",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/logoutSsoUser",token:zc(t)}),await ge.logoutByToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/checkToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/checkToken",token:zc(t)}),we.callApiByToken(t),await ge.checkToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/refreshToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/refreshToken",token:zc(t)}),we.callApiByToken(t),await ge.refreshToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutByToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/logoutByToken",token:zc(t)}),we.callApiByToken(t),await ge.logoutByToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUsersList",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");u.info({event:"api/getSsoUsersList",token:zc(t)}),we.callApiByToken(t);let i=await ge.checkTokenAndGetUsersList(t,{fun:xe,perm:"readUsers"});return i=i.map(ge.omitUserCredential),i})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUserInfor",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token",""),i=Ae(e,"query.key",""),n=Ae(e,"query.value","");if(!De(t,i,n))return Promise.reject("tokenExpired");let s=Xc(i,n);u.info({event:"api/getSsoUserInfor",token:zc(t),key:i,value:s}),we.callApiByToken(t);let r=null;return r="token"===i?await ge.checkTokenAndGetUserByToken(t,n,{fun:xe,perm:"readUsers"}):await ge.checkTokenAndGetUserInfor(t,i,n,{fun:xe,perm:"readUsers"}),Ai(r)?r:(console.log("token does not have permission"),Promise.reject("tokenNoPermission"))})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/verifyEmail",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/verifyEmail",token:zc(t)}),await ge.verifyEmail(t)})();gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg});let n,s=Ae(e,"query.lang","");"eng"!==s&&"cht"!==s&&(s="eng"),n="success"===i.state?"userRegistrationVerifySuccess":i.msg&&"string"==typeof i.msg?i.msg:"verifyEmailInvalidToken";let r=Ae(re,`${s}.webName`,""),o=Ae(re,`${s}.${n}`,n),a=fe;return a=Sn(a,"{title}",r),a=Sn(a,"{message}",o),t.response(a).type("text/html; charset=utf-8")}}],Ce={port:c.serverPort,pathStaticFiles:Le,apiName:"api",apis:be,tokenType:"Bearer",verifyConn:async({apiType:e,authorization:t,query:i,headers:n,req:s})=>{let r=we.getIpByHeaders(s),o=Ae(n,"origin",""),a=jc(Ae(n,"referer",""));u.info({event:"verifyConn",ip:r,origin:o,referer:a}),we.callApiByIp(r);let c=!0;return await we.getBlockedByIp(r).then(e=>{c=e}).catch(()=>{c=!0}),c=!c,c||console.log(`block ip[${r}]`),c},getUserIdByToken:async e=>"",corsOrigins:["*"],useDbOrm:!1,tableNamesExec:[],methodsExec:[],tableNamesSync:[],kpFunExt:{getWebInfor:async e=>({webLogo:w,webBackgoundGradientColors:M,webKey:y,userLogo:_,showLanguage:H,language:B,kpLang:oe,showModeEditUsers:V,modeEditUsers:Q,showModeEditTokens:R,modeEditTokens:J,showModeEditIps:q,modeEditIps:$,allowUserRegistration:Y,passwordPolicyInfo:{minLength:F.minLength,maxLength:F.maxLength,requireLetter:F.requireLetter,requireUppercase:F.requireUppercase,requireLowercase:F.requireLowercase,requireDigit:F.requireDigit,requireSpecial:F.requireSpecial,consecutiveCharsMinMatch:F.consecutiveCharsMinMatch}}),checkToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-checkToken",token:zc(t)}),await ge.checkToken(t)},refreshToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-refreshToken",token:zc(t)}),await ge.refreshToken(t)},loginByAccountAndPassword:async(e,t,i,n)=>{if(!De(i,n))return Promise.reject("failedLoginForCatch");u.info({event:"kpfun-loginByAccountAndPassword-before",account:i});let s=null,r="";return await we.loginByAccountAndPassword(i,n).then(e=>{s=e}).catch(e=>{r=e}),Ai(s)?u.info({event:"kpfun-loginByAccountAndPassword-success",account:i}):u.info({event:"kpfun-loginByAccountAndPassword-error",account:i,msg:r}),Ai(s)?s:Promise.reject(r)},logoutByToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-logoutByToken",token:zc(t)}),await ge.logoutByToken(t)},createUser:async(e,t,i,n,s,r,o)=>{u.info({event:"kpfun-createUser",lang:t,account:i});let a={lang:t,account:i,password:n,confirmPassword:s,name:r,email:o};return await ge.createUser(t,a)},verifyEmail:async(e,t)=>(u.info({event:"kpfun-verifyEmail",token:zc(t)}),await ge.verifyEmail(t)),resendVerifyEmail:async(e,t,i,n)=>(u.info({event:"kpfun-resendVerifyEmail",lang:t,account:i}),await ge.resendVerifyEmail(t,i,n)),getUserByToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUserByToken",token:zc(t)}),await ge.checkTokenAndGetUserByToken(t,t)},getUserInfor:async(e,t,i,n)=>{if(!De(t,i,n))return Promise.reject("tokenExpired");let s=Xc(i,n);return u.info({event:"kpfun-getUserInfor",token:zc(t),key:i,value:s}),await ge.checkTokenAndGetUserInfor(t,i,n,{fun:xe,perm:"readUsers"})},checkUserPassword:async(e,t,i)=>(u.info({event:"kpfun-checkUserPassword",lang:t}),await ge.checkUserPassword(t,i)),changeUserPassword:async(e,t,i,n,s)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-changeUserPassword",token:zc(t),lang:i}),await ge.checkTokenAndChangePassword(t,i,n,s)},adminResetUserPassword:async(e,t,i,n)=>{if(!De(t,n))return Promise.reject("tokenExpired");return u.info({event:"kpfun-adminResetUserPassword",token:zc(t),lang:i,targetUserId:n}),await ge.adminResetUserPassword(t,i,n)},getUsersList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUsersList",token:zc(t)}),await ge.checkTokenAndGetUsersList(t,{fun:xe,perm:"readUsers"})},updateUsersList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateUsersList",token:zc(t),lang:i}),await ge.checkTokenAndUpdateUsersList(t,i,n,{fun:xe,perm:"writeUsers"})},getTokensList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getTokensList",token:zc(t)}),await ge.checkTokenAndGetTokensList(t,{fun:xe,perm:"readTokens"})},updateTokensList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateTokensList",token:zc(t),lang:i}),await ge.checkTokenAndUpdateTokensList(t,n,{fun:xe,perm:"writeTokens"})},getIpsList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getIpsList",token:zc(t)}),await ge.checkTokenAndGetIpsList(t,{fun:xe,perm:"readIps"})},updateIpsList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateIpsList",token:zc(t),lang:i}),await ge.checkTokenAndUpdateIpsList(t,n,{fun:xe,perm:"writeIps"})},getStaUserSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserSummary",token:zc(t)}),await ye.checkTokenAndGetStaUserSummary(t,{fun:xe,perm:"readStats"})},getStaTokenSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaTokenSummary",token:zc(t)}),await ye.checkTokenAndGetStaTokenSummary(t,{fun:xe,perm:"readStats"})},getStaIpSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIpSummary",token:zc(t)}),await ye.checkTokenAndGetStaIpSummary(t,{fun:xe,perm:"readStats"})},getStaUserAccountLogin:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserAccountLogin",token:zc(t)}),await ye.checkTokenAndGetStaUserAccountLogin(t,{fun:xe,perm:"readStats"})},getStaToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaToken",token:zc(t)}),await ye.checkTokenAndGetStaToken(t,{fun:xe,perm:"readStats"})},getStaIp:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIp",token:zc(t)}),await ye.checkTokenAndGetStaIp(t,{fun:xe,perm:"readStats"})}},fpTableTags:"tableTags-web-sso.json"};return Ce.kpFunExt=Object.fromEntries(Object.entries(Ce.kpFunExt).map(([e,t])=>[e,async(...i)=>{try{return await t(...i)}catch(t){throw u.error({event:"kpfun-error",fun:e,key:Ni(t)?t:gn(t)?t.message:String(t)}),t}}])),a=new jo(Ce),a}});
|
|
13
|
+
}(e)&&(n?i.push("keyLimRequireSpecial"):i.push("密碼須包含至少一個特殊符號")),s&&wt(i)>0)throw new Error(i[0]);let f=Ae(t,"forbiddenChars",null);if(en(f)||(f=[]),wt(f)>0){for(let t of f)if(e.includes(t)){if(n){i.push("keyLimForbiddenChar");break}i.push(`密碼不可包含字元:${t}`)}if(s&&wt(i)>0)throw new Error(i[0])}let g=Ae(t,"commonPasswordBlacklist",null);if(en(g)||(g=ju),wt(g)>0){let t=e.toLowerCase();if(g.some(e=>Si(e)&&t===e.toLowerCase())&&(n?i.push("keyLimCommonPassword"):i.push("此密碼為常見弱密碼,不允許使用")),s&&wt(i)>0)throw new Error(i[0])}let w=Ae(t,"account",""),M=Ae(t,"noConsecutiveCharsFromAccount",null);Oi(M)||(M=!1);let y=Ae(t,"consecutiveCharsMinMatch","");if($i(y)||(y=3),y=qi(y),M&&Si(w)&&wt(w)>=y){let t=[...w.toLowerCase()],r=e.toLowerCase(),o=!1;for(let e=0;e<=t.length-y;e++){let i=t.slice(e,e+y).join("");if(r.includes(i)){o=!0;break}}if(o&&(n?i.push("keyLimConsecutiveCharsFromAccount"):i.push(`密碼不可包含與帳號相同之${y}個以上連續字元`)),s&&wt(i)>0)throw new Error(i[0])}if(wt(i)>0)throw new Error(i.join(" | "));return!0}function zu(e,t){return Mi(e,t)}function Yu(){let e=Kn(),t={};function i(t,i){Bn(e,t,[i],{tag:"cache"})}function n(e,n={}){if(ps(t,e))return;let s=Ae(n,"fun");wn(s)||(s=async()=>{});let r=Ae(n,"inputs");en(r)||(r=[]);let o=Ae(n,"timeExpired");$i(o)||(o=5e3),o=qi(o);let a=Ae(n,"timeFrom");"end"!==a&&(a="start");let c=Ae(n,"useCacheWhenError");Oi(c)||(c=!1);let l=Ae(n,"useCloneDeep");Oi(l)||(l=!0),t[e]={needExec:!0,fun:s,pm:null,gen:0,inputs:r,value:null,time:null,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l},i("message",{fun:"set",key:e,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l})}async function s(e,n={}){if(ps(t,e)){let s=t[e],r=Ae(n,"useCloneDeep");if(Oi(r)||(r=s.useCloneDeep),s.pm)return i("message",{fun:"get",key:e,msg:"waiting"}),await s.pm,r?vo(s.value):s.value;let o=Date.now(),a=s.needExec,c=o-s.time;if(a?i("message",{fun:"get",key:e,msg:"execute first"}):s.timeExpired>0&&c>s.timeExpired&&(i("message",{fun:"get",key:e,msg:"execute by timeExpired",timeDiff:c}),a=!0),a){i("message",{fun:"get",key:e,msg:"fun start"}),s.needExec=!1;let t=s.gen,n=async()=>{try{let n;try{n=await s.fun(...s.inputs)}catch(r){if(i("error",{fun:"get",key:e,msg:r}),!s.useCacheWhenError)throw s.gen===t&&(s.needExec=!0),r;n=void 0}s.gen===t&&(s.value=n,s.time="end"===s.timeFrom?Date.now():o)}finally{s.pm=null,i("message",{fun:"get",key:e,msg:"fun end"})}};s.pm=n(),await s.pm}else i("message",{fun:"get",key:e,msg:"use cache"});return r?vo(s.value):s.value}return i("error",{fun:"get",key:e,msg:"invalid key"}),null}return e.set=n,e.getProxy=async function(e,t={}){return n(e,t),s(e,t)},e.get=s,e.update=function(e,n){ps(t,e)&&(i("message",{fun:"updateValue",key:e}),t[e].value=n,t[e].time=Date.now(),t[e].gen+=1)},e.clear=function(e){ps(t,e)&&(i("message",{fun:"clear",key:e}),t[e].needExec=!0)},e.remove=function(e){ps(t,e)&&(i("message",{fun:"remove",key:e}),delete t[e])},e}function Xu(e={}){let t=Ae(e,"timeExpire",null);$i(t)||(t=18e5),t=qi(t),t=Math.min(t,On);let i=Ae(e,"timeDetect",null);$i(i)||(i=2e3),i=qi(i),i=Math.min(i,On);let n=Kn(),s={},r=e=>{if(ps(s,e)){return Hn(n,"checkWithSet",[{state:"error",msg:`checkWithSet: key in use: ${e}`}],{tag:"cacheSt"}),!1}return s[e]={time:Date.now(),value:!0},Hn(n,"checkWithSet",[{state:"success",msg:`checkWithSet: ${e}`}],{tag:"cacheSt"}),!0},o=setInterval(()=>{Hn(n,"detect",[{state:"start"}],{tag:"cacheSt"});let e=Date.now();for(let i of Object.keys(s)){let n=s[i];n&&e-n.time>t&&delete s[i]}Hn(n,"detect",[{state:"finish"}],{tag:"cacheSt"})},i);return n.checkWithSet=r,n.setWithFree=async(e,t)=>{Hn(n,"setWithFree",[{state:"start"}],{tag:"cacheSt"});let i=[];for(let t of e){if(!r(t)){for(let e of i)delete s[e];let e=`setWithFree: key in use: ${t}`;return Hn(n,"setWithFree",[{state:"error",msg:e}],{tag:"cacheSt"}),Promise.reject(e)}i.push(t)}try{let i=await t(),s=`setWithFree: ${e.join(", ")}`;return Hn(n,"setWithFree",[{state:"success",msg:s}],{tag:"cacheSt"}),i}catch(e){let t=`setWithFree: fn threw: ${e&&e.message||e}`;throw Hn(n,"setWithFree",[{state:"error",msg:t}],{tag:"cacheSt"}),e}finally{for(let e of i)delete s[e]}},n.set=async(e,t=!0)=>{s[e]={time:Date.now(),value:t},Hn(n,"set",[{state:"success",msg:`set: ${e}`}],{tag:"cacheSt"})},n.get=async e=>{let t=s[e],i=void 0===t?null:t.value;return Hn(n,"get",[{state:"success",msg:`get: ${e}`}],{tag:"cacheSt"}),i},n.check=async e=>{let t=ps(s,e);return Hn(n,"check",[{state:"success",msg:`check: ${e} = ${t}`}],{tag:"cacheSt"}),t},n.del=async e=>{delete s[e],Hn(n,"del",[{state:"success",msg:`del: ${e}`}],{tag:"cacheSt"})},n.waitExist=async(e,t={})=>{let i=Ae(t,"attemptNum",null);$i(i)||(i=30),i=qi(i);let r=Ae(t,"timeInterval",null);$i(r)||(r=100),r=qi(r),Hn(n,"waitExist",[{state:"start"}],{tag:"cacheSt"});try{await _n(()=>ps(s,e),{attemptNum:i,timeInterval:r})}catch(t){let s=`waitExist timeout (${i*r}ms): ${e}`;return Hn(n,"waitExist",[{state:"error",msg:s}],{tag:"cacheSt"}),Promise.reject(s)}Hn(n,"waitExist",[{state:"success",msg:`waitExist resolved: ${e}`}],{tag:"cacheSt"})},n.waitNotExist=async(e,t={})=>{let i=Ae(t,"attemptNum",null);$i(i)||(i=30),i=qi(i);let r=Ae(t,"timeInterval",null);$i(r)||(r=100),r=qi(r),Hn(n,"waitNotExist",[{state:"start"}],{tag:"cacheSt"});try{await _n(()=>!ps(s,e),{attemptNum:i,timeInterval:r})}catch(t){let s=`waitNotExist timeout (${i*r}ms): ${e}`;return Hn(n,"waitNotExist",[{state:"error",msg:s}],{tag:"cacheSt"}),Promise.reject(s)}Hn(n,"waitNotExist",[{state:"success",msg:`waitNotExist resolved: ${e}`}],{tag:"cacheSt"})},n.clear=()=>{clearInterval(o)},n}function Fu(e,t,i={}){let n=Ae(i,"mode","");if(Ni(n)||(n="scrypt"),"scrypt"!==n)throw new Error("暫時不支援scrypt以外方法");let s=I.randomBytes(16),r=`${e}:${t||""}`,o=I.scryptSync(r,s,64);return`scrypt:${s.toString("hex")}:${o.toString("hex")}`}function Uu(e,t,i){if(!Ni(t))return!1;let n=t.split(":");if(3!==n.length)return!1;let s,r,[o,a,c]=n;if("scrypt"!==o)return!1;if(!Ni(a)||!Ni(c))return!1;try{s=Buffer.from(a,"hex"),r=Buffer.from(c,"hex")}catch(e){return!1}if(16!==s.length||64!==r.length)return!1;let l=`${e}:${i||""}`,u=I.scryptSync(l,s,64);return u.length===r.length&&I.timingSafeEqual(u,r)}function Gu(e){return e[x.randomInt(e.length)]}function Pu(e){for(let t=e.length-1;t>0;t--){let i=x.randomInt(t+1),n=e[t];e[t]=e[i],e[i]=n}return e}let Ku=["readUsers","writeUsers","readTokens","writeTokens","readIps","writeIps","readStats"],Ou=["readUsers"];function _u(e){return Ni(e)&&Ku.includes(e)}function Wu(e){return null==e||""===e||!!en(e)&&e.every(_u)}function Hu(e){return en(e)?Ku.filter(t=>e.includes(t)):[]}function Bu(e,t){return!!_u(t)&&function(e){let t=Hu(Ae(e,"perms"));return Ku.filter(e=>Ou.includes(e)||t.includes(e))}(e).includes(t)}let Vu=["password","tokenVerify"];function Qu(e){return"string"!=typeof e&&(e=null==e?"":String(e)),e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Ru(e,t,{srLog:i,srEmail:n,salt:s,minExpired:r,kpLang:o,passwordPolicy:a,allowUserRegistration:c,siteUrl:l,verifyBaseUrl:u}){let p=new function(){let e=new Map,t=new Map;return async(i,n)=>{let s=(e.get(i)||Promise.resolve()).then(async()=>await n(),async()=>await n());e.set(i,s.catch(()=>{})),t.set(i,(t.get(i)||0)+1);try{return await s}finally{let n=t.get(i)-1;n<=0?(t.delete(i),e.delete(i)):t.set(i,n)}}},d=Xu(),m=function(e){return async(t,i,n,s={})=>{let r=Ae(s,"errKey","");Ni(r)||(r="saveInProgress");let o=`${t}:${i}`;return await e.setWithFree([o],n).catch(e=>e===`setWithFree: key in use: ${o}`?Promise.reject(r):Promise.reject(e))}}(d),h=new Map,f=new Map,g=(e,t)=>Ae(o,`${t}.${e}`,""),w=(e,t,i={})=>{"eng"!==t&&"cht"!==t&&(t="eng");let n=Ae(o,`${t}.${e}`,"");for(let e in i)n=n.replaceAll(`{${e}}`,Qu(i[e]));return n},M=async(t,n,s={})=>{let r=null,o=Ae(s,"deletePassword");Oi(o)||(o=!0);let a=await e.users.select({[t]:n,isActive:"y"}).catch(e=>{r=e});if(r)return console.log(r),console.log("keyUser",t),console.log("valueUser",Fc(t,n)),console.log("failed to find user"),Promise.reject("failed to find user");o&&(a=ks(a,e=>(delete e.password,e)));let c=wt(a);return 0===c?(i&&wn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userNotFound",keyUser:t,valueUser:n}),Promise.reject(`can not find the user by ${t}`)):c>=2?(i&&wn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userDuplicate",keyUser:t,valueUser:n}),Promise.reject(`duplicate ${t}`)):a[0]},y=async(e,t)=>await M(e,t),D=async(e,t={})=>await y("id",e),x=async t=>{let i=null;if(!an(r))return console.log("minExpired",r),console.log("invalid minExpired"),Promise.reject("invalid minExpired");let n=Ic.tokens.funNew({userId:t});n.timeEnd=zn().add(r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");let s=Ae(n,"token","");return await e.tokens.insert(n).catch(e=>{i=e}),i?(console.log(i),console.log("can not create a token from userId"),Promise.reject("can not create a token from userId")):s},L=async(t,n={})=>{let s=await e.tokens.select({token:t}),r=wt(s);if(0===r)return console.log("invalid token"),Promise.reject("invalid token");if(r>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(s,0,""),a=Ae(o,"userId",""),c=await(async(e,t={})=>{let n=Ae(e,"timeEnd","");if(!Ec(n))return console.log("timeEnd",n),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let s=Ae(e,"isApp",""),r=Ae(t,"fun",null),o=Ae(t,"perm",""),a=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<n,c=!0;if("y"!==s){if(wn(r)){let t=Ae(e,"userId","");c=r(e,await D(t)),vn(c)&&(c=await c)}}else Ni(o)?c=Bu(e,o):wn(r)&&(c=!1),c||i.warn({event:"fun-checkToken",key:"appTokenPermDenied",token:Yc(Ae(e,"token","")),userId:Ae(e,"userId",""),perm:o});return a&&c})(o,n);return i.info({event:"fun-checkToken",token:Yc(t),userId:a,res:c}),c},v=async(e,t={})=>{if(!Ni(e))return Promise.reject("tokenExpired");let i=null;return await L(e,t).then(e=>{!1===e&&(i="tokenExpired")}).catch(e=>{console.log("checkToken inner reject",e),i="tokenExpired"}),null===i||Promise.reject(i)},I=(e,t,i={})=>{Ni(e)||(e="eng");let n=Ae(i,"account",""),s="";try{Zu(t,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:a.minLength,numLenMax:a.maxLength,requireLetter:a.requireLetter,requireUppercase:a.requireUppercase,requireLowercase:a.requireLowercase,requireDigit:a.requireDigit,requireSpecial:a.requireSpecial,noSpace:a.noSpace,onlyAscii:a.onlyAscii,forbiddenChars:a.forbiddenChars,commonPasswordBlacklist:a.commonPasswordBlacklist,account:n,noConsecutiveCharsFromAccount:a.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:a.consecutiveCharsMinMatch})}catch(e){s=e.message}let r=null;return Ni(s)?(r={state:"error",key:`userPassword_${s}`},r):(r={state:"success",msg:"ok"},r)},b=async(n,r,o,a={})=>{let c=Ae(a,"resetOrder");Oi(c)||(c=!1);let l=Ae(a,"operatorId",""),u=Ae(a,"lang","eng");Ni(u)||(u="eng");let p=[];ms(r,e=>{!0===Ae(e,"_isNew")&&p.push(Ae(e,"id",""))}),r=function(e,t,i=""){return on(e)&&on(t)?ks(e,e=>Mc(e,t,i)):[]}(r,Ic[n].keys),c&&(r=ks(r,(e,t)=>(e.order=t+1,e)));let d=(e,t)=>{let i=null,n={};return ms(e,(e,s)=>{let r=Ae(e,t,"");return Ni(r)?ps(n,r)?(i=`rows[${s}].${t}[${r}] is duplicate`,!1):void(n[r]=!0):(i=`rows[${s}].${t} is not an effective string`,!1)}),i},m=null;if(function(e,t){function i(e){return en(e)?e:[e]}if(rn(e))return!1;if(0===(e=i(e)).length)return!1;if(rn(e))return!1;if(0===(t=i(t)).length)return!1;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)if(zu(e[i],t[n]))return!0;return!1}(n,["users"])){if(m=d(r,"id"),null!==m)return Promise.reject(m);if(m=d(r,"email"),null!==m)return Promise.reject(m)}let h=await e[n].select();if(wt(p)>0){let e={};if(ms(h,t=>{e[Ae(t,"id","")]=!0}),p.some(t=>!0===e[t]))return Promise.reject("saveNewRowExists")}if("users"===n){let e={};ms(h,t=>{let i=Ae(t,"account","");Ni(i)&&(e[i]=Ae(t,"id",""))});let t={},i=null;if(ms(r,n=>{let s=Ae(n,"account",""),r=Ae(n,"id","");return Ni(s)?ps(t,s)||ps(e,s)&&e[s]!==r?(i="accountDuplicate",!1):void(t[s]=!0):(i="accountRequired",!1)}),null!==i)return Promise.reject(i)}if("users"===n){let e={};ms(h,t=>{e[t.id]=t}),ms(r,t=>{let i=e[t.id];i&&(t.password=i.password)})}let f=r,g=function(e,t,i,n={}){let s=Ae(n,"withInfor");Oi(s)||(s=!0);let r={del:[],add:[],same:[],diff:[]};if(!Ni(i))return console.log("invalid key"),s&&(r.infor={}),r;en(e)||(e=[e]),en(t)||(t=[t]),e=Ra(e,e=>ps(e,i)),t=Ra(t,e=>ps(e,i));let o=new Map(t.map(e=>[e[i],e]));for(let t of e){let e=o.get(t[i]);e?(JSON.stringify(t)===JSON.stringify(e)?r.same.push(e):r.diff.push(e),o.delete(t[i])):r.del.push(t)}if(r.add=Array.from(o.values()),s){let e={};for(let t of r.del)e[t[i]]="del";for(let t of r.add)e[t[i]]="add";for(let t of r.diff)e[t[i]]="diff";for(let t of r.same)e[t[i]]="same";r.infor=e}return r}(h,f,o);if(wt(g.del)>0&&(await t(l,n,"del",g.del),"users"===n))for(let t of g.del){let n=Ae(t,"id","");if(Ni(n))try{let t=await e.tokens.select({userId:n});for(let i of t)await e.tokens.del({id:i.id})}catch(m){i.error({event:"fun-updateTabItems-revokeTokenOnDelete",userId:n,err:ts(m)})}}if(wt(g.add)>0){if("users"===n){for(let e of g.add){let t=Ae(e,"password",""),i=Ae(e,"account",""),n=I(u,t,{account:i});if("error"===n.state)return Promise.reject(n.key);e.password=Fu(t,s)}ms(g.add,e=>{Ni(Ae(e,"timeVerified",""))||(e.timeVerified=Yo())})}await t(l,n,"insert",g.add)}if(wt(g.diff)>0){let e={};ms(h,t=>{e[Ae(t,o,"")]=t});let i=[];ms(g.diff,t=>{let n=Ae(t,o,""),s=null;ms(t,(t,i)=>{let r=Ae(e,[n,i]);en(t)&&en(r)&&t.length<r.length&&(null===s&&(s={[o]:n}),s[i]=null)}),null!==s&&i.push(s)}),wt(i)>0&&await t(l,n,"save",i),await t(l,n,"save",g.diff)}return"users"===n&&(f=ks(f,e=>{let t={...e};return delete t.password,t})),f},C=async t=>{let i=await e.tokens.select({token:t}),n=wt(i);if(0===n)return console.log("invalid token"),Promise.reject("invalid token");if(n>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let s=Ae(i,0,null),r=Ae(s,"isApp",""),o=null;if("y"!==r){let e=Ae(s,"userId","");o=await D(e)}else{let e=Ae(s,"userId","");if(!Ni(e))return console.log("invalid userId from token"),Promise.reject("invalid userId from token");o={id:e,account:"no account",name:"no name",email:"no email",description:"no description",from:"no from",redir:"no redir",isAdmin:"y",timeVerified:"2000-01-01T00:00:00.000+08:00",timeExpired:"",timeBlocked:"",isActive:"y"}}return{id:o.id,account:o.account,name:o.name,email:o.email,description:o.description,from:o.from,redir:o.redir,isApp:"y"===r?"y":"n",isAdmin:o.isAdmin,timeVerified:o.timeVerified,timeExpired:o.timeExpired,timeBlocked:o.timeBlocked,isActive:o.isActive,isForceChangePw:o.isForceChangePw}},E=async(e,t,i={})=>{let n=await y(e,t).catch(()=>null);return Ai(n)?{id:n.id,account:n.account,name:n.name,email:n.email,description:n.description,from:n.from,redir:n.redir,isAdmin:n.isAdmin,timeVerified:n.timeVerified,timeExpired:n.timeExpired,timeBlocked:n.timeBlocked,isActive:n.isActive}:null},T=async(t={})=>{let i=Ae(t,"needActive");Oi(i)||(i=!1);let n=Ae(t,"deletePassword");Oi(n)||(n=!0);let s={};i&&(s={isActive:"y"});let r=await e.users.select(s);return n&&(r=ks(r,e=>(delete e.password,e))),r},A=Yu(),S=async(e,t={})=>(await v(e,t),await T(t)),N=async(e,t={})=>e=await b("users",e,"id",{resetOrder:!0,...t}),k=async()=>await e.tokens.select(),j=Yu(),Z=async()=>await e.ips.select(),z=Yu(),Y={getTokenByKV:async(t,i)=>{let n=null,s=await e.tokens.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("failed to find token"),Promise.reject("failed to find token");let r=wt(s);return 0===r?Promise.reject(`can not find the token by keyToken[${t}]`):r>=2?(console.log(`duplicate token by keyToken[${t}]`),Promise.reject(`duplicate token by keyToken[${t}]`)):s[0]},createUser:async(i,r)=>{if(Ni(i)||(i="eng"),!c)return Promise.reject("userRegistrationNotAllowed");let a=Ae(r,"account","");if(!Ni(a))return Promise.reject("userRegistrationAccountInvalid");let l=Ae(r,"email","");if(!Ni(l)||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l))return Promise.reject("userRegistrationEmailFormatInvalid");let p=Ae(r,"password",""),m=Ae(r,"confirmPassword","");if(p!==m)return Promise.reject("userChangePasswordNotSame");let h=I(i,p,{account:a});if("error"===h.state)return Promise.reject(h.key);let f=Ae(r,"name","");if(!Ni(f))return Promise.reject("userRegistrationNameInvalid");let M,y=`createUser:account:${a}`,D=`createUser:email:${l}`;await d.setWithFree([y,D],async()=>{let i=await e.users.select(),n=i.some(e=>Ae(e,"account","")===a);if(n)return Promise.reject("userRegistrationAccountExists");let r=i.some(e=>Ae(e,"email","")===l);if(r)return Promise.reject("userRegistrationEmailExists");let o=Fu(p,s);M=`${wc()}`;let c=Ic.users.funNew({account:a,password:o,name:f,email:l,tokenVerify:M,isAdmin:"n",isActive:"y"});await t(c.id,"users","insert",[c])}).catch(e=>{let t=e&&"string"==typeof e?e:e&&e.message||String(e);return t.includes(y)?Promise.reject("userRegistrationAccountExists"):t.includes(D)?Promise.reject("userRegistrationEmailExists"):Promise.reject(e)});try{let e=Ae(o,`${i}.webName`,""),t=g("regVerifyEmTitle",i),s=w("regVerifyEmContent",i,{sender:e,name:f,verifyUrl:`${u}/api/verifyEmail?token=${M}&lang=${i}`});await n.send(e,t,s,l)}catch(e){console.log("send verify email error",e)}return{state:"success",msg:"ok"}},verifyEmail:async t=>{if(!Ni(t))return Promise.reject("verifyEmailInvalidToken");let i=await e.users.select({tokenVerify:t});if(0===wt(i))return Promise.reject("verifyEmailInvalidToken");let n=i[0];return Ni(Ae(n,"timeVerified",""))?Promise.reject("verifyEmailAlreadyVerified"):(await e.users.save({id:n.id,timeVerified:Yo()}),{state:"success",msg:"ok"})},resendVerifyEmail:async(t,i,s)=>(Ni(t)||(t="eng"),Ni(i)&&Ni(s)?await p(`resendVerifyEmail:${i}`,async()=>{let r=Date.now(),a=h.get(i);if(a&&r-a<3e4)return Promise.reject("userRegistrationResendThrottled");let c=null;try{c=await M("account",i)}catch(e){}if(!c)return Promise.reject("userRegistrationResendInvalidEmail");if(Ae(c,"email","")!==s)return Promise.reject("userRegistrationResendInvalidEmail");if(Ni(Ae(c,"timeVerified","")))return Promise.reject("userRegistrationAlreadyVerified");let l=Ae(c,"id",""),p=Ae(c,"name",""),d=`${wc()}`;await e.users.save({id:l,tokenVerify:d}),h.set(i,r);try{let e=Ae(o,`${t}.webName`,""),i=g("regVerifyEmTitle",t),r=w("regVerifyEmContent",t,{sender:e,name:p,verifyUrl:`${u}/api/verifyEmail?token=${d}&lang=${t}`});await n.send(e,i,r,s)}catch(e){return console.log("resend verify email error",e),Promise.reject("userRegistrationResendFailed")}return{state:"success",msg:"ok"}}):Promise.reject("userRegistrationResendInvalidEmail")),checkUserPassword:I,checkTokenAndChangePassword:async(t,r,a,c)=>{if(await v(t),Ni(r)||(r="eng"),!Ni(a))return Promise.reject("userChangePasswordFail");let l=Ae(await C(t),"id","");return await p(`changeUserPassword:${l}`,async()=>{let u=await M("id",l,{deletePassword:!1}),p=Ae(u,"account",""),d=I(r,c,{account:p});if("error"===d.state)return Promise.reject(d.key);let m=Ae(u,"password","");if(!Uu(a,m,s))return Promise.reject("userChangePasswordIncorrectOld");let h=Ae(u,"email","");if(!Ni(h))return Promise.reject("anUnexpectedErrorOccurred");let f=Fu(c,s);await e.users.save({id:l,password:f,isForceChangePw:"n"});try{let e=Ae(o,`${r}.webName`,"");if(!Ni(e))throw console.log("get(kpLang, lang)",Ae(o,r)),console.log("lang",r),new Error("invalid sender");let t=Ae(u,"name","unknow"),i=g("chpwEmTitle",r);if(!Ni(i))throw console.log("chpwEmTitle 取不到, lang",r),new Error("invalid title");let s=w("chpwEmContent",r,{sender:e,name:t});await n.send(e,i,s,h)}catch(e){console.log(e),i.error({event:"fun-changePassword-sendEmail",token:Yc(t),lang:r,err:ts(e)})}})},adminResetUserPassword:async(t,r,c)=>{if(await v(t,{perm:"writeUsers"}),Ni(r)||(r="eng"),!Ni(c))return Promise.reject("anUnexpectedErrorOccurred");let l=await C(t),u=Ae(l,"id","");return"y"!==Ae(l,"isAdmin","")?Promise.reject("adminResetPasswordForbidden"):u===c?Promise.reject("adminResetPasswordCannotResetSelf"):await p(`adminResetUserPassword:${c}`,async()=>{let l=Date.now(),u=f.get(c);if(u&&l-u<3e4)return Promise.reject("adminResetPasswordAlreadyTriggered");let p=null;try{p=await M("id",c,{deletePassword:!0})}catch(e){return Promise.reject("adminResetPasswordUserNotFound")}if(!Ai(p))return Promise.reject("adminResetPasswordUserNotFound");let d=Ae(p,"account",""),m=Ae(p,"name","unknow"),h=Ae(p,"email",""),y=function(e,t=""){let i=e.minLength||8,n=e.maxLength||16,s=Math.min(Math.max(i,12),n),r="abcdefghijklmnopqrstuvwxyz".split(""),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),a="0123456789".split(""),c="!@#$%^&*()_+-=[]{}|;:,.<>?".split(""),l=e.forbiddenChars||[];c=c.filter(e=>!l.includes(e));let u=[];(e.requireLowercase||e.requireLetter)&&(u=u.concat(r)),e.requireUppercase&&(u=u.concat(o)),!e.requireLetter||e.requireUppercase||e.requireLowercase||(u=u.concat(o)),e.requireDigit&&(u=u.concat(a)),e.requireSpecial&&(u=u.concat(c)),0===u.length&&(u=r.concat(o).concat(a));for(let i=0;i<20;i++){let i=[];for(e.requireLetter&&i.push(Gu(r.concat(o))),e.requireUppercase&&i.push(Gu(o)),e.requireLowercase&&i.push(Gu(r)),e.requireDigit&&i.push(Gu(a)),e.requireSpecial&&i.push(Gu(c));i.length<s;)i.push(Gu(u));Pu(i);let n=i.join("");try{return Zu(n,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:e.minLength,numLenMax:e.maxLength,requireLetter:e.requireLetter,requireUppercase:e.requireUppercase,requireLowercase:e.requireLowercase,requireDigit:e.requireDigit,requireSpecial:e.requireSpecial,noSpace:e.noSpace,onlyAscii:e.onlyAscii,forbiddenChars:e.forbiddenChars,commonPasswordBlacklist:e.commonPasswordBlacklist,account:t,noConsecutiveCharsFromAccount:e.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:e.consecutiveCharsMinMatch}),n}catch(e){}}throw new Error("cannot generate random password matching policy")}(a,d),D=Fu(y,s);await e.users.save({id:c,password:D,isForceChangePw:"y"}),f.set(c,l);try{if(Ni(h)){let e=Ae(o,`${r}.webName`,"");if(!Ni(e))throw new Error("invalid sender");let t=g("resetPwEmTitle",r);if(!Ni(t))throw new Error("invalid title");let i=w("resetPwEmContent",r,{sender:e,name:m,account:d,newPassword:y});await n.send(e,t,i,h)}else i.error({event:"fun-adminResetUserPassword-noEmail",token:Yc(t),targetUserId:c})}catch(e){console.log(e),i.error({event:"fun-adminResetUserPassword-sendEmail",token:Yc(t),targetUserId:c,err:ts(e)})}return{state:"success"}})},getIpByKV:async(t,i)=>{let n=null,s=await e.ips.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("keyIp",t),console.log("valueIp",i),console.log("failed to find ip"),Promise.reject("failed to find ip");let r=wt(s);return 0===r?Promise.reject(`can not find the ip by keyIp[${t}]`):r>=2?(console.log("keyIp",t),console.log("valueIp",i),console.log(`duplicate ip by keyIp[${t}]`),Promise.reject(`duplicate ip by keyIp[${t}]`)):s[0]},getGenUserByKV:y,getGenUserByUserId:D,getGenUserByAccount:async(e,t={})=>await y("account",e),loginByAccountAndPassword:async(t,i)=>{if(!Ni(t)||!Ni(i))return Promise.reject("failedLoginForCatch");let n=await e.users.select({account:t});if(0===wt(n))return Promise.reject("failedLoginForCatch");let r=n[0];if(!Uu(i,Ae(r,"password",""),s))return Promise.reject("failedLoginForCatch");if(!Ni(Ae(r,"timeVerified","")))return Promise.reject("userRegistrationNotVerified");let o=Ae(r,"timeExpired","");if(Ni(o)&&Ec(o)){if(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>o)return Promise.reject("loginAccountExpired")}let a=Ae(r,"id",""),c=await x(a);return{id:r.id,account:r.account,name:r.name,email:r.email,description:r.description,from:r.from,redir:r.redir,isAdmin:r.isAdmin,isActive:r.isActive,isForceChangePw:r.isForceChangePw,token:c}},logoutByToken:async t=>{if(!Ni(t))return Promise.reject("tokenExpired");let n=null,s=await e.tokens.select({token:t}),r=wt(s);if(0===r)return console.log("invalid token"),Promise.reject("invalid token");if(r>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(s,0,""),a=Ae(o,"userId",""),c=await e.tokens.del({id:o.id}).catch(e=>{n=e});return n?(console.log(n),console.log("failed to delete token"),Promise.reject("failed to delete token")):(c=Ae(c,"0.nDeleted",0),1!==c?(console.log("can not delete the token"),Promise.reject("can not delete the token")):(i.info({event:"fun-logout",token:Yc(t),userId:a}),!0))},checkToken:v,refreshToken:async t=>{if(!Ni(t))return Promise.reject("tokenExpired");let i=null,n=await e.tokens.select({token:t}),s=wt(n);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=Ae(n,0,""),a=Ae(o,"timeEnd","");if(!Ec(a))return console.log("timeEnd",a),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let c=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ");if(c>=a)return console.log("tn",c),console.log("timeEnd",a),console.log("token expired"),Promise.reject("tokenExpired");let l=zn().add(r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),u=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ");return await e.tokens.save({id:o.id,timeEnd:l,timeUpdate:u}).catch(e=>{i=e}),i?(console.log(i),console.log("can not update timeEnd for token"),Promise.reject("can not update timeEnd for token")):l},getUserByToken:C,checkTokenAndGetUserByToken:async(e,t,i={})=>(await v(e,i),await C(t).catch(()=>null)),getUserInfor:E,checkTokenAndGetUserInfor:async(e,t,i,n={})=>(await v(e,n),await E(t,i)),getUsersList:T,getUsersListCache:async()=>await A.getProxy("fun",{fun:T,inputs:null,timeExpired:3e4}),checkTokenAndGetUsersList:S,checkTokenAndGetActiveUsersList:async(e,t={})=>await S(e,{...t,needActive:!0}),omitUserCredential:e=>{let t={...e};for(let e of Vu)delete t[e];return t},updateUsersList:N,checkTokenAndUpdateUsersList:async(t,n,s,r={})=>{await v(t,r),Ni(n)||(n="eng");let o=await C(t),a=Ae(o,"id","");if(!("y"===Ae(o,"isApp",""))){let e=null;if(ms(s,t=>{if(Ae(t,"id","")===a)return e=t,!1}),Ni(a)&&!Ai(e))return Promise.reject("cannotDeleteSelf");if(Ai(e)){if("y"!==Ae(e,"isAdmin",""))return Promise.reject("cannotDemoteSelf");if("y"!==Ae(e,"isActive",""))return Promise.reject("cannotDisableSelf")}}return await m("updateUsersList",a,async()=>{s=await N(s,{lang:n,operatorId:a});for(let t of s){if("n"!==Ae(t,"isActive",""))continue;let n=Ae(t,"id","");if(Ni(n))try{let t=await e.tokens.select({userId:n});for(let i of t)await e.tokens.del({id:i.id})}catch(e){i.error({event:"fun-updateUsersList-revokeToken",userId:n,err:ts(e)})}}return A.clear("fun"),s})},getTokensList:k,getTokensListCache:async()=>await j.getProxy("fun",{fun:k,inputs:null,timeExpired:3e4}),checkTokenAndGetTokensList:async(e,t={})=>(await v(e,t),await k()),checkTokenAndUpdateTokensList:async(t,i,n={})=>{await v(t,n);let s=Ae(await C(t),"id","");return await m("updateTokensList",s,async()=>(i=await(async t=>{let i={};ms(await e.tokens.select(),e=>{i[e.id]=JSON.stringify(Ae(e,"perms"))});for(let e of t){let t=Ae(e,"perms"),n=Ae(e,"id","");if(!(ps(i,n)&&i[n]===JSON.stringify(t)||Wu(t)))return Promise.reject("tokenPermsInvalid")}return t=ks(t,e=>({...e,perms:Hu(Ae(e,"perms"))})),await b("tokens",t,"id",{resetOrder:!1})})(i),j.clear("fun"),i))},getIpsList:Z,getIpsListCache:async()=>await z.getProxy("fun",{fun:Z,inputs:null,timeExpired:3e4}),checkTokenAndGetIpsList:async(e,t={})=>(await v(e,t),await Z()),checkTokenAndUpdateIpsList:async(e,t,i={})=>{await v(e,i);let n=Ae(await C(e),"id","");return await m("updateIpsList",n,async()=>(t=await(async e=>await b("ips",e,"id",{resetOrder:!1}))(t),z.clear("fun"),t))}};return Y}let Ju={csIng:{eng:"Connecting...",cht:"連線中..."},csLogin:{eng:"Logged in",cht:"已登入"},csLogout:{eng:"Logged out",cht:"已登出"},csErrConn:{eng:"Unable to connect",cht:"無法連線"},csErrLogin:{eng:"Login denied",cht:"拒絕登入"},aggridLanguage:{eng:"en",cht:"zh-tw"},id:{eng:"ID",cht:"主鍵"},systemMessage:{eng:"System message",cht:"系統確認訊息"},ok:{eng:"OK",cht:"確認"},no:{eng:"No",cht:"取消"},yes:{eng:"Yes",cht:"確定"},y:{eng:"Yes",cht:"是"},n:{eng:"No",cht:"否"},empty:{eng:"Empty",cht:"無"},to:{eng:"To",cht:"至"},at:{eng:"At",cht:"於"},unknow:{eng:"Unknown",cht:"未知"},waitingData:{eng:"Waiting data...",cht:"等待數據中..."},saveChanges:{eng:"Save changes",cht:"儲存變更"},from:{eng:"From",cht:"來源"},save:{eng:"Save",cht:"儲存"},close:{eng:"Close",cht:"關閉"},send:{eng:"Send",cht:"送出"},cancel:{eng:"Cancel",cht:"取消"},processing:{eng:"Processing...",cht:"處理中請稍後..."},anUnexpectedErrorOccurred:{eng:"An unexpected error occurred, please contact the administrator",cht:"發生非預期錯誤,請洽管理員"},getDataError:{eng:"Failed to get data, please try again later",cht:"取得數據失敗,請稍後再試"},timeCreate:{eng:"Created time",cht:"創建時間"},userIdUpdate:{eng:"ID of the updated user",cht:"最新變更使用者主鍵"},timeUpdate:{eng:"Updated time",cht:"最新變更時間"},userId:{eng:"ID of the user",cht:"使用者主鍵"},account:{eng:"Account",cht:"帳號"},password:{eng:"Password",cht:"密碼"},toggleToShowPassword:{eng:"To show password",cht:"變更為顯示密碼模式"},toggleToHidePassword:{eng:"To hide password",cht:"變更為隱藏密碼模式"},username:{eng:"Username",cht:"使用者姓名"},email:{eng:"Email",cht:"電子郵件"},name:{eng:"Name",cht:"名稱"},description:{eng:"Description",cht:"說明"},redir:{eng:"Redirect",cht:"登入後轉至網址"},login:{eng:"Log in",cht:"登入"},logout:{eng:"Log out",cht:"登出"},menuTreeShow:{eng:"Show menu",cht:"顯示選單"},menuTreeHide:{eng:"Hide menu",cht:"隱藏選單"},menuUser:{eng:"User menu",cht:"使用者選單"},language:{eng:"Language",cht:"語系"},mmStaInfor:{eng:"Statistics information",cht:"統計資訊"},mmUserInfor:{eng:"User information",cht:"使用者資訊"},mmUsersList:{eng:"Users list",cht:"使用者清單"},mmUsersListMsg:{eng:"Provide a list of users, which can be added, edited, deleted, etc.",cht:"提供目前使用者資料清單,可進行新增、編輯、刪除等作業。"},mmTokensList:{eng:"Tokens list",cht:"金鑰清單"},mmTokensListMsg:{eng:"Provide a list of tokens, which can be deleted, etc.",cht:"提供目前金鑰資料清單,可進行強制登出等作業。"},mmIpsList:{eng:"Ips list",cht:"IP清單"},mmIpsListMsg:{eng:"Provide a list of IPs, which can be blocked, etc.",cht:"提供目前存取IP清單,可進行封鎖等作業。"},failedLoginForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLoginForNoToken:{eng:"Can not get the token",cht:"無有效金鑰"},failedLoginForNoRedir:{eng:"Can not get the url for redirection",cht:"無有效轉址"},failedLoginForCatch:{eng:"User account or password is incorrect",cht:"使用者帳密錯誤無法登入"},failedLogoutForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLogoutForCatch:{eng:"Can not logout",cht:"使用者登出失敗"},userStatus:{eng:"Status",cht:"帳號狀態"},isVerified:{eng:"Verified",cht:"帳號是否驗證"},isVerifiedY:{eng:"Verified",cht:"帳號已驗證"},isVerifiedN:{eng:"Not verified",cht:"帳號未驗證"},userTimeVerified:{eng:"Verified time",cht:"帳號驗證狀態與時間"},isVerifiedWaiting:{eng:"Waiting for verification",cht:"等待驗證中"},isExpired:{eng:"Expired",cht:"帳號是否過期"},isExpiredY:{eng:"Expired",cht:"帳號已過期"},isExpiredN:{eng:"Not expired",cht:"帳號未過期"},userTimeExpired:{eng:"Expired time",cht:"帳號過期狀態與時間"},isExpiredDeny:{eng:"Account login prohibited",cht:"禁止帳號登入"},isExpiredNever:{eng:"Never expires",cht:"永不過期"},isBlocked:{eng:"Blocked",cht:"帳號是否被封鎖"},isBlockedY:{eng:"Blocked",cht:"帳號已封鎖"},isBlockedN:{eng:"Not blocked",cht:"帳號未封鎖"},userTimeBlocked:{eng:"Blocked time",cht:"帳號封鎖狀態與時間"},isBlockedNormalStatus:{eng:"Normal status",cht:"狀態正常"},isAdmin:{eng:"Administrator",cht:"是否為系統管理者"},userRole:{eng:"Role",cht:"角色"},userRoleAdmin:{eng:"Administrator",cht:"系統管理者"},userRoleGeneral:{eng:"General",cht:"一般使用者"},isActive:{eng:"Active",cht:"帳號是否有效"},isActiveY:{eng:"Active",cht:"帳號有效"},isActiveMsgY:{eng:"Enabling",cht:"啟用中"},isActiveN:{eng:"Inactive",cht:"帳號無效"},isActiveMsgN:{eng:"Deactivated",cht:"已停用"},errInAccounts:{eng:"Account errors",cht:"帳號出現錯誤待修復"},errItemsByRedir:{eng:"Redirect errors",cht:"登入後轉址出現錯誤待修復"},modeEdit:{eng:"Edit mode",cht:"編輯模式"},showTabCols:{eng:"Show columns",cht:"顯示欄位"},selectDate:{eng:"Select date",cht:"請選擇日期"},dtPickerYear:{eng:"y",cht:"年"},dtPickerMonth:{eng:"m",cht:"月"},dtPickerWeekdays:{eng:"Su,Mo,Tu,We,Th,Fr,Sa",cht:"日,一,二,三,四,五,六"},userName:{eng:"Name of user",cht:"使用者名稱"},userAccountEmpty:{eng:"Invalid account of user",cht:"尚未給予有效使用者帳號"},userAccountDuplicate:{eng:"Duplicate account of user",cht:"使用者帳號出現重複"},userEmailEmpty:{eng:"Empty email of user",cht:"尚未給予使用者Email"},userEmailError:{eng:"Invalid email of user",cht:"使用者Email格式錯誤"},userEmailDuplicate:{eng:"Duplicate email of user",cht:"使用者Email出現重複"},userRedirEmpty:{eng:"Invalid redirect of user",cht:"尚未給予有效登入後轉址"},userPasswordEmpty:{eng:"Empty password of user",cht:"尚未給予使用者密碼"},userAddEmpty:{eng:"No user",cht:"尚未新增使用者資料"},userAdd:{eng:"Add user",cht:"新增使用者"},userAddNameNew:{eng:"New user",cht:"新使用者"},userAddIdNew:{eng:"Waiting generation",cht:"待自動給予"},userCopy:{eng:"Copy user",cht:"複製使用者"},userCopyNameNew:{eng:"copy",cht:"複製"},userDeleteCheckUsers:{eng:"Delete user(s)",cht:"刪除勾選使用者"},userResetPassword:{eng:"Reset password",cht:"重設密碼"},userSaveUsersFail:{eng:"Failed to save users",cht:"儲存使用者數據失敗"},userSaveUsersSuccess:{eng:"Save users successfully",cht:"儲存使用者數據成功"},userEditNoUserId:{eng:"Can not find the id of user",cht:"無法找到使用者Id"},userEditNoUserData:{eng:"Can not find the data of user",cht:"無法找到使用者數據"},userPassword_keyInvalidPassword:{eng:"Invalid password",cht:"密碼非有效字串"},userPassword_keyLimNumLenMinOrMax:{eng:"The minimum password length is greater than the maximum length",cht:"設定密碼最小長度大於最大長度"},userPassword_keyLimHasSpace:{eng:"Password must not contain whitespace characters",cht:"密碼不可包含空白字元"},userPassword_keyLimNonAsciiChar:{eng:"Password may only contain ASCII printable characters (letters, digits, symbols)",cht:"密碼僅允許使用英文大小寫、數字及特殊符號"},userPassword_keyLimNumLenMin:{eng:"Password length must be at least {minLength} characters",cht:"密碼長度須大於等於{minLength}個字元"},userPassword_keyLimNumLenMax:{eng:"Password length must not exceed {maxLength} characters",cht:"密碼長度須小於等於{maxLength}個字元"},userPassword_keyLimRequireLetter:{eng:"Password must contain at least one letter",cht:"密碼須包含至少一個英文字母"},userPassword_keyLimRequireUppercase:{eng:"Password must contain at least one uppercase letter",cht:"密碼須包含至少一個大寫英文字母"},userPassword_keyLimRequireLowercase:{eng:"Password must contain at least one lowercase letter",cht:"密碼須包含至少一個小寫英文字母"},userPassword_keyLimRequireDigit:{eng:"Password must contain at least one digit",cht:"密碼須包含至少一個數字"},userPassword_keyLimRequireSpecial:{eng:"Password must contain at least one special character",cht:"密碼須包含至少一個特殊符號"},userPassword_keyLimForbiddenChar:{eng:"Password must not contain forbidden characters",cht:"密碼不可包含禁止字元"},userPassword_keyLimCommonPassword:{eng:"This password is too common and not allowed",cht:"此密碼為常見弱密碼,不允許使用"},userPassword_keyLimConsecutiveCharsFromAccount:{eng:"Password must not contain {consecutiveCharsMinMatch} or more consecutive characters from your account name",cht:"密碼不可包含與帳號相同之{consecutiveCharsMinMatch}個以上連續字元"},userChangePassword:{eng:"Change Password",cht:"變更密碼"},userChangePasswordOldPassword:{eng:"Old password",cht:"舊密碼"},userChangePasswordNewPassword:{eng:"New password",cht:"新密碼"},userChangePasswordConfirmPassword:{eng:"Confirm password",cht:"確認新密碼"},userChangePasswordForNoOldPassword:{eng:"Please enter old password",cht:"尚未給予舊密碼"},userChangePasswordForNoNewPassword:{eng:"Please enter new password",cht:"尚未給予新密碼"},userChangePasswordForNoConfirmPassword:{eng:"Please enter confirm password",cht:"尚未給予確認密碼"},userChangePasswordNotSame:{eng:"New password and confirm password do not match",cht:"新密碼與確認密碼不一致"},userChangePasswordSuccess:{eng:"Password change successful, please log in again.",cht:"密碼變更成功,請使用新密碼重新登入。"},userChangePasswordFail:{eng:"Password change failed.",cht:"密碼變更失敗,請確認輸入密碼是否正確"},userChangePasswordIncorrectOld:{eng:"The old password is incorrect.",cht:"舊密碼不正確。"},userChangePasswordForNetError:{eng:"Password validation failed. Please try again later.",cht:"密碼檢測失敗,請稍後再試"},userRegistration:{eng:"Register",cht:"申請帳號"},userRegistrationName:{eng:"Name",cht:"姓名"},userRegistrationEmail:{eng:"Email",cht:"電子郵件"},userRegistrationConfirmPassword:{eng:"Confirm password",cht:"確認密碼"},userRegistrationSubmit:{eng:"Submit",cht:"送出申請"},userRegistrationSuccess:{eng:"Registration successful. Please check your email to verify your account.",cht:"帳號申請成功,請至信箱收取驗證信以啟用帳號。"},userRegistrationNotAllowed:{eng:"User registration is not available.",cht:"目前不開放使用者自行申請帳號。"},userRegistrationAccountInvalid:{eng:"Please enter a valid account.",cht:"請輸入有效的帳號。"},userRegistrationEmailFormatInvalid:{eng:"Please enter a valid email address.",cht:"請輸入有效的電子郵件格式。"},userRegistrationNameInvalid:{eng:"Please enter a valid name.",cht:"請輸入有效的姓名。"},userRegistrationAccountExists:{eng:"This account already exists.",cht:"此帳號已存在。"},userRegistrationEmailExists:{eng:"This email already exists.",cht:"此電子郵件已存在。"},userRegistrationBackToLogin:{eng:"Back to login",cht:"返回登入"},userRegistrationNotVerified:{eng:"Your account has not been verified. Please check your email and click the verification link.",cht:"您的帳號尚未完成 email 驗證,請至信箱點擊驗證連結。"},userRegistrationResendVerify:{eng:"Resend verification email",cht:"重寄驗證信"},userRegistrationResendSuccess:{eng:"Verification email has been resent. Please check your inbox.",cht:"驗證信已重新寄出,請至信箱收取。"},userRegistrationAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationResendSubmit:{eng:"Send verification email",cht:"寄送驗證信"},userRegistrationResendInvalidEmail:{eng:"The email address does not match the account. Please check and try again.",cht:"電子郵件與帳號不符,請確認後再試。"},userRegistrationResendFailed:{eng:"Failed to send verification email. Please try again later.",cht:"驗證信寄送失敗,請稍後再試。"},userRegistrationResendThrottled:{eng:"A verification email was just sent. Please wait a moment before trying again.",cht:"剛才已寄出驗證信,請稍候片刻再試。"},verifyEmailInvalidToken:{eng:"Invalid or expired verification link.",cht:"驗證連結無效或已失效。"},verifyEmailAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationVerifySuccess:{eng:"Email verified successfully. Please log in.",cht:"電子郵件驗證成功,請登入。"},loginAccountBlocked:{eng:"Your account has been temporarily locked due to multiple failed login attempts. Please try again later.",cht:"您的帳號因多次登入失敗已被暫時鎖定,請稍後再試。"},loginAccountExpired:{eng:"Your account has expired. Please contact the administrator.",cht:"您的帳號已過期,請聯繫管理員。"},loginUnknownError:{eng:"An unexpected error occurred during login. Please try again later.",cht:"登入時發生未預期的錯誤,請稍後再試。"},tokenExpired:{eng:"Your session has expired. Please log in again.",cht:"登入逾時,請重新登入。"},tokenNoPermission:{eng:"Token does not have permission.",cht:"權杖無存取權限。"},invalidUrl:{eng:"Invalid url.",cht:"網址無效。"},invalidTokenSelf:{eng:"Invalid self token.",cht:"自身權杖無效。"},invalidTokenTar:{eng:"Invalid target token.",cht:"目標權杖無效。"},invalidUserIdTar:{eng:"Invalid target user id.",cht:"目標使用者 Id 無效。"},noTokenKeyValueInUrl:{eng:"Missing token={sysToken}, key=token or value={token} in url.",cht:"網址缺少 token={sysToken}、key=token 或 value={token}。"},noTokenKeyUserIdInUrl:{eng:"Missing token={sysToken}, key=id or value={userId} in url.",cht:"網址缺少 token={sysToken}、key=id 或 value={userId}。"},noTokenInUrl:{eng:"Missing token={sysToken} in url.",cht:"網址缺少 token={sysToken}。"},cannotGetUserByUrl:{eng:"Cannot get user by url.",cht:"無法由網址取得使用者。"},cannotGetUsersByUrl:{eng:"Cannot get users by url.",cht:"無法由網址取得使用者清單。"},cannotGetUserDataByUrl:{eng:"Cannot get user data by url.",cht:"無法由網址取得使用者資料。"},cannotGetUsersDataByUrl:{eng:"Cannot get users data by url.",cht:"無法由網址取得使用者清單資料。"},noUserDataByUrl:{eng:"No user data by url.",cht:"該網址無使用者資料。"},noUsersDataByUrl:{eng:"No users data by url.",cht:"該網址無使用者清單資料。"},noUserDataAfterConvert:{eng:"No user data after conversion.",cht:"轉換後無使用者資料。"},invalidRows:{eng:"Invalid data format.",cht:"資料格式錯誤。"},accountRequired:{eng:"Account is required.",cht:"帳號為必填。"},accountDuplicate:{eng:"Account already exists.",cht:"帳號已存在。"},getStaDataFailed:{eng:"Failed to retrieve statistics data.",cht:"統計資料取得失敗。"},token:{eng:"Token",cht:"金鑰"},isApp:{eng:"For app",cht:"是否為應用系統金鑰"},tokenTimeCreate:{eng:"Created time",cht:"金鑰創建時間"},tokenTimeEnd:{eng:"End time",cht:"金鑰到期時間"},tokenTimeUpdate:{eng:"Updated time",cht:"金鑰更新時間"},tokenDeleteCheckTokens:{eng:"Delete checked token(s)",cht:"刪除勾選金鑰"},tokenSaveTokensFail:{eng:"Failed to save tokens",cht:"儲存金鑰數據失敗"},tokenSaveTokensSuccess:{eng:"Save tokens successfully",cht:"儲存金鑰數據成功"},tokenPerms:{eng:"App permissions",cht:"應用系統權限"},tokenPermsBase:{eng:"Basic permission, always granted",cht:"基本權限,恆具備"},tokenPermsHigh:{eng:"Equivalent to administrator",cht:"等同管理者權限"},tokenPermsInvalid:{eng:"Invalid app token permissions.",cht:"應用系統金鑰權限設定無效。"},appPerm_readUsers:{eng:"Read users",cht:"讀使用者"},appPerm_writeUsers:{eng:"Write users",cht:"寫使用者"},appPerm_readTokens:{eng:"Read tokens",cht:"讀金鑰"},appPerm_writeTokens:{eng:"Write tokens",cht:"寫金鑰"},appPerm_readIps:{eng:"Read IPs",cht:"讀IP"},appPerm_writeIps:{eng:"Write IPs",cht:"寫IP"},appPerm_readStats:{eng:"Read statistics",cht:"讀統計"},ip:{eng:"IP",cht:"IP"},ipTimeBlocked:{eng:"Blocked time",cht:"IP封鎖時間"},ipDeleteCheckIps:{eng:"Delete checked IP(s)",cht:"刪除勾選IP"},ipSaveIpsFail:{eng:"Failed to save IPs",cht:"儲存IP數據失敗"},ipSaveIpsSuccess:{eng:"Save IPs successfully",cht:"儲存IP數據成功"},statisticsInformation:{eng:"Statistics Information",cht:"統計資訊"},statisticsInformationDescription:{eng:"Provides an overview of system usage and security metrics.",cht:"提供系統使用情況和安全指標的總覽。"},userGroupInfor:{eng:"User Information",cht:"使用者資訊區"},totalUsers:{eng:"Total Users",cht:"總使用者"},activeUsers:{eng:"Active Users",cht:"活躍使用者"},blockedUsers:{eng:"Blocked Users",cht:"已封鎖使用者"},expiredUsers:{eng:"Expired Users",cht:"已過期使用者"},accessActivityMonitoring:{eng:"Access Activity Monitoring",cht:"存取活動監測"},userLoginFrequency:{eng:"User Login Frequency",cht:"使用者登入頻率"},last7Days:{eng:"Last 7 days",cht:"最近7天"},tokenUsageFrequency:{eng:"Token Usage Frequency",cht:"金鑰使用頻率"},ipConnectionFrequency:{eng:"IP Connection Frequency",cht:"IP 連線頻率"},controlStatus:{eng:"Control Status",cht:"管控狀態"},tokenCharacteristic:{eng:"Token Characteristic",cht:"金鑰狀態"},activeTokens:{eng:"Active Tokens",cht:"有效金鑰數量"},createdLast24h:{eng:"Created in last 24h",cht:"最近24小時內創建"},endingNext24h:{eng:"Ending in next 24h",cht:"未來24小時內到期"},endedTokens:{eng:"Ended Tokens",cht:"已到期金鑰數量"},ipCharacteristic:{eng:"IP Characteristic",cht:"IP狀態"},conn24h:{eng:"Connections in last 24h",cht:"最近24小時內連線數量"},blockedIps:{eng:"Blocked IPs",cht:"當前已封鎖IP數量"},selectItem1hr:{eng:"1 hour",cht:"1小時"},selectItem4hr:{eng:"4 hour",cht:"4小時"},selectItem8hr:{eng:"8 hour",cht:"8小時"},selectItem1day:{eng:"1 day",cht:"1日"},countAttempt:{eng:"Attempt",cht:"嘗試登入"},countSuccess:{eng:"Success",cht:"登入成功"},countError:{eng:"Error",cht:"登入失敗"},count:{eng:"Count",cht:"總次數"},showIndividually:{eng:"Show individually",cht:"個別顯示"},numberOrder:{eng:"No.",cht:"排序"},total:{eng:"Total",cht:"總計"},last1Day:{eng:"Last 1 day",cht:"最近1天"},last8Hour:{eng:"Last 8 hour",cht:"最近8小時"},last4Hour:{eng:"Last 4 hour",cht:"最近4小時"},last1Hour:{eng:"Last 1 hour",cht:"最近1小時"},showMax5:{eng:"Show max 5 rows",cht:"顯示前5筆"},showAll:{eng:"Show all",cht:"顯示全部"},regVerifyEmTitle:{eng:"Please verify your email",cht:"請驗證您的電子郵件"},regVerifyEmContent:{eng:'Dear {name},<br><br>Thank you for registering at {sender}.<br><br>Please click the link below to verify your email and activate your account:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>If you did not register, please ignore this email.<br><br>This is an automated notification. Please do not reply.',cht:'{name} 您好:<br><br>感謝您註冊「{sender}」。<br><br>請點擊以下連結以驗證您的電子郵件並啟用帳號:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>若您未曾進行此操作,請忽略此信。<br><br>此為系統自動通知信件,請勿直接回覆。'},chpwEmTitle:{eng:"Password has been changed",cht:"密碼已進行變更"},chpwEmContent:{eng:"Dear User {name},<br><br>This is to inform you that the password for your {sender} account has been successfully changed.<br><br>If you did not perform this action or have any concerns regarding your account security, please contact the system administrator as soon as possible to ensure the safety of your account.<br><br>This is an automated system notification. Please do not reply to this email.",cht:"使用者 {name} 您好:<br><br>您於「{sender}」的密碼已成功變更。<br><br>若您未曾進行此操作,或對帳號安全有任何疑慮,請您儘速聯絡系統管理單位,以確保帳號安全。<br><br>此為系統自動通知信件,請勿直接回覆。"},resetPwEmTitle:{eng:"Your password has been reset",cht:"您的密碼已被重設"},resetPwEmContent:{eng:"Dear {name},<br><br>The administrator has reset the password for your {sender} account.<br><br>Account: {account}<br>New password: <strong>{newPassword}</strong><br><br>Please log in with this password and immediately set your own new password upon login.<br><br>If you did not expect this change, please contact the administrator.<br><br>This is an automated notification.",cht:"使用者 {name} 您好:<br><br>管理員已重設您於「{sender}」的密碼。<br><br>帳號:{account}<br>新密碼:<strong>{newPassword}</strong><br><br>請以此密碼登入後,立即變更為您自己的新密碼。<br><br>若非您預期之操作,請聯繫管理員。<br><br>此為系統自動通知信件。"},adminResetPasswordConfirm:{eng:"Confirm to reset password for {account}?",cht:"確定對 {account} 重設密碼?"},adminResetPasswordSuccess:{eng:"Password reset and new password sent to {email}",cht:"已重設並寄送新密碼至 {email}"},adminResetPasswordCannotResetSelf:{eng:"Cannot reset your own password via this action",cht:"不可對自己重設密碼"},adminResetPasswordForbidden:{eng:"Forbidden: admin permission required",cht:"權限不足:須具管理員身分"},adminResetPasswordUserNotFound:{eng:"User not found",cht:"查無使用者"},adminResetPasswordFailed:{eng:"Failed to reset password",cht:"重設密碼失敗"},adminResetPasswordAlreadyTriggered:{eng:"A password reset was just triggered. Please wait a moment before trying again.",cht:"剛才已觸發重設密碼,請稍候片刻再試。"},userForceChangePwPrompt:{eng:"Your password has been reset by the administrator. Please change it to your own new password.",cht:"您的密碼已由管理員重設,請按確認後變更為您自己的新密碼。"},cannotDemoteSelf:{eng:"Cannot demote yourself from admin",cht:"不可解除自己的管理員權限"},cannotDisableSelf:{eng:"Cannot disable yourself",cht:"不可停用自己的帳號"},cannotDeleteSelf:{eng:"Admin cannot delete yourself",cht:"管理員不得刪除自己"},saveInProgress:{eng:"The previous save is still in progress. Please do not submit again.",cht:"上一次儲存仍在處理中,請勿重複送出"},saveNewRowExists:{eng:"The newly added data has already been saved. Please reload the page before making changes.",cht:"新增之資料已儲存過,請重新整理頁面後再操作"}},qu=(e={})=>{let t=Ae(e,"kpLangExtEmail");Ai(t)||(t={});let i=Ae(e,"kpLangExt");Ai(i)||(i={});let n=Ae(e,"webName");Ai(n)||(n={});let s=Ae(e,"webDescription");Ai(s)||(s={});let r={};r={...r,...Ju},Ai(t)&&ms(t,(e,t)=>{r[t]={...Ae(r,t,{}),...e}}),Ai(i)&&(r={...r,...i}),Ai(n)&&(r={...r,webName:{...n}}),Ai(s)&&(r={...r,webDescription:{...s}});let o={};return ms(["eng","cht"],e=>{let t={};ms(r,(i,n)=>{t[n]=i[e]}),o[e]=t}),o};function $u(e,t,i={}){let{srLog:n,minForAccountLoginFailed:s,numForAccountLoginFailed:r,minBlockForAccountLoginFailed:o,minForTokenCallApi:a,numForTokenCallApi:c,minBlockForTokenCallApi:l,minForIpCallApi:u,numForIpCallApi:p,minBlockForIpCallApi:d}=i,m={},h=async e=>{if(!Ai(e))return Promise.reject("invalid u");let t=Ae(e,"timeBlocked","");if(Ec(t)){return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},f=async e=>{let i=await t.getGenUserByAccount(e);return await h(i)},g=!1;setInterval(async()=>{if(g)return;g=!0;let e=zn().add(-s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(m,async(t,i)=>{let n=t.filter(t=>t>=e);0===wt(n)?delete m[i]:m[i]=n}).finally(()=>{g=!1})},2e3);let w={},M=async e=>Ae(w,e,[]),y=!1;setInterval(async()=>{if(y)return;y=!0;let i=zn().add(-a,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(w,async(s,r)=>{let o=s.filter(e=>e>=i);w[r]=o,wt(o)>c&&await(async i=>{let s=await t.getTokenByKV("token",i);if("y"===Ae(s,"isApp",""))return void(n&&wn(n.debug)&&n.debug({event:"fun-blockAccountByToken",key:"appTokenSkipRateLimit",token:Yc(i)}));let r=Ae(s,"userId","");if(!Ni(r))return Promise.reject("invalid userId");let o=await t.getGenUserByUserId(r);if(await h(o))return;let a=zn().add(l,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await e.users.save({id:o.id,timeBlocked:a}),await e.tokens.del({id:s.id})})(r).catch(e=>{console.log(e)})}).finally(()=>{y=!1})},2e3);let D={},x=async e=>{if(!Ai(e))return Promise.reject("invalid oip");let t=Ae(e,"timeBlocked","");if(Ec(t)){return zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},L=async e=>Ae(D,e,[]),v=!1;setInterval(async()=>{if(v)return;v=!0;let i=Ot(D),n=await t.getIpsList(),s={};ms(n,e=>{let t=e.ip;s[t]=!0});let r={};ms(i,e=>{r[e]=!0});let o=[];ms(r,(e,t)=>{ps(s,t)||o.push(t)});let a=ks(o,e=>Ic.ips.funNew({ip:e}));await e.ips.insert(a).catch(e=>{console.log(e)}).finally(()=>{v=!1})},2e3);let I=!1;setInterval(async()=>{if(I)return;I=!0;let i=zn().add(-u,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await Zo(D,async(n,s)=>{let r=n.filter(e=>e>=i);D[s]=r,wt(r)>p&&await(async i=>{let n=null,s=()=>zn().add(d,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),r=null;if(await t.getIpByKV("ip",i).then(e=>{r=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?r=null:n=t}),null!==n)return Promise.reject(n);if(null===r){let t=s();return r=Ic.ips.funNew({ip:i,timeBlocked:t}),await e.ips.insert(r).catch(e=>{n=e}),null!==n?Promise.reject(n):void 0}if(await x(r))return;let o=s();await e.ips.save({id:r.id,timeBlocked:o})})(s).catch(e=>{console.log(e)})}).catch(e=>{console.log(e)}).finally(()=>{I=!1})},2e3);let b={loginByAccountAndPassword:async(i,n)=>{let a=!1;try{a=await f(i)}catch(e){return Promise.reject("failedLoginForCatch")}if(a)return Promise.reject("failedLoginForCatch");let c=null;return await t.loginByAccountAndPassword(i,n).then(e=>{c={state:"success",msg:e},m[i]=[]}).catch(async n=>{m[i]||(m[i]=[]),m[i].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"));let a=zn().add(-s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),l=m[i].filter(e=>e>=a);m[i]=l,wt(l)>r&&await(async i=>{let n=await t.getGenUserByAccount(i);if(await h(n))return;let s=zn().add(o,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await e.users.save({id:n.id,timeBlocked:s});let r=await e.tokens.select({userId:n.id});for(let t of r)await e.tokens.del({id:t.id})})(i).catch(e=>{console.log(e)}),c={state:"error",msg:n}}),"success"===c.state?c.msg:Promise.reject(c.msg)},cleanKpAccountLoginFailed:async()=>{m={}},cleanKpIpCallApi:async()=>{D={}},getBlockedByAccount:f,getBlockedByIp:async e=>{let i=null;if(!Ni(e))return Promise.reject("invalid ip");let n=null;return await t.getIpByKV("ip",e).then(e=>{n=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?n=null:i=t}),null!==i?Promise.reject(i):null!==n&&await x(n)},callApiByToken:async e=>{w[e]||(w[e]=[]),w[e].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByTokenCallApi:M,getCountsByTokenCallApi:async e=>wt(await M(e)),getIpByHeaders:e=>{let t=Ae(e,"headers"),i="";if(!Ni(i)){let e=Ae(t,"x-forwarded-for","");i=Ae(Rs(e,","),0,""),i=Qs(i)}return Ni(i)||e&&e.info&&e.info.remoteAddress&&(i=e.info.remoteAddress,i=Qs(i)),Ni(i)||e&&e.socket&&e.socket.remoteAddress&&(i=e.socket.remoteAddress,i=Qs(i)),Ni(i)||e&&e.connection&&e.connection.remoteAddress&&(i=e.connection.remoteAddress,i=Qs(i)),Ni(i)||(console.log("headers(keys)",Object.keys(t||{})),console.log("can not get ip of user")),i},callApiByIp:async e=>{D[e]||(D[e]=[]),D[e].push(zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByIpCallApi:L,getCountsByIpCallApi:async e=>wt(await L(e))};return b}function ep(i,n=1){return function(e,t=1,i={}){let n=1,s=Ae(i,"path"),r=Ae(i,"fs");if(!Cn(e,{fs:r}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&$i(t)&&(t=qi(t))<1&&(t=1),function e(i){let o=[];return Cn(i,{fs:r})?(ms(r.readdirSync(i),function(a){let c=s.resolve(i,a),l=null;try{l=r.statSync(c)}catch(e){}l&&l.isDirectory()?(o.push({isFolder:!0,level:n,path:c,name:s.basename(c)}),n+=1,(n<=t||null===t)&&(o=o.concat(e(c))),n-=1):o.push({isFolder:!1,level:n,path:c,name:s.basename(c)})}),o):o}(e)}(i,n,{path:e,fs:t})}let tp=new Map,ip=new Map;function np(e,i,n){let s=ep(e);s=s.filter(e=>!Ae(e,"isFolder",!1)),s=function(e,t,i){let n=t.format(i);return Ra(e,e=>{let t=Ae(e,"name","").replace(/\.log$/,"");return!/^\d{4}-\d{2}-\d{2}/.test(t)||t>=n.slice(0,t.length)})}(s,i,n);let r=[];for(let e of s)try{let i=t.statSync(e.path);if(!i.isFile())continue;r.push({path:e.path,name:e.name,size:i.size,mtimeMs:i.mtimeMs})}catch(e){}return r}function sp(e){let t=new Map;return i=>{let n=Math.floor(i/6e4),s=t.get(n);return void 0===s&&(s=zn(6e4*n).format(e),t.set(n,s)),s}}async function rp(e,i,n,s=null){wn(s)||(s=sp(n));let r={minTimeMs:null,token:{},ip:{},login:{}};return await function(e,i){return new Promise((n,s)=>{let r=null,o=t.createReadStream(e,{encoding:"utf8"}),a=b.createInterface({input:o,crlfDelay:1/0});a.on("line",i);let c=e=>{r=e,a.close()};o.on("error",c),a.on("error",c),o.on("close",()=>{r?s(r):n()})})}(e,e=>{let t=null;try{t=JSON.parse(e)}catch(e){return}if(null===t||"object"!=typeof t)return;let n=t.event,o=0;if("fun-checkToken"===n?o=1:"verifyConn"===n?o=2:"kpfun-loginByAccountAndPassword-before"===n?o=3:"kpfun-loginByAccountAndPassword-success"===n?o=4:"kpfun-loginByAccountAndPassword-error"===n&&(o=5),0===o)return;let a=function(e){return"number"==typeof e?e:Ni(e)?zn(e).valueOf():NaN}(t.time);if(Number.isNaN(a))return;if((null===r.minTimeMs||a<r.minTimeMs)&&(r.minTimeMs=a),!(a>i))return;let c=s(a);if(1===o){let e=r.token[c];void 0===e&&(e={count:0,kp:{}},r.token[c]=e),e.count+=1;let i=t.userId;e.kp[i]=(e.kp[i]||0)+1}else if(2===o){let e=r.ip[c];void 0===e&&(e={count:0,kp:{}},r.ip[c]=e),e.count+=1;let i=t.ip;e.kp[i]=(e.kp[i]||0)+1}else{let e=r.login[c];void 0===e&&(e={attempt:0,success:0,error:0},r.login[c]=e),3===o?e.attempt+=1:4===o?e.success+=1:e.error+=1}}),r}async function op(e,t,i){let n=sp(i),s=[];for(let r of e)try{let e=await rp(r.path,t,i,n);s.push({name:r.name,ok:!0,agg:e})}catch(e){s.push({name:r.name,ok:!1,err:String(Ae(e,"message",e))})}return s}function ap(e,t){for(let i in t.token){let n=t.token[i],s=e.token[i];void 0===s&&(s={count:0,kp:{}},e.token[i]=s),s.count+=n.count;for(let e in n.kp)s.kp[e]=(s.kp[e]||0)+n.kp[e]}for(let i in t.ip){let n=t.ip[i],s=e.ip[i];void 0===s&&(s={count:0,kp:{}},e.ip[i]=s),s.count+=n.count;for(let e in n.kp)s.kp[e]=(s.kp[e]||0)+n.kp[e]}for(let i in t.login){let n=t.login[i],s=e.login[i];void 0===s&&(s={attempt:0,success:0,error:0},e.login[i]=s),s.attempt+=n.attempt,s.success+=n.success,s.error+=n.error}return e}async function cp(t,i={}){let n=!1!==Ae(i,"useCache"),s=Ae(i,"scanFiles");wn(s)||(s=op);let r=Ae(i,"srLog",null),o=np(t.fdLog,t.tStart,t.fmt),a=function(e){let t=tp.get(e);return t||(t=new Map,tp.set(e,t)),t}((c=t.fdLog,l=t.fmt,`${e.resolve(c)}|${l}`));var c,l;let u=[],p={};for(let e of o){let i=n?a.get(e.name):void 0;void 0!==i&&i.size===e.size&&i.mtimeMs===e.mtimeMs&&(null===i.minTimeMs||i.minTimeMs>i.scanTStartMs&&i.minTimeMs>t.tStartMs)?p[e.name]=i.agg:u.push(e)}if(n){let e=new Set(o.map(e=>e.name));for(let t of a.keys())e.has(t)||a.delete(t)}let d=[];if(u.length>0){let e=await s(u.map(e=>({path:e.path,name:e.name})),t.tStartMs,t.fmt),i={};for(let t of e)i[t.name]=t;for(let e of u){let s=i[e.name];if(s&&s.ok)p[e.name]=s.agg,n&&a.set(e.name,{size:e.size,mtimeMs:e.mtimeMs,minTimeMs:s.agg.minTimeMs,scanTStartMs:t.tStartMs,agg:s.agg});else{let t=Ae(s,"err","no result");d.push({name:e.name,err:t}),n&&a.delete(e.name),r&&wn(r.warn)&&r.warn({event:"fun-staLogs",key:"staLogsFileSkipped",name:e.name,err:t})}}}let m={token:{},ip:{},login:{}};for(let e of o){let t=p[e.name];t&&ap(m,t)}let h=function(e,t){let i=(e,i,n)=>{let s={};for(let i of t)s[i]=e();for(let e in i)s[e]=n(i[e]);return Object.keys(s).sort().map(e=>({time:e,data:s[e]}))};return{token:i(()=>({count:0}),e.token,e=>({count:e.count,...e.kp})),ip:i(()=>({count:0}),e.ip,e=>({count:e.count,...e.kp})),login:i(()=>({attempt:0,success:0,error:0}),e.login,e=>({attempt:e.attempt,success:e.success,error:e.error}))}}(m,t.kpTime);return h.stat={nFiles:o.length,nScanned:u.length,nCached:o.length-u.length,errors:d},h}function lp(t=7,i="hr",n={}){let s=function(e=7,t="hr",i={}){let n=Ae(i,"fdLog");Ni(n)||(n="./logs");let s=function(e){return"day"===e?"day":"hr"}(t),r="day"===s?"YYYY-MM-DD":"YYYY-MM-DDTHH",o="day"===s?"day":"hour",a=Ae(i,"timeNow"),c="number"==typeof a?zn(a):zn(),l=c.subtract(e,"day"),u=l.valueOf(),p=l.startOf(o),d=c.startOf(o),m=[];for(;!p.isAfter(d);)m.push(p.format(r)),p=p.add(1,o);return{fdLog:n,timeInterval:s,fmt:r,unit:o,tStart:l,tStartMs:u,kpTime:m,timeNow:c.valueOf()}}(t,i,n),r=JSON.stringify([e.resolve(s.fdLog),t,s.timeInterval,Ae(n,"timeNow",null)]);if(ip.has(r))return ip.get(r);let o=cp(s,n).finally(()=>{ip.delete(r)});return ip.set(r,o),o}let up=a.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(up).href:"undefined"==typeof document?location.href:C&&"SCRIPT"===C.tagName.toUpperCase()&&C.src||new URL("w-web-sso.umd.js",document.baseURI).href),pp=e.dirname(up),dp=e.resolve(pp,"staLogsCore.shellWorker.mjs");async function mp(e,t,i){return 0===e.length?[]:function(e,t=dp){let i=Ln(),n=new o.Worker(t),s=!1,r=(e,t)=>{s||(s=!0,e(t));try{n.terminate()}catch(e){}};return n.on("message",e=>{"done"===e.mode?r(i.resolve,e.payload):"error"===e.mode&&r(i.reject,e.payload)}),n.on("error",e=>{r(i.reject,e)}),n.on("exit",e=>{r(i.reject,new Error(`staLogs worker exited without result, code=${e}`))}),n.postMessage(e),i}({files:e,tStartMs:t,fmt:i})}function hp(e=7,t="hr",i={}){return lp(e,t,{...i,scanFiles:mp})}function fp(e,t,i={}){let{srLog:n,logFd:s}=i,r=async()=>{let e=await t.getUsersListCache(),i=wt(e),n=0;n=wt(Ra(e,e=>Sc(e)));let s=0;s=wt(Ra(e,e=>Ac(e)));let r=0;r=wt(Ra(e,e=>Tc(e)));return{total:i,active:n,blocked:s,expired:r}},o=async()=>{let e=zn().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),n=zn().add(24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),s=await t.getTokensListCache(),r=wt(s),o=0;{let t=Ra(s,t=>t.timeCreate>=e);o=wt(t)}let a=0;{let e=Ra(s,e=>e.timeEnd>=i&&e.timeEnd<=n);a=wt(e)}let c=0;{let e=Ra(s,e=>function(e){let t=Ae(e,"timeEnd","");return!!Ec(t)&&zn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>t}(e));c=wt(e)}return{active:r-c,created24h:o,ending24h:a,ended:c}},a=async()=>{let e=zn().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=await t.getIpsListCache(),n=0;{let t=Ra(await g(),t=>zn(t.time,"YYYY-MM-DDTHH").format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=e);r="data.count",n=(s=t)&&s.length?function(e,t){for(var i,n=-1,s=e.length;++n<s;){var r=t(e[n]);void 0!==r&&(i=void 0===i?r:i+r)}return i}(s,Ci(r)):0}var s,r;let o=0;o=wt(Ra(i,e=>Ac(e)));return{conn24h:n,blocked:o}},c=async()=>{let e=await async function(e=7,t="hr",i={}){return(await hp(e,t,i)).login}(7,"hr",{fdLog:s,srLog:n});return e},l=Yu(),u=async()=>await l.getProxy("fun",{fun:c,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaUserAccountLogin",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),p=async()=>{let e=await async function(e=7,t="hr",i={}){return(await hp(e,t,i)).token}(7,"hr",{fdLog:s,srLog:n}),i={};ms(e,e=>{ms(e.data,(e,t)=>{if("count"===t)return!0;i[t]=0})});let r=await t.getUsersListCache(),o={count:0};return ms(r,e=>{o[e.id]=e.name}),e=ks(e,e=>{let t=vo(i);var n,s,r;return ms(e.data,(e,i)=>{t[i]=e}),n=t,r={},s=Ci(s=(e,t)=>"count"===t?t:Ae(o,t,t)),_t(n,function(e,t,i){Er(r,s(e,t,i),e)}),t=r,{time:e.time,data:{count:e.count,...t}}}),e},d=Yu(),m=async()=>await d.getProxy("fun",{fun:p,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaToken",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),h=async()=>{let e=await async function(e=7,t="hr",i={}){return(await hp(e,t,i)).ip}(7,"hr",{fdLog:s,srLog:n}),t={};return ms(e,e=>{ms(e.data,(e,i)=>{if("count"===i)return!0;t[i]=0})}),e=ks(e,e=>{let i=vo(t);return ms(e.data,(e,t)=>{i[t]=e}),{time:e.time,data:{count:e.count,...i}}}),e},f=Yu(),g=async()=>await f.getProxy("fun",{fun:h,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaIp",key:"getStaDataFailed",err:String(Ae(e,"message",e))}),Promise.reject("getStaDataFailed"))),w={getStaUserSummary:r,checkTokenAndGetStaUserSummary:async(e,i={})=>(await t.checkToken(e,i),await r()),getStaTokenSummary:o,checkTokenAndGetStaTokenSummary:async(e,i={})=>(await t.checkToken(e,i),await o()),getStaIpSummary:a,checkTokenAndGetStaIpSummary:async(e,i={})=>(await t.checkToken(e,i),await a()),getStaUserAccountLogin:u,checkTokenAndGetStaUserAccountLogin:async(e,i={})=>(await t.checkToken(e,i),await u()),getStaToken:m,checkTokenAndGetStaToken:async(e,i={})=>(await t.checkToken(e,i),await m()),getStaIp:g,checkTokenAndGetStaIp:async(e,i={})=>(await t.checkToken(e,i),await g())};return w}var gp={exports:{}};!function(e){e.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),i=e(function(e){var t=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)});i.version;var n=function(e){return"object"==typeof e?null!==e:"function"==typeof e},s=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e},r=function(e){try{return!!e()}catch(e){return!0}},o=!r(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a=t.document,c=n(a)&&n(a.createElement),l=function(e){return c?a.createElement(e):{}},u=!o&&!r(function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!n(e))return e;var i,s;if(t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;if("function"==typeof(i=e.valueOf)&&!n(s=i.call(e)))return s;if(!t&&"function"==typeof(i=e.toString)&&!n(s=i.call(e)))return s;throw TypeError("Can't convert object to primitive value")},d=Object.defineProperty,m={f:o?Object.defineProperty:function(e,t,i){if(s(e),t=p(t,!0),s(i),u)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},h=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f=o?function(e,t,i){return m.f(e,t,h(1,i))}:function(e,t,i){return e[t]=i,e},g={}.hasOwnProperty,w=function(e,t){return g.call(e,t)},M=0,y=Math.random(),D=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++M+y).toString(36))},x=e(function(e){var n="__core-js_shared__",s=t[n]||(t[n]={});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),L=x("native-function-to-string",Function.toString),v=e(function(e){var n=D("src"),s="toString",r=(""+L).split(s);i.inspectSource=function(e){return L.call(e)},(e.exports=function(e,i,s,o){var a="function"==typeof s;a&&(w(s,"name")||f(s,"name",i)),e[i]!==s&&(a&&(w(s,n)||f(s,n,e[i]?""+e[i]:r.join(String(i)))),e===t?e[i]=s:o?e[i]?e[i]=s:f(e,i,s):(delete e[i],f(e,i,s)))})(Function.prototype,s,function(){return"function"==typeof this&&this[n]||L.call(this)})}),I=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},b=function(e,t,i){if(I(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,s){return e.call(t,i,n,s)}}return function(){return e.apply(t,arguments)}},C="prototype",E=function(e,n,s){var r,o,a,c,l=e&E.F,u=e&E.G,p=e&E.S,d=e&E.P,m=e&E.B,h=u?t:p?t[n]||(t[n]={}):(t[n]||{})[C],g=u?i:i[n]||(i[n]={}),w=g[C]||(g[C]={});for(r in u&&(s=n),s)a=((o=!l&&h&&void 0!==h[r])?h:s)[r],c=m&&o?b(a,t):d&&"function"==typeof a?b(Function.call,a):a,h&&v(h,r,a,e&E.U),g[r]!=a&&f(g,r,c),d&&w[r]!=a&&(w[r]=a)};t.core=i,E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128;var T,A=E,S=Math.ceil,N=Math.floor,k=function(e){return isNaN(e=+e)?0:(e>0?N:S)(e)},j=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Z=(T=!1,function(e,t){var i,n,s=String(j(e)),r=k(t),o=s.length;return r<0||r>=o?T?"":void 0:(i=s.charCodeAt(r))<55296||i>56319||r+1===o||(n=s.charCodeAt(r+1))<56320||n>57343?T?s.charAt(r):i:T?s.slice(r,r+2):n-56320+(i-55296<<10)+65536});A(A.P,"String",{codePointAt:function(e){return Z(this,e)}}),i.String.codePointAt;var z=Math.max,Y=Math.min,X=function(e,t){return(e=k(e))<0?z(e+t,0):Y(e,t)},F=String.fromCharCode,U=String.fromCodePoint;A(A.S+A.F*(!!U&&1!=U.length),"String",{fromCodePoint:function(e){for(var t,i=arguments,n=[],s=arguments.length,r=0;s>r;){if(t=+i[r++],X(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?F(t):F(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}}),i.String.fromCodePoint;var G,P,K,O,_,W,H,B,V,Q,R,J,q,$,ee={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA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-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\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\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-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-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},te={isSpaceSeparator:function(e){return"string"==typeof e&&ee.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||ee.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||ee.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}},ie=function(e,t){G=String(e),P="start",K=[],O=0,_=1,W=0,H=void 0,B=void 0,V=void 0;do{H=se(),me[P]()}while("eof"!==H.type);return"function"==typeof t?ne({"":V},"",t):V};function ne(e,t,i){var n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(var s=0;s<n.length;s++){var r=String(s),o=ne(n,r,i);void 0===o?delete n[r]:Object.defineProperty(n,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var a in n){var c=ne(n,a,i);void 0===c?delete n[a]:Object.defineProperty(n,a,{value:c,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}function se(){for(Q="default",R="",J=!1,q=1;;){$=re();var e=ae[Q]();if(e)return e}}function re(){if(G[O])return String.fromCodePoint(G.codePointAt(O))}function oe(){var e=re();return"\n"===e?(_++,W=0):e?W+=e.length:W++,e&&(O+=e.length),e}var ae={default:function(){switch($){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void oe();case"/":return oe(),void(Q="comment");case void 0:return oe(),ce("eof")}if(!te.isSpaceSeparator($))return ae[P]();oe()},comment:function(){switch($){case"*":return oe(),void(Q="multiLineComment");case"/":return oe(),void(Q="singleLineComment")}throw ge(oe())},multiLineComment:function(){switch($){case"*":return oe(),void(Q="multiLineCommentAsterisk");case void 0:throw ge(oe())}oe()},multiLineCommentAsterisk:function(){switch($){case"*":return void oe();case"/":return oe(),void(Q="default");case void 0:throw ge(oe())}oe(),Q="multiLineComment"},singleLineComment:function(){switch($){case"\n":case"\r":case"\u2028":case"\u2029":return oe(),void(Q="default");case void 0:return oe(),ce("eof")}oe()},value:function(){switch($){case"{":case"[":return ce("punctuator",oe());case"n":return oe(),le("ull"),ce("null",null);case"t":return oe(),le("rue"),ce("boolean",!0);case"f":return oe(),le("alse"),ce("boolean",!1);case"-":case"+":return"-"===oe()&&(q=-1),void(Q="sign");case".":return R=oe(),void(Q="decimalPointLeading");case"0":return R=oe(),void(Q="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return R=oe(),void(Q="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",1/0);case"N":return oe(),le("aN"),ce("numeric",NaN);case'"':case"'":return J='"'===oe(),R="",void(Q="string")}throw ge(oe())},identifierNameStartEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":break;default:if(!te.isIdStartChar(e))throw Me()}R+=e,Q="identifierName"},identifierName:function(){switch($){case"$":case"_":case"":case"":return void(R+=oe());case"\\":return oe(),void(Q="identifierNameEscape")}if(!te.isIdContinueChar($))return ce("identifier",R);R+=oe()},identifierNameEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":case"":case"":break;default:if(!te.isIdContinueChar(e))throw Me()}R+=e,Q="identifierName"},sign:function(){switch($){case".":return R=oe(),void(Q="decimalPointLeading");case"0":return R=oe(),void(Q="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return R=oe(),void(Q="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",q*(1/0));case"N":return oe(),le("aN"),ce("numeric",NaN)}throw ge(oe())},zero:function(){switch($){case".":return R+=oe(),void(Q="decimalPoint");case"e":case"E":return R+=oe(),void(Q="decimalExponent");case"x":case"X":return R+=oe(),void(Q="hexadecimal")}return ce("numeric",0*q)},decimalInteger:function(){switch($){case".":return R+=oe(),void(Q="decimalPoint");case"e":case"E":return R+=oe(),void(Q="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},decimalPointLeading:function(){if(te.isDigit($))return R+=oe(),void(Q="decimalFraction");throw ge(oe())},decimalPoint:function(){switch($){case"e":case"E":return R+=oe(),void(Q="decimalExponent")}return te.isDigit($)?(R+=oe(),void(Q="decimalFraction")):ce("numeric",q*Number(R))},decimalFraction:function(){switch($){case"e":case"E":return R+=oe(),void(Q="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},decimalExponent:function(){switch($){case"+":case"-":return R+=oe(),void(Q="decimalExponentSign")}if(te.isDigit($))return R+=oe(),void(Q="decimalExponentInteger");throw ge(oe())},decimalExponentSign:function(){if(te.isDigit($))return R+=oe(),void(Q="decimalExponentInteger");throw ge(oe())},decimalExponentInteger:function(){if(!te.isDigit($))return ce("numeric",q*Number(R));R+=oe()},hexadecimal:function(){if(te.isHexDigit($))return R+=oe(),void(Q="hexadecimalInteger");throw ge(oe())},hexadecimalInteger:function(){if(!te.isHexDigit($))return ce("numeric",q*Number(R));R+=oe()},string:function(){switch($){case"\\":return oe(),void(R+=ue());case'"':return J?(oe(),ce("string",R)):void(R+=oe());case"'":return J?void(R+=oe()):(oe(),ce("string",R));case"\n":case"\r":throw ge(oe());case"\u2028":case"\u2029":ye($);break;case void 0:throw ge(oe())}R+=oe()},start:function(){switch($){case"{":case"[":return ce("punctuator",oe())}Q="value"},beforePropertyName:function(){switch($){case"$":case"_":return R=oe(),void(Q="identifierName");case"\\":return oe(),void(Q="identifierNameStartEscape");case"}":return ce("punctuator",oe());case'"':case"'":return J='"'===oe(),void(Q="string")}if(te.isIdStartChar($))return R+=oe(),void(Q="identifierName");throw ge(oe())},afterPropertyName:function(){if(":"===$)return ce("punctuator",oe());throw ge(oe())},beforePropertyValue:function(){Q="value"},afterPropertyValue:function(){switch($){case",":case"}":return ce("punctuator",oe())}throw ge(oe())},beforeArrayValue:function(){if("]"===$)return ce("punctuator",oe());Q="value"},afterArrayValue:function(){switch($){case",":case"]":return ce("punctuator",oe())}throw ge(oe())},end:function(){throw ge(oe())}};function ce(e,t){return{type:e,value:t,line:_,column:W}}function le(e){for(var t=0,i=e;t<i.length;t+=1){var n=i[t];if(re()!==n)throw ge(oe());oe()}}function ue(){switch(re()){case"b":return oe(),"\b";case"f":return oe(),"\f";case"n":return oe(),"\n";case"r":return oe(),"\r";case"t":return oe(),"\t";case"v":return oe(),"\v";case"0":if(oe(),te.isDigit(re()))throw ge(oe());return"\0";case"x":return oe(),pe();case"u":return oe(),de();case"\n":case"\u2028":case"\u2029":return oe(),"";case"\r":return oe(),"\n"===re()&&oe(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw ge(oe())}return oe()}function pe(){var e="",t=re();if(!te.isHexDigit(t))throw ge(oe());if(e+=oe(),t=re(),!te.isHexDigit(t))throw ge(oe());return e+=oe(),String.fromCodePoint(parseInt(e,16))}function de(){for(var e="",t=4;t-- >0;){var i=re();if(!te.isHexDigit(i))throw ge(oe());e+=oe()}return String.fromCodePoint(parseInt(e,16))}var me={start:function(){if("eof"===H.type)throw we();he()},beforePropertyName:function(){switch(H.type){case"identifier":case"string":return B=H.value,void(P="afterPropertyName");case"punctuator":return void fe();case"eof":throw we()}},afterPropertyName:function(){if("eof"===H.type)throw we();P="beforePropertyValue"},beforePropertyValue:function(){if("eof"===H.type)throw we();he()},beforeArrayValue:function(){if("eof"===H.type)throw we();"punctuator"!==H.type||"]"!==H.value?he():fe()},afterPropertyValue:function(){if("eof"===H.type)throw we();switch(H.value){case",":return void(P="beforePropertyName");case"}":fe()}},afterArrayValue:function(){if("eof"===H.type)throw we();switch(H.value){case",":return void(P="beforeArrayValue");case"]":fe()}},end:function(){}};function he(){var e;switch(H.type){case"punctuator":switch(H.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=H.value}if(void 0===V)V=e;else{var t=K[K.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,B,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)K.push(e),P=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var i=K[K.length-1];P=null==i?"end":Array.isArray(i)?"afterArrayValue":"afterPropertyValue"}}function fe(){K.pop();var e=K[K.length-1];P=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function ge(e){return xe(void 0===e?"JSON5: invalid end of input at "+_+":"+W:"JSON5: invalid character '"+De(e)+"' at "+_+":"+W)}function we(){return xe("JSON5: invalid end of input at "+_+":"+W)}function Me(){return xe("JSON5: invalid identifier character at "+_+":"+(W-=5))}function ye(e){console.warn("JSON5: '"+De(e)+"' in strings is not valid ECMAScript; consider escaping")}function De(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var i=e.charCodeAt(0).toString(16);return"\\x"+("00"+i).substring(i.length)}return e}function xe(e){var t=new SyntaxError(e);return t.lineNumber=_,t.columnNumber=W,t}var Le=function(e,t,i){var n,s,r,o=[],a="",c="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,r=t.quote,t=t.replacer),"function"==typeof t)s=t;else if(Array.isArray(t)){n=[];for(var l=0,u=t;l<u.length;l+=1){var p=u[l],d=void 0;"string"==typeof p?d=p:("number"==typeof p||p instanceof String||p instanceof Number)&&(d=String(p)),void 0!==d&&n.indexOf(d)<0&&n.push(d)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):"string"==typeof i&&(c=i.substr(0,10)),m("",{"":e});function m(e,t){var i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),s&&(i=s.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?h(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?w(i):f(i):void 0}function h(e){for(var t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},n="",s=0;s<e.length;s++){var o=e[s];switch(o){case"'":case'"':t[o]++,n+=o;continue;case"\0":if(te.isDigit(e[s+1])){n+="\\x00";continue}}if(i[o])n+=i[o];else if(o<" "){var a=o.charCodeAt(0).toString(16);n+="\\x"+("00"+a).substring(a.length)}else n+=o}var c=r||Object.keys(t).reduce(function(e,i){return t[e]<t[i]?e:i});return c+(n=n.replace(new RegExp(c,"g"),i[c]))+c}function f(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,s,r=[],l=0,u=n||Object.keys(e);l<u.length;l+=1){var p=u[l],d=m(p,e);if(void 0!==d){var h=g(p)+":";""!==c&&(h+=" "),h+=d,r.push(h)}}if(0===r.length)i="{}";else if(""===c)i="{"+(s=r.join(","))+"}";else{var f=",\n"+a;s=r.join(f),i="{\n"+a+s+",\n"+t+"}"}return o.pop(),a=t,i}function g(e){if(0===e.length)return h(e);var t=String.fromCodePoint(e.codePointAt(0));if(!te.isIdStartChar(t))return h(e);for(var i=t.length;i<e.length;i++)if(!te.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return h(e);return e}function w(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,n=[],s=0;s<e.length;s++){var r=m(String(s),e);n.push(void 0!==r?r:"null")}if(0===n.length)i="[]";else if(""===c)i="["+n.join(",")+"]";else{var l=",\n"+a,u=n.join(l);i="[\n"+a+u+",\n"+t+"]"}return o.pop(),a=t,i}},ve={parse:ie,stringify:Le},Ie=ve,be=Ie;return be}()}(gp);var wp=kn(gp.exports);let Mp=e.resolve(),yp=e.resolve(Mp,"settings.json"),Dp=e=>{yp=e},xp=()=>{let e=t.readFileSync(yp,"utf8");return wp.parse(e)},Lp={minLength:8,maxLength:16,requireLetter:!0,requireUppercase:!1,requireLowercase:!1,requireDigit:!0,requireSpecial:!0,noSpace:!0,onlyAscii:!0,forbiddenChars:["\\"],noConsecutiveCharsFromAccount:!0,consecutiveCharsMinMatch:2,commonPasswordBlacklist:["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"]};return function(i,n,s,r,o={}){let a=null;if(!wn(i))throw console.log("invalid WOrm",i),new Error("invalid WOrm");if(!Ni(n))throw console.log("invalid url",n),new Error("invalid url");if(!Ni(s))throw console.log("invalid db",s),new Error("invalid db");An(r)||(r="./settings.json"),Dp(r);let c=xp();Ai(o)&&(c={...c,...o});let l=Ae(c,"serverPort");$i(l)||(l=11007),l=qi(l);let u=zc(c),p=(e,t)=>{console.log(`[${e.toUpperCase()}] ${t}`),u[e]({event:"boot",msg:t})},d=Ae(c,"useCheckUser",!1),m=Ae(c,"getUserById",null),h=Ae(c,"useExcludeWhenNotAdmin",!1),f=Ae(c,"webName",{}),g=Ae(c,"webDescription",{}),w=Ae(c,"webLogo",""),M=Ae(c,"webBackgoundGradientColors",[]);on(M)||(M=["#FFE0B2","#FFCC80","#FFF59D","#F2D6A2","#F0CC88"]);let y=Ae(c,"webKey",""),D=Ae(c,"salt","");Ni(process.env.SALT)&&(D=process.env.SALT);let x=Ae(c,"minExpired","");an(x)||(x=30);let L=Ae(c,"minForAccountLoginFailed","");an(L)||(L=10);let v=Ae(c,"numForAccountLoginFailed","");an(v)||(v=3);let I=Ae(c,"minBlockForAccountLoginFailed","");an(I)||(I=30);let b=Ae(c,"minForTokenCallApi","");an(b)||(b=10);let C=Ae(c,"numForTokenCallApi","");an(C)||(C=1e3);let T=Ae(c,"minBlockForTokenCallApi","");an(T)||(T=30);let A=Ae(c,"minForIpCallApi","");an(A)||(A=10);let S=Ae(c,"numForIpCallApi","");an(S)||(S=1e4);let N=Ae(c,"minBlockForIpCallApi","");an(N)||(N=30);let k=Ae(c,"cleanKpIpCallApiForIps",[]);on(k)||(k=["127.0.0.1","::1","::ffff:127.0.0.1"]);let j=Ae(c,"cleanKpIpCallApiForToken",""),Z=Ae(c,"cleanKpAccountLoginFailedForIps",[]);on(Z)||(Z=["127.0.0.1","::1","::ffff:127.0.0.1"]);let z=Ae(c,"cleanKpAccountLoginFailedForToken",""),Y=!0===Ae(c,"allowUserRegistration",!1),X=Ae(c,"siteUrl","");Ni(X)||(X="");let F=Ae(c,"passwordPolicy");Ai(F)?F={...Lp,...F}:(F=Lp,p("info","settings 未提供 passwordPolicy, 採用程式內建預設密碼政策"));let U=Ae(F,"minLength");if(!$i(U)||qi(U)<1)throw new Error("invalid passwordPolicy.minLength: must be a positive integer >= 1");let G=Ae(F,"maxLength");if(!$i(G)||qi(G)<qi(U))throw new Error("invalid passwordPolicy.maxLength: must be a positive integer >= minLength");if(!Oi(Ae(F,"requireLetter")))throw new Error("invalid passwordPolicy.requireLetter: must be a boolean");if(!Oi(Ae(F,"requireUppercase")))throw new Error("invalid passwordPolicy.requireUppercase: must be a boolean");if(!Oi(Ae(F,"requireLowercase")))throw new Error("invalid passwordPolicy.requireLowercase: must be a boolean");if(!Oi(Ae(F,"requireDigit")))throw new Error("invalid passwordPolicy.requireDigit: must be a boolean");if(!Oi(Ae(F,"requireSpecial")))throw new Error("invalid passwordPolicy.requireSpecial: must be a boolean");if(!Oi(Ae(F,"noSpace")))throw new Error("invalid passwordPolicy.noSpace: must be a boolean");if(!Oi(Ae(F,"onlyAscii")))throw new Error("invalid passwordPolicy.onlyAscii: must be a boolean");let P=Ae(F,"forbiddenChars");if(!en(P))throw new Error("invalid passwordPolicy.forbiddenChars: must be an array");for(let e=0;e<wt(P);e++)if(!Si(P[e])||1!==wt(P[e]))throw new Error(`invalid passwordPolicy.forbiddenChars[${e}]: each element must be a single character string`);let K=Ae(F,"noConsecutiveCharsFromAccount");if(!Oi(K))throw new Error("invalid passwordPolicy.noConsecutiveCharsFromAccount: must be a boolean");if(K){let e=Ae(F,"consecutiveCharsMinMatch");if(!$i(e)||qi(e)<2)throw new Error("invalid passwordPolicy.consecutiveCharsMinMatch: must be a positive integer >= 2")}let O=Ae(F,"commonPasswordBlacklist");if(!en(O))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: must be an array");if(!function(e,t,i){var n=E(e)?Mt:Bt;return i&&Ei(e,t,i)&&(t=void 0),n(e,Ci(t))}(O,e=>Si(e)))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: each element must be a string");let _=Ae(c,"userLogo",""),W=Ae(c,"subfolder","");Ni(W)&&("/"===Dn(W,1)&&(W=xn(W,1)),"/"!==yn(W,1)&&(W=`/${W}`));let H=Ae(c,"showLanguage","n"),B=Ae(c,"language","eng"),V=Ae(c,"showModeEditUsers","n"),Q=Ae(c,"modeEditUsers","n"),R=Ae(c,"showModeEditTokens","n"),J=Ae(c,"modeEditTokens","n"),q=Ae(c,"showModeEditIps","n"),$=Ae(c,"modeEditIps","n");Ae(c,"mappingBy","");let ee=Ae(c,"kpLangExt",{}),te=(e=>{let t=Ae(e,"emSrcEmail","");if(!Ni(t))throw new Error(`invalid srcEmail[${t}]`);let i=Ae(e,"emSrcPW","");if(!Ni(i))throw new Error(`invalid srcPW[${i}]`);let n=Ae(e,"emSrcHost","");if(!Ni(n))throw new Error(`invalid srcHost[${n}]`);let s=Ae(e,"emSrcPort","");if(!$i(s))throw new Error(`invalid srcPort[${s}]`);return{send:async(e,r,o,a)=>{if(!Ni(e))return Promise.reject(`invalid srcName[${e}]`);if(!Ni(r))return Promise.reject(`invalid emTitle[${r}]`);if(!Ni(o))return Promise.reject(`invalid emContent[${o}]`);if(Ni(a)&&(a=[a]),!on(a))return Promise.reject(`invalid toEmails[${a}]`);let c={srcName:e,srcEmail:t,srcPW:i,srcHost:n,srcPort:s,emTitle:r,emContent:o,toEmails:a};return await new ku(c)}}})(c),ie=(i,n="")=>{if(!Ni(i))return i;let s=e.resolve(i);return An(s)?t.readFileSync(s,"utf8"):((/^(\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/])/.test(i)||/\.(html|txt)$/i.test(i))&&p("warn",`settings.${n} 疑似檔案路徑但檔案不存在(${s}), 將原樣視為文字`),i)},ne={},se=["chpwEmTitle","chpwEmContent","regVerifyEmTitle","regVerifyEmContent","resetPwEmTitle","resetPwEmContent","userRegistrationVerifySuccess","verifyEmailAlreadyVerified","verifyEmailInvalidToken"];se.forEach(e=>{let t=(e=>{let t=Ae(c,e);if(!Ai(t))return{};let i={};return Object.keys(t).forEach(n=>{i[n]=ie(t[n],`${e}.${n}`)}),i})(e);wt(t)>0&&(ne[e]=t)});let re=qu({kpLangExtEmail:ne,kpLangExt:ee,webName:f,webDescription:g}),oe={};Object.keys(re).forEach(e=>{let t={...re[e]};se.forEach(e=>{delete t[e]}),oe[e]=t});let ae={useCheckUser:d,getUserById:m,useExcludeWhenNotAdmin:h},ce={};try{ce=lc(Ic,i,n,s,ae)}catch(e){throw console.log("WServOrm init failed",e),e}let{woItems:le,procOrm:ue}=ce,pe=Ae(c,"verifyBaseUrl","");Ni(pe)||(pe=`http://localhost:${l}`,Y&&p("warn",`settings 未提供 verifyBaseUrl, 註冊驗證信連結將採 ${pe}, 非本機部署時收信人將無法完成驗證, 請於 settings 提供對外可連之後端 base URL`));let de="./server/template",me="./node_modules/w-web-sso/server/template";En(me)&&(de=me);let he=Ae(c,"pathTemplate","");Ni(he)&&En(he)||(Ni(he)&&p("warn",`settings.pathTemplate 指定之資料夾不存在(${he}), 改採套件內建模板`),he=de);let fe=ie(Ae(c,"verifyEmailResultContent",""),"verifyEmailResultContent");if(!Ni(fe)){let i=e.resolve(he,"verifyEmailResult.html");An(i)||(i=e.resolve(de,"verifyEmailResult.html")),fe=t.readFileSync(i,"utf8")}let ge=Ru(le,ue,{srLog:u,srEmail:te,salt:D,minExpired:x,kpLang:re,passwordPolicy:F,allowUserRegistration:Y,siteUrl:X,verifyBaseUrl:pe}),we=$u(le,ge,{srLog:u,minForAccountLoginFailed:L,numForAccountLoginFailed:v,minBlockForAccountLoginFailed:I,minForTokenCallApi:b,numForTokenCallApi:C,minBlockForTokenCallApi:T,minForIpCallApi:A,numForIpCallApi:S,minBlockForIpCallApi:N}),Me=Ae(c,"logFd",""),ye=fp(0,ge,{srLog:u,logFd:Me}),De=(...e)=>e.every(e=>Ni(e)),xe=(e,t)=>Nc(t),Le="dist",ve="./node_modules/w-web-sso/dist";En(ve)&&(Le=ve);let Ie="index.html";try{let i=e.resolve(Le,"index.tmp");if(An(i)||(i=e.resolve(Le,Ie)),!An(i))throw console.log("fpEntryIn",i),new Error("invalid fpEntryIn");let n=e.resolve(Le,Ie),s=t.readFileSync(i,"utf8");s=Sn(s,"/msso/","{sfd}/"),s=Sn(s,"{sfd}",W),s=Sn(s,"{language}",B),t.writeFileSync(n,s,"utf8")}catch(e){console.log(e),console.log(`can not generate ${Ie}`)}let be=[{method:"GET",path:"/api/cleanKpIpCallApi",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");if(!Ni(j))return Promise.reject("invalid cleanKpIpCallApiForToken");if(t!==j)return Promise.reject("cleanKpIpCallApi invalid token");let i=Ae(e,"info.remoteAddress","");return Ni(i)||(i=Ae(e,"socket.remoteAddress","")),Ni(i)||(i=Ae(e,"connection.remoteAddress","")),k.includes(i)?(u.info({event:"api/cleanKpIpCallApi",realIp:i}),await we.cleanKpIpCallApi(),!0):Promise.reject(`cleanKpIpCallApi only allowed from cleanKpIpCallApiForIps, got realIp[${i}]`)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/cleanKpAccountLoginFailed",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");if(!Ni(z))return Promise.reject("invalid cleanKpAccountLoginFailedForToken");if(t!==z)return Promise.reject("cleanKpAccountLoginFailed invalid token");let i=Ae(e,"info.remoteAddress","");return Ni(i)||(i=Ae(e,"socket.remoteAddress","")),Ni(i)||(i=Ae(e,"connection.remoteAddress","")),Z.includes(i)?(u.info({event:"api/cleanKpAccountLoginFailed",realIp:i}),await we.cleanKpAccountLoginFailed(),!0):Promise.reject(`cleanKpAccountLoginFailed only allowed from cleanKpAccountLoginFailedForIps, got realIp[${i}]`)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutSsoUser",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/logoutSsoUser",token:Yc(t)}),await ge.logoutByToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/checkToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/checkToken",token:Yc(t)}),we.callApiByToken(t),await ge.checkToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/refreshToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/refreshToken",token:Yc(t)}),we.callApiByToken(t),await ge.refreshToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutByToken",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/logoutByToken",token:Yc(t)}),we.callApiByToken(t),await ge.logoutByToken(t)})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUsersList",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");u.info({event:"api/getSsoUsersList",token:Yc(t)}),we.callApiByToken(t);let i=await ge.checkTokenAndGetUsersList(t,{fun:xe,perm:"readUsers"});return i=i.map(ge.omitUserCredential),i})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUserInfor",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token",""),i=Ae(e,"query.key",""),n=Ae(e,"query.value","");if(!De(t,i,n))return Promise.reject("tokenExpired");let s=Fc(i,n);u.info({event:"api/getSsoUserInfor",token:Yc(t),key:i,value:s}),we.callApiByToken(t);let r=null;return r="token"===i?await ge.checkTokenAndGetUserByToken(t,n,{fun:xe,perm:"readUsers"}):await ge.checkTokenAndGetUserInfor(t,i,n,{fun:xe,perm:"readUsers"}),Ai(r)?r:(console.log("token does not have permission"),Promise.reject("tokenNoPermission"))})();return gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/verifyEmail",handler:async function(e,t){let i=await In(async function(){let t=Ae(e,"query.token","");return u.info({event:"api/verifyEmail",token:Yc(t)}),await ge.verifyEmail(t)})();gn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg});let n,s=Ae(e,"query.lang","");"eng"!==s&&"cht"!==s&&(s="eng"),n="success"===i.state?"userRegistrationVerifySuccess":i.msg&&"string"==typeof i.msg?i.msg:"verifyEmailInvalidToken";let r=Ae(re,`${s}.webName`,""),o=Ae(re,`${s}.${n}`,n),a=fe;return a=Sn(a,"{title}",r),a=Sn(a,"{message}",o),t.response(a).type("text/html; charset=utf-8")}}],Ce={port:c.serverPort,pathStaticFiles:Le,apiName:"api",apis:be,tokenType:"Bearer",verifyConn:async({apiType:e,authorization:t,query:i,headers:n,req:s})=>{let r=we.getIpByHeaders(s),o=Ae(n,"origin",""),a=Zc(Ae(n,"referer",""));u.info({event:"verifyConn",ip:r,origin:o,referer:a}),we.callApiByIp(r);let c=!0;return await we.getBlockedByIp(r).then(e=>{c=e}).catch(()=>{c=!0}),c=!c,c||console.log(`block ip[${r}]`),c},getUserIdByToken:async e=>"",corsOrigins:["*"],useDbOrm:!1,tableNamesExec:[],methodsExec:[],tableNamesSync:[],kpFunExt:{getWebInfor:async e=>({webLogo:w,webBackgoundGradientColors:M,webKey:y,userLogo:_,showLanguage:H,language:B,kpLang:oe,showModeEditUsers:V,modeEditUsers:Q,showModeEditTokens:R,modeEditTokens:J,showModeEditIps:q,modeEditIps:$,allowUserRegistration:Y,passwordPolicyInfo:{minLength:F.minLength,maxLength:F.maxLength,requireLetter:F.requireLetter,requireUppercase:F.requireUppercase,requireLowercase:F.requireLowercase,requireDigit:F.requireDigit,requireSpecial:F.requireSpecial,consecutiveCharsMinMatch:F.consecutiveCharsMinMatch}}),checkToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-checkToken",token:Yc(t)}),await ge.checkToken(t)},refreshToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-refreshToken",token:Yc(t)}),await ge.refreshToken(t)},loginByAccountAndPassword:async(e,t,i,n)=>{if(!De(i,n))return Promise.reject("failedLoginForCatch");u.info({event:"kpfun-loginByAccountAndPassword-before",account:i});let s=null,r="";return await we.loginByAccountAndPassword(i,n).then(e=>{s=e}).catch(e=>{r=e}),Ai(s)?u.info({event:"kpfun-loginByAccountAndPassword-success",account:i}):u.info({event:"kpfun-loginByAccountAndPassword-error",account:i,msg:r}),Ai(s)?s:Promise.reject(r)},logoutByToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-logoutByToken",token:Yc(t)}),await ge.logoutByToken(t)},createUser:async(e,t,i,n,s,r,o)=>{u.info({event:"kpfun-createUser",lang:t,account:i});let a={lang:t,account:i,password:n,confirmPassword:s,name:r,email:o};return await ge.createUser(t,a)},verifyEmail:async(e,t)=>(u.info({event:"kpfun-verifyEmail",token:Yc(t)}),await ge.verifyEmail(t)),resendVerifyEmail:async(e,t,i,n)=>(u.info({event:"kpfun-resendVerifyEmail",lang:t,account:i}),await ge.resendVerifyEmail(t,i,n)),getUserByToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUserByToken",token:Yc(t)}),await ge.checkTokenAndGetUserByToken(t,t)},getUserInfor:async(e,t,i,n)=>{if(!De(t,i,n))return Promise.reject("tokenExpired");let s=Fc(i,n);return u.info({event:"kpfun-getUserInfor",token:Yc(t),key:i,value:s}),await ge.checkTokenAndGetUserInfor(t,i,n,{fun:xe,perm:"readUsers"})},checkUserPassword:async(e,t,i)=>(u.info({event:"kpfun-checkUserPassword",lang:t}),await ge.checkUserPassword(t,i)),changeUserPassword:async(e,t,i,n,s)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-changeUserPassword",token:Yc(t),lang:i}),await ge.checkTokenAndChangePassword(t,i,n,s)},adminResetUserPassword:async(e,t,i,n)=>{if(!De(t,n))return Promise.reject("tokenExpired");return u.info({event:"kpfun-adminResetUserPassword",token:Yc(t),lang:i,targetUserId:n}),await ge.adminResetUserPassword(t,i,n)},getUsersList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUsersList",token:Yc(t)}),await ge.checkTokenAndGetUsersList(t,{fun:xe,perm:"readUsers"})},updateUsersList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateUsersList",token:Yc(t),lang:i}),await ge.checkTokenAndUpdateUsersList(t,i,n,{fun:xe,perm:"writeUsers"})},getTokensList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getTokensList",token:Yc(t)}),await ge.checkTokenAndGetTokensList(t,{fun:xe,perm:"readTokens"})},updateTokensList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateTokensList",token:Yc(t),lang:i}),await ge.checkTokenAndUpdateTokensList(t,n,{fun:xe,perm:"writeTokens"})},getIpsList:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getIpsList",token:Yc(t)}),await ge.checkTokenAndGetIpsList(t,{fun:xe,perm:"readIps"})},updateIpsList:async(e,t,i,n)=>{if(!De(t))return Promise.reject("tokenExpired");if(!on(n)||!n.every(e=>Ni(Ae(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateIpsList",token:Yc(t),lang:i}),await ge.checkTokenAndUpdateIpsList(t,n,{fun:xe,perm:"writeIps"})},getStaUserSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserSummary",token:Yc(t)}),await ye.checkTokenAndGetStaUserSummary(t,{fun:xe,perm:"readStats"})},getStaTokenSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaTokenSummary",token:Yc(t)}),await ye.checkTokenAndGetStaTokenSummary(t,{fun:xe,perm:"readStats"})},getStaIpSummary:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIpSummary",token:Yc(t)}),await ye.checkTokenAndGetStaIpSummary(t,{fun:xe,perm:"readStats"})},getStaUserAccountLogin:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserAccountLogin",token:Yc(t)}),await ye.checkTokenAndGetStaUserAccountLogin(t,{fun:xe,perm:"readStats"})},getStaToken:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaToken",token:Yc(t)}),await ye.checkTokenAndGetStaToken(t,{fun:xe,perm:"readStats"})},getStaIp:async(e,t)=>{if(!De(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIp",token:Yc(t)}),await ye.checkTokenAndGetStaIp(t,{fun:xe,perm:"readStats"})}},fpTableTags:"tableTags-web-sso.json"};return Ce.kpFunExt=Object.fromEntries(Object.entries(Ce.kpFunExt).map(([e,t])=>[e,async(...i)=>{try{return await t(...i)}catch(t){throw u.error({event:"kpfun-error",fun:e,key:Ni(t)?t:gn(t)?t.message:String(t)}),t}}])),a=new jo(Ce),a}});
|
|
14
14
|
//# sourceMappingURL=w-web-sso.umd.js.map
|