@activepieces/piece-smtp 0.4.2 → 0.4.3

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/src/index.js CHANGED
@@ -1,103 +1,62 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.smtp = exports.smtpAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const shared_1 = require("@activepieces/shared");
7
- const send_email_1 = require("./lib/actions/send-email");
8
- const common_1 = require("./lib/common");
9
- const SMTPPorts = [25, 465, 587, 2525];
10
- exports.smtpAuth = pieces_framework_1.PieceAuth.CustomAuth({
11
- required: true,
12
- props: {
13
- host: pieces_framework_1.Property.ShortText({
14
- displayName: 'Host',
15
- required: true,
16
- }),
17
- email: pieces_framework_1.Property.ShortText({
18
- displayName: 'Email',
19
- description: 'Leave blank if your mail relay does not require authentication.',
20
- required: false,
21
- }),
22
- password: pieces_framework_1.PieceAuth.SecretText({
23
- displayName: 'Password',
24
- description: 'Leave blank if your mail relay does not require authentication.',
25
- required: false,
26
- }),
27
- port: pieces_framework_1.Property.StaticDropdown({
28
- displayName: 'Port',
29
- required: true,
30
- options: {
31
- disabled: false,
32
- options: SMTPPorts.map((port) => {
33
- return {
34
- label: port.toString(),
35
- value: port,
36
- };
37
- }),
38
- },
39
- }),
40
- TLS: pieces_framework_1.Property.Checkbox({
41
- displayName: 'Require TLS?',
42
- defaultValue: false,
43
- required: true,
44
- }),
45
- },
46
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
47
- try {
48
- const transporter = common_1.smtpCommon.createSMTPTransport(auth);
49
- return new Promise((resolve, reject) => {
50
- transporter.verify(function (error, success) {
51
- if (error) {
52
- resolve({ valid: false, error: JSON.stringify(error) });
53
- }
54
- else {
55
- resolve({ valid: true });
56
- }
57
- });
58
- });
59
- }
60
- catch (e) {
61
- const castedError = e;
62
- const code = castedError === null || castedError === void 0 ? void 0 : castedError['code'];
63
- switch (code) {
64
- case 'EDNS':
65
- return {
66
- valid: false,
67
- error: 'SMTP server not found or unreachable with error code: EDNS',
68
- };
69
- case 'CONN':
70
- return {
71
- valid: false,
72
- error: 'SMTP server connection failed with error code: CONN',
73
- };
74
- default:
75
- break;
76
- }
77
- return {
78
- valid: false,
79
- error: JSON.stringify(e),
80
- };
81
- }
82
- }),
83
- });
84
- exports.smtp = (0, pieces_framework_1.createPiece)({
85
- displayName: 'SMTP',
86
- description: 'Send emails using Simple Mail Transfer Protocol',
87
- minimumSupportedRelease: '0.30.0',
88
- logoUrl: 'https://cdn.activepieces.com/pieces/new-core/smtp.svg',
89
- categories: [shared_1.PieceCategory.CORE],
90
- authors: [
91
- 'tahboubali',
92
- 'abaza738',
93
- 'kishanprmr',
94
- 'MoShizzle',
95
- 'khaledmashaly',
96
- 'abuaboud',
97
- 'pfernandez98'
98
- ],
99
- auth: exports.smtpAuth,
100
- actions: [send_email_1.sendEmail],
101
- triggers: [],
102
- });
103
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Vs=Object.create;var Be=Object.defineProperty;var qs=Object.getOwnPropertyDescriptor;var Gs=Object.getOwnPropertyNames;var Ws=Object.getPrototypeOf,Ks=Object.prototype.hasOwnProperty;var l=(r,e)=>Be(r,"name",{value:e,configurable:!0});var R=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},In=(r,e)=>{for(var t in e)Be(r,t,{get:e[t],enumerable:!0})},wn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Gs(e))!Ks.call(r,i)&&i!==t&&Be(r,i,{get:()=>e[i],enumerable:!(n=qs(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Vs(Ws(r)):{},wn(e||!r||!r.__esModule?Be(t,"default",{value:r,enumerable:!0}):t,r)),Js=r=>wn(Be({},"__esModule",{value:!0}),r);var Xi=R((Ji,Ut)=>{(function(r){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",t={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),o="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",s={zoneIndex:new RegExp(o,"i"),native:new RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${o})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${e}\\.${e}\\.${e}\\.${e}(${o})?$`,"i")};function c(d,h){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let y=0,v=-1,b=(d.match(s.zoneIndex)||[])[0],E,j;for(b&&(b=b.substring(1),d=d.replace(/%.+$/,""));(v=d.indexOf(":",v+1))>=0;)y++;if(d.substr(0,2)==="::"&&y--,d.substr(-2,2)==="::"&&y--,y>h)return null;for(j=h-y,E=":";j--;)E+="0:";return d=d.replace("::",E),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),h=(function(){let Tn=d.split(":"),Sn=[];for(let Wt=0;Wt<Tn.length;Wt++)Sn.push(parseInt(Tn[Wt],16));return Sn})(),{parts:h,zoneId:b}}l(c,"expandIPv6");function p(d,h,y,v){if(d.length!==h.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let b=0,E;for(;v>0;){if(E=y-v,E<0&&(E=0),d[b]>>E!==h[b]>>E)return!1;v-=y,b+=1}return!0}l(p,"matchCIDR");function f(d){if(i.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}l(f,"parseIntAuto");function x(d,h){for(;d.length<h;)d=`0${d}`;return d}l(x,"padPart");let m={};m.IPv4=(function(){function d(h){if(h.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,v;for(y=0;y<h.length;y++)if(v=h[y],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=h}return l(d,"IPv4"),d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(h,y){let v;if(y===void 0&&(v=h,h=v[0],y=v[1]),h.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,h.octets,8,y)},d.prototype.prefixLengthFromSubnetMask=function(){let h=0,y=!1,v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},b,E,j;for(b=3;b>=0;b-=1)if(E=this.octets[b],E in v){if(j=v[E],y&&j!==0)return null;j!==8&&(y=!0),h+=j}else return null;return 32-h},d.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return m.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d})(),m.IPv4.broadcastAddressFromCIDR=function(d){try{let h=this.parseCIDR(d),y=h[0].toByteArray(),v=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),b=[],E=0;for(;E<4;)b.push(parseInt(y[E],10)|parseInt(v[E],10)^255),E++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.isIPv4=function(d){return this.parser(d)!==null},m.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},m.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},m.IPv4.isValidFourPartDecimal=function(d){return!!(m.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},m.IPv4.isValidCIDRFourPartDecimal=function(d){let h=d.match(/^(.+)\/(\d+)$/);return!m.IPv4.isValidCIDR(d)||!h?!1:m.IPv4.isValidFourPartDecimal(h[1])},m.IPv4.networkAddressFromCIDR=function(d){let h,y,v,b,E;try{for(h=this.parseCIDR(d),v=h[0].toByteArray(),E=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),b=[],y=0;y<4;)b.push(parseInt(v[y],10)&parseInt(E[y],10)),y++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.parse=function(d){let h=this.parser(d);if(h===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(h)},m.IPv4.parseCIDR=function(d){let h;if(h=d.match(/^(.+)\/(\d+)$/)){let y=parseInt(h[2]);if(y>=0&&y<=32){let v=[this.parse(h[1]),y];return Object.defineProperty(v,"toString",{value:l(function(){return this.join("/")},"value")}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},m.IPv4.parser=function(d){let h,y,v;if(h=d.match(t.fourOctet))return(function(){let b=h.slice(1,6),E=[];for(let j=0;j<b.length;j++)y=b[j],E.push(f(y));return E})();if(h=d.match(t.longValue)){if(v=f(h[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return(function(){let b=[],E;for(E=0;E<=24;E+=8)b.push(v>>E&255);return b})().reverse()}else return(h=d.match(t.twoOctet))?(function(){let b=h.slice(1,4),E=[];if(v=f(b[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return E.push(f(b[0])),E.push(v>>16&255),E.push(v>>8&255),E.push(v&255),E})():(h=d.match(t.threeOctet))?(function(){let b=h.slice(1,5),E=[];if(v=f(b[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return E.push(f(b[0])),E.push(f(b[1])),E.push(v>>8&255),E.push(v&255),E})():null},m.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");let h=[0,0,0,0],y=0,v=Math.floor(d/8);for(;y<v;)h[y]=255,y++;return v<4&&(h[v]=Math.pow(2,d%8)-1<<8-d%8),new this(h)},m.IPv6=(function(){function d(h,y){let v,b;if(h.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(h[v]<<8|h[v+1]);else if(h.length===8)this.parts=h;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(b=this.parts[v],!(0<=b&&b<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return l(d,"IPv6"),d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(h,y){let v;if(y===void 0&&(v=h,h=v[0],y=v[1]),h.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,h.parts,16,y)},d.prototype.prefixLengthFromSubnetMask=function(){let h=0,y=!1,v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},b,E;for(let j=7;j>=0;j-=1)if(b=this.parts[j],b in v){if(E=v[b],y&&E!==0)return null;E!==16&&(y=!0),h+=E}else return null;return 128-h},d.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let h,y=[],v=this.parts;for(let b=0;b<v.length;b++)h=v[b],y.push(h>>8),y.push(h&255);return y},d.prototype.toFixedLengthString=function(){let h=(function(){let v=[];for(let b=0;b<this.parts.length;b++)v.push(x(this.parts[b].toString(16),4));return v}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),h+y},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let h=this.parts.slice(-2),y=h[0],v=h[1];return new m.IPv4([y>>8,y&255,v>>8,v&255])},d.prototype.toNormalizedString=function(){let h=(function(){let v=[];for(let b=0;b<this.parts.length;b++)v.push(this.parts[b].toString(16));return v}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),h+y},d.prototype.toRFC5952String=function(){let h=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),v=0,b=-1,E;for(;E=h.exec(y);)E[0].length>b&&(v=E.index,b=E[0].length);return b<0?y:`${y.substring(0,v)}::${y.substring(v+b)}`},d.prototype.toString=function(){return this.toRFC5952String()},d})(),m.IPv6.broadcastAddressFromCIDR=function(d){try{let h=this.parseCIDR(d),y=h[0].toByteArray(),v=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),b=[],E=0;for(;E<16;)b.push(parseInt(y[E],10)|parseInt(v[E],10)^255),E++;return new this(b)}catch(h){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${h})`)}},m.IPv6.isIPv6=function(d){return this.parser(d)!==null},m.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{let h=this.parser(d);return new this(h.parts,h.zoneId),!0}catch{return!1}},m.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},m.IPv6.networkAddressFromCIDR=function(d){let h,y,v,b,E;try{for(h=this.parseCIDR(d),v=h[0].toByteArray(),E=this.subnetMaskFromPrefixLength(h[1]).toByteArray(),b=[],y=0;y<16;)b.push(parseInt(v[y],10)&parseInt(E[y],10)),y++;return new this(b)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},m.IPv6.parse=function(d){let h=this.parser(d);if(h.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(h.parts,h.zoneId)},m.IPv6.parseCIDR=function(d){let h,y,v;if((y=d.match(/^(.+)\/(\d+)$/))&&(h=parseInt(y[2]),h>=0&&h<=128))return v=[this.parse(y[1]),h],Object.defineProperty(v,"toString",{value:l(function(){return this.join("/")},"value")}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},m.IPv6.parser=function(d){let h,y,v,b,E,j;if(v=d.match(s.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(s.native.test(d))return c(d,8);if((v=d.match(s.transitional))&&(j=v[6]||"",h=v[1],v[1].endsWith("::")||(h=h.slice(0,-1)),h=c(h+j,6),h.parts)){for(E=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],y=0;y<E.length;y++)if(b=E[y],!(0<=b&&b<=255))return null;return h.parts.push(E[0]<<8|E[1]),h.parts.push(E[2]<<8|E[3]),{parts:h.parts,zoneId:h.zoneId}}return null},m.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");let h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,v=Math.floor(d/8);for(;y<v;)h[y]=255,y++;return v<16&&(h[v]=Math.pow(2,d%8)-1<<8-d%8),new this(h)},m.fromByteArray=function(d){let h=d.length;if(h===4)return new m.IPv4(d);if(h===16)return new m.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},m.isValid=function(d){return m.IPv6.isValid(d)||m.IPv4.isValid(d)},m.isValidCIDR=function(d){return m.IPv6.isValidCIDR(d)||m.IPv4.isValidCIDR(d)},m.parse=function(d){if(m.IPv6.isValid(d))return m.IPv6.parse(d);if(m.IPv4.isValid(d))return m.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},m.parseCIDR=function(d){try{return m.IPv6.parseCIDR(d)}catch{try{return m.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},m.process=function(d){let h=this.parse(d);return h.kind()==="ipv6"&&h.isIPv4MappedAddress()?h.toIPv4Address():h},m.subnetMatch=function(d,h,y){let v,b,E,j;y==null&&(y="unicast");for(b in h)if(Object.prototype.hasOwnProperty.call(h,b)){for(E=h[b],E[0]&&!(E[0]instanceof Array)&&(E=[E]),v=0;v<E.length;v++)if(j=E[v],d.kind()===j[0].kind()&&d.match.apply(d,j))return b}return y},typeof Ut<"u"&&Ut.exports?Ut.exports=m:r.ipaddr=m})(Ji)});var qo=R((sA,Vo)=>{"use strict";var Zo=require("url"),Ho=1800,kr=class{static{l(this,"Cookies")}constructor(e){this.options=e||{},this.cookies=[]}set(e,t){let n=Zo.parse(t||""),i=this.parse(e),o;return i.domain?(o=i.domain.replace(/^\./,""),(n.hostname.length<o.length||("."+n.hostname).substr(-o.length+1)!=="."+o)&&(i.domain=n.hostname)):i.domain=n.hostname,i.path||(i.path=this.getPath(n.pathname)),i.expires||(i.expires=new Date(Date.now()+(Number(this.options.sessionTimeout||Ho)||Ho)*1e3)),this.add(i)}get(e){return this.list(e).map(t=>t.name+"="+t.value).join("; ")}list(e){let t=[];for(let n=this.cookies.length-1;n>=0;n--){let i=this.cookies[n];if(this.isExpired(i)){this.cookies.splice(n,1);continue}this.match(i,e)&&t.unshift(i)}return t}parse(e){let t={};return(e||"").toString().split(";").forEach(n=>{let i=n.split("="),o=i.shift().trim().toLowerCase(),a=i.join("=").trim(),s;if(o)switch(o){case"expires":a=new Date(a),a.toString()!=="Invalid Date"&&(t.expires=a);break;case"path":t.path=a;break;case"domain":s=a.toLowerCase(),s.length&&s.charAt(0)!=="."&&(s="."+s),t.domain=s;break;case"max-age":t.expires=new Date(Date.now()+(Number(a)||0)*1e3);break;case"secure":t.secure=!0;break;case"httponly":t.httponly=!0;break;default:t.name||(t.name=o,t.value=a)}}),t}match(e,t){let n=Zo.parse(t||"");return!(n.hostname!==e.domain&&(e.domain.charAt(0)!=="."||("."+n.hostname).substr(-e.domain.length)!==e.domain)||this.getPath(n.pathname).substr(0,e.path.length)!==e.path||e.secure&&n.protocol!=="https:")}add(e){if(!e||!e.name)return!1;for(let t=0,n=this.cookies.length;t<n;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){let t=(e||"/").split("/");return t.pop(),t=t.join("/").trim(),t.charAt(0)!=="/"&&(t="/"+t),t.substr(-1)!=="/"&&(t+="/"),t}};Vo.exports=kr});var re=R((pA,xl)=>{xl.exports={name:"nodemailer",version:"8.0.5",description:"Easy as cake e-mail sending from your Node.js applications",main:"lib/nodemailer.js",scripts:{test:"node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js","test:coverage":"c8 node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js",format:'prettier --write "**/*.{js,json,md}"',"format:check":'prettier --check "**/*.{js,json,md}"',lint:"eslint .","lint:fix":"eslint . --fix",update:"rm -rf node_modules/ package-lock.json && ncu -u && npm install","test:syntax":'docker run --rm -v "$PWD:/app:ro" -w /app node:6-alpine node test/syntax-compat.js'},repository:{type:"git",url:"https://github.com/nodemailer/nodemailer.git"},keywords:["Nodemailer"],author:"Andris Reinman",license:"MIT-0",bugs:{url:"https://github.com/nodemailer/nodemailer/issues"},homepage:"https://nodemailer.com/",devDependencies:{"@aws-sdk/client-sesv2":"3.1025.0",bunyan:"1.8.15",c8:"11.0.0",eslint:"10.2.0","eslint-config-prettier":"10.1.8",globals:"17.4.0",libbase64:"1.3.0",libmime:"5.3.7",libqp:"2.1.1","nodemailer-ntlm-auth":"1.0.4",prettier:"3.8.1",proxy:"1.0.2","proxy-test-server":"1.0.0","smtp-server":"3.18.3"},engines:{node:">=6.0.0"}}});var ne=R((lA,Or)=>{"use strict";var Go={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)",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"};Or.exports={ERROR_CODES:Go};for(let r of Object.keys(Go))Or.exports[r]=r});var pt=R((uA,Cr)=>{"use strict";var vl=require("http"),yl=require("https"),Wo=require("url"),_l=require("zlib"),{PassThrough:bl}=require("stream"),Ko=qo(),El=re(),Pl=require("net"),se=ne(),Tl=5;Cr.exports=function(r,e){return Jo(r,e)};Cr.exports.Cookies=Ko;function Jo(r,e){e=e||{},e.fetchRes=e.fetchRes||new bl,e.cookies=e.cookies||new Ko,e.redirects=e.redirects||0,e.maxRedirects=isNaN(e.maxRedirects)?Tl:e.maxRedirects,e.cookie&&([].concat(e.cookie||[]).forEach(m=>{e.cookies.set(m,r)}),e.cookie=!1);let t=e.fetchRes,n=Wo.parse(r),i=(e.method||"").toString().trim().toUpperCase()||"GET",o=!1,a,s,c=n.protocol==="https:"?yl:vl,p={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+El.version};if(Object.keys(e.headers||{}).forEach(m=>{p[m.toLowerCase().trim()]=e.headers[m]}),e.userAgent&&(p["user-agent"]=e.userAgent),n.auth&&(p.Authorization="Basic "+Buffer.from(n.auth).toString("base64")),(a=e.cookies.get(r))&&(p.cookie=a),e.body){if(e.contentType!==!1&&(p["Content-Type"]=e.contentType||"application/x-www-form-urlencoded"),typeof e.body.pipe=="function")p["Transfer-Encoding"]="chunked",s=e.body,s.on("error",m=>{o||(o=!0,m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m))});else{if(e.body instanceof Buffer)s=e.body;else if(typeof e.body=="object")try{s=Buffer.from(Object.keys(e.body).map(m=>{let d=e.body[m].toString().trim();return encodeURIComponent(m)+"="+encodeURIComponent(d)}).join("&"))}catch(m){if(o)return;o=!0,m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m);return}else s=Buffer.from(e.body.toString().trim());p["Content-Type"]=e.contentType||"application/x-www-form-urlencoded",p["Content-Length"]=s.length}i=(e.method||"").toString().trim().toUpperCase()||"POST"}let f,x={method:i,host:n.hostname,path:n.path,port:n.port?n.port:n.protocol==="https:"?443:80,headers:p,rejectUnauthorized:!1,agent:!1};e.tls&&Object.assign(x,e.tls),n.protocol==="https:"&&n.hostname&&n.hostname!==x.host&&!Pl.isIP(n.hostname)&&!x.servername&&(x.servername=n.hostname);try{f=c.request(x)}catch(m){return o=!0,setImmediate(()=>{m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m)}),t}return e.timeout&&f.setTimeout(e.timeout,()=>{if(o)return;o=!0,f.abort();let m=new Error("Request Timeout");m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m)}),f.on("error",m=>{o||(o=!0,m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m))}),f.on("response",m=>{let d;if(!o){switch(m.headers["content-encoding"]){case"gzip":case"deflate":d=_l.createUnzip();break}if(m.headers["set-cookie"]&&[].concat(m.headers["set-cookie"]||[]).forEach(h=>{e.cookies.set(h,r)}),[301,302,303,307,308].includes(m.statusCode)&&m.headers.location){if(e.redirects++,e.redirects>e.maxRedirects){o=!0;let h=new Error("Maximum redirect count exceeded");h.code=se.EFETCH,h.sourceUrl=r,t.emit("error",h),f.abort();return}return e.method="GET",e.body=!1,Jo(Wo.resolve(r,m.headers.location),e)}if(t.statusCode=m.statusCode,t.headers=m.headers,m.statusCode>=300&&!e.allowErrorResponse){o=!0;let h=new Error("Invalid status code "+m.statusCode);h.code=se.EFETCH,h.sourceUrl=r,t.emit("error",h),f.abort();return}m.on("error",h=>{o||(o=!0,h.code=se.EFETCH,h.sourceUrl=r,t.emit("error",h),f.abort())}),d?(m.pipe(d).pipe(t),d.on("error",h=>{o||(o=!0,h.code=se.EFETCH,h.sourceUrl=r,t.emit("error",h),f.abort())})):m.pipe(t)}}),setImmediate(()=>{if(s)try{if(typeof s.pipe=="function")return s.pipe(f);f.write(s)}catch(m){o=!0,m.code=se.EFETCH,m.sourceUrl=r,t.emit("error",m);return}f.end()}),t}l(Jo,"nmfetch")});var K=R((mA,G)=>{"use strict";var Sl=require("url"),Il=require("util"),wl=require("fs"),Al=pt(),ce=require("dns"),zl=require("net"),$l=require("os"),lt=300*1e3,kl=30*1e3,Xo=1e3,Lt=0;G.exports._lastCacheCleanup=()=>Lt;G.exports._resetCacheCleanup=()=>{Lt=0};var Qo;try{Qo=$l.networkInterfaces()}catch{}G.exports.networkInterfaces=Qo;var ea=l((r,e)=>{let t=G.exports.networkInterfaces;return t?Object.keys(t).map(n=>t[n]).reduce((n,i)=>n.concat(i),[]).filter(n=>!n.internal||e).some(n=>n.family==="IPv"+r||n.family===r):!0},"isFamilySupported"),Yo=l((r,e,t,n)=>{if(t=t||{},!ea(r,t.allowInternalNetworkInterfaces))return n(null,[]);(ce.Resolver?new ce.Resolver(t):ce)["resolve"+r](e,(o,a)=>{if(o){switch(o.code){case ce.NODATA:case ce.NOTFOUND:case ce.NOTIMP:case ce.SERVFAIL:case ce.CONNREFUSED:case ce.REFUSED:case"EAI_AGAIN":return n(null,[])}return n(o)}return n(null,Array.isArray(a)?a:[].concat(a||[]))})},"resolve"),ee=G.exports.dnsCache=new Map,Te=l((r,e)=>{if(!r)return Object.assign({},e||{});let t=r.addresses||[],n=t.length>0?t[Math.floor(Math.random()*t.length)]:null;return Object.assign({servername:r.servername,host:n,_addresses:t},e||{})},"formatDNSValue");G.exports.resolveHostname=(r,e)=>{if(r=r||{},!r.host&&r.servername&&(r.host=r.servername),!r.host||zl.isIP(r.host)){let s={addresses:[r.host],servername:r.servername||!1};return e(null,Te(s,{cached:!1}))}let t;if(ee.has(r.host)){t=ee.get(r.host);let s=Date.now();if(s-Lt>kl){Lt=s;for(let[c,p]of ee.entries())p.expires&&p.expires<s&&ee.delete(c);if(ee.size>Xo){let c=Math.floor(Xo*.1);Array.from(ee.keys()).slice(0,c).forEach(f=>ee.delete(f))}}if(!t.expires||t.expires>=s)return e(null,Te(t.value,{cached:!0}))}let n=[],i=[],o=null,a=null;Yo(4,r.host,r,(s,c)=>{s?o=s:n=c||[],Yo(6,r.host,r,(p,f)=>{p?a=p:i=f||[];let x=n.concat(i);if(x.length){let m={addresses:x,servername:r.servername||r.host};return ee.set(r.host,{value:m,expires:Date.now()+(r.dnsTtl||lt)}),e(null,Te(m,{cached:!1}))}if(o&&a&&t)return ee.set(r.host,{value:t.value,expires:Date.now()+(r.dnsTtl||lt)}),e(null,Te(t.value,{cached:!0,error:o}));try{ce.lookup(r.host,{all:!0},(m,d)=>{if(m)return t?(ee.set(r.host,{value:t.value,expires:Date.now()+(r.dnsTtl||lt)}),e(null,Te(t.value,{cached:!0,error:m}))):e(m);let h=d?d.filter(v=>ea(v.family)).map(v=>v.address):[];if(d&&d.length&&!h.length&&console.warn(`Failed to resolve IPv${d[0].family} addresses with current network`),!h.length&&t)return e(null,Te(t.value,{cached:!0}));let y={addresses:h.length?h:[r.host],servername:r.servername||r.host};return ee.set(r.host,{value:y,expires:Date.now()+(r.dnsTtl||lt)}),e(null,Te(y,{cached:!1}))})}catch(m){return t?(ee.set(r.host,{value:t.value,expires:Date.now()+(r.dnsTtl||lt)}),e(null,Te(t.value,{cached:!0,error:m}))):e(o||a||m)}})})};G.exports.parseConnectionUrl=r=>{r=r||"";let e={},t=Sl.parse(r,!0);switch(t.protocol){case"smtp:":e.secure=!1;break;case"smtps:":e.secure=!0;break;case"direct:":e.direct=!0;break}if(!isNaN(t.port)&&Number(t.port)&&(e.port=Number(t.port)),t.hostname&&(e.host=t.hostname),t.auth){let n=t.auth.split(":");e.auth={user:n.shift(),pass:n.join(":")}}return Object.keys(t.query||{}).forEach(n=>{let i=e,o=n,a=t.query[n];switch(isNaN(a)||(a=Number(a)),a){case"true":a=!0;break;case"false":a=!1;break}if(n.indexOf("tls.")===0)o=n.substr(4),e.tls||(e.tls={}),i=e.tls;else if(n.indexOf(".")>=0)return;o in i||(i[o]=a)}),e};G.exports._logFunc=(r,e,t,n,i,...o)=>{let a=Object.assign({},t||{},n||{});delete a.level,r[e](a,i,...o)};G.exports.getLogger=(r,e)=>{r=r||{};let t={},n=["trace","debug","info","warn","error","fatal"];if(!r.logger)return n.forEach(o=>{t[o]=()=>!1}),t;let i=r.logger===!0?Ol(n):r.logger;return n.forEach(o=>{t[o]=(a,s,...c)=>{G.exports._logFunc(i,o,e,a,s,...c)}}),t};G.exports.callbackPromise=(r,e)=>function(){let t=Array.from(arguments),n=t.shift();n?e(n):r(...t)};G.exports.parseDataURI=r=>{if(typeof r!="string"||!r.startsWith("data:"))return null;let e=r.indexOf(",");if(e===-1)return null;let t=r.substring(e+1),n=r.substring(5,e),i,o=n.split(";");if(o.length>0){let p=o[o.length-1].toLowerCase().trim();["base64","utf8","utf-8"].includes(p)&&p.indexOf("=")===-1&&(i=p,o.pop())}let a=o.length>0?o.shift():"application/octet-stream",s={};for(let p=0;p<o.length;p++){let f=o[p],x=f.indexOf("=");if(x>0){let m=f.substring(0,x).trim(),d=f.substring(x+1).trim();m&&(s[m]=d)}}let c;try{if(i==="base64")c=Buffer.from(t,"base64");else try{c=Buffer.from(decodeURIComponent(t))}catch{c=Buffer.from(t)}}catch{c=Buffer.alloc(0)}return{data:c,encoding:i||null,contentType:a||"application/octet-stream",params:s}};G.exports.resolveContent=(r,e,t)=>{let n;t||(n=new Promise((a,s)=>{t=G.exports.callbackPromise(a,s)}));let i=r&&r[e]&&r[e].content||r[e],o=(typeof r[e]=="object"&&r[e].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!i)return t(null,i);if(typeof i=="object"){if(typeof i.pipe=="function")return Nr(i,(a,s)=>{if(a)return t(a);r[e].content?r[e].content=s:r[e]=s,t(null,s)});if(/^https?:\/\//i.test(i.path||i.href))return Nr(Al(i.path||i.href),t);if(/^data:/i.test(i.path||i.href)){let a=G.exports.parseDataURI(i.path||i.href);return!a||!a.data?t(null,Buffer.from(0)):t(null,a.data)}else if(i.path)return Nr(wl.createReadStream(i.path),t)}return typeof r[e].content=="string"&&!["utf8","usascii","ascii"].includes(o)&&(i=Buffer.from(r[e].content,o)),setImmediate(()=>t(null,i)),n};G.exports.assign=function(){let r=Array.from(arguments),e=r.shift()||{};return r.forEach(t=>{Object.keys(t||{}).forEach(n=>{["tls","auth"].includes(n)&&t[n]&&typeof t[n]=="object"?e[n]=Object.assign(e[n]||{},t[n]):e[n]=t[n]})}),e};G.exports.encodeXText=r=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(r))return r;let e=Buffer.from(r),t="";for(let n=0,i=e.length;n<i;n++){let o=e[n];o<33||o>126||o===43||o===61?t+="+"+(o<16?"0":"")+o.toString(16).toUpperCase():t+=String.fromCharCode(o)}return t};function Nr(r,e){let t=!1,n=[],i=0;r.on("error",o=>{t||(t=!0,e(o))}),r.on("readable",()=>{let o;for(;(o=r.read())!==null;)n.push(o),i+=o.length}),r.on("end",()=>{if(t)return;t=!0;let o;try{o=Buffer.concat(n,i)}catch(a){return e(a)}e(null,o)})}l(Nr,"resolveStream");function Ol(r){let e=r.reduce((o,a)=>Math.max(o,a.length),0),t=new Map;r.forEach(o=>{let a=o.toUpperCase();a.length<e&&(a+=" ".repeat(e-a.length)),t.set(o,a)});let n=l((o,a,s,...c)=>{let p="";a&&(a.tnx==="server"?p="S: ":a.tnx==="client"&&(p="C: "),a.sid&&(p="["+a.sid+"] "+p),a.cid&&(p="[#"+a.cid+"] "+p)),s=Il.format(s,...c),s.split(/\r?\n/).forEach(f=>{console.log("[%s] %s %s",new Date().toISOString().substr(0,19).replace(/T/," "),t.get(o),p+f)})},"print"),i={};return r.forEach(o=>{i[o]=n.bind(null,o)}),i}l(Ol,"createDefaultLogger")});var Rr=R((hA,ia)=>{"use strict";var Cl=require("path"),ta="application/octet-stream",Nl="bin",ra=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"]]),na=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"]]);ia.exports={detectMimeType(r){if(!r)return ta;let e=Cl.parse(r),t=(e.ext.substr(1)||e.name||"").split("?").shift().trim().toLowerCase(),n=na.has(t)?na.get(t):ta;return Array.isArray(n)?n[0]:n},detectExtension(r){if(!r)return Nl;let e=(r||"").toLowerCase().trim().split("/"),t=e.shift().trim(),n=e.join("/").trim();if(ra.has(t+"/"+n)){let i=ra.get(t+"/"+n);return Array.isArray(i)?i[0]:i}return t==="text"?"txt":"bin"}}});var Mr=R((gA,ua)=>{"use strict";var Rl=/^xn--/,Dl=/[^\0-\x7F]/,Ul=/[\x2E\u3002\uFF0E\uFF61]/g,Ml={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Dr=35,pe=Math.floor,Ur=String.fromCharCode;function Se(r){throw new RangeError(Ml[r])}l(Se,"error");function jl(r,e){let t=[],n=r.length;for(;n--;)t[n]=e(r[n]);return t}l(jl,"map");function aa(r,e){let t=r.split("@"),n="";t.length>1&&(n=t[0]+"@",r=t[1]),r=r.replace(Ul,".");let i=r.split("."),o=jl(i,e).join(".");return n+o}l(aa,"mapDomain");function sa(r){let e=[],t=0,n=r.length;for(;t<n;){let i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){let o=r.charCodeAt(t++);(o&64512)==56320?e.push(((i&1023)<<10)+(o&1023)+65536):(e.push(i),t--)}else e.push(i)}return e}l(sa,"ucs2decode");var Ll=l(r=>String.fromCodePoint(...r),"ucs2encode"),Fl=l(function(r){return r>=48&&r<58?26+(r-48):r>=65&&r<91?r-65:r>=97&&r<123?r-97:36},"basicToDigit"),oa=l(function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},"digitToBasic"),ca=l(function(r,e,t){let n=0;for(r=t?pe(r/700):r>>1,r+=pe(r/e);r>Dr*26>>1;n+=36)r=pe(r/Dr);return pe(n+(Dr+1)*r/(r+38))},"adapt"),pa=l(function(r){let e=[],t=r.length,n=0,i=128,o=72,a=r.lastIndexOf("-");a<0&&(a=0);for(let s=0;s<a;++s)r.charCodeAt(s)>=128&&Se("not-basic"),e.push(r.charCodeAt(s));for(let s=a>0?a+1:0;s<t;){let c=n;for(let f=1,x=36;;x+=36){s>=t&&Se("invalid-input");let m=Fl(r.charCodeAt(s++));m>=36&&Se("invalid-input"),m>pe((2147483647-n)/f)&&Se("overflow"),n+=m*f;let d=x<=o?1:x>=o+26?26:x-o;if(m<d)break;let h=36-d;f>pe(2147483647/h)&&Se("overflow"),f*=h}let p=e.length+1;o=ca(n-c,p,c==0),pe(n/p)>2147483647-i&&Se("overflow"),i+=pe(n/p),n%=p,e.splice(n++,0,i)}return String.fromCodePoint(...e)},"decode"),la=l(function(r){let e=[];r=sa(r);let t=r.length,n=128,i=0,o=72;for(let c of r)c<128&&e.push(Ur(c));let a=e.length,s=a;for(a&&e.push("-");s<t;){let c=2147483647;for(let f of r)f>=n&&f<c&&(c=f);let p=s+1;c-n>pe((2147483647-i)/p)&&Se("overflow"),i+=(c-n)*p,n=c;for(let f of r)if(f<n&&++i>2147483647&&Se("overflow"),f===n){let x=i;for(let m=36;;m+=36){let d=m<=o?1:m>=o+26?26:m-o;if(x<d)break;let h=x-d,y=36-d;e.push(Ur(oa(d+h%y,0))),x=pe(h/y)}e.push(Ur(oa(x,0))),o=ca(i,p,s===a),i=0,++s}++i,++n}return e.join("")},"encode"),Bl=l(function(r){return aa(r,function(e){return Rl.test(e)?pa(e.slice(4).toLowerCase()):e})},"toUnicode"),Zl=l(function(r){return aa(r,function(e){return Dl.test(e)?"xn--"+la(e):e})},"toASCII"),Hl={version:"2.3.1",ucs2:{decode:sa,encode:Ll},decode:pa,encode:la,toASCII:Zl,toUnicode:Bl};ua.exports=Hl});var Fr=R((vA,ma)=>{"use strict";var{Transform:Vl}=require("stream");function jr(r){return typeof r=="string"&&(r=Buffer.from(r,"utf-8")),r.toString("base64")}l(jr,"encode");function da(r,e){if(r=(r||"").toString(),e=e||76,r.length<=e)return r;let t=[],n=0,i=e*1024,o=new RegExp(".{"+e+"}","g");for(;n<r.length;){let a=r.substr(n,i).replace(o,`$&\r
2
+ `);t.push(a),n+=i}return t.join("")}l(da,"wrap");var Lr=class extends Vl{static{l(this,"Encoder")}constructor(e){super(),this.options=e||{},this.options.lineLength!==!1&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this._remainingBytes=!1,this.inputBytes=0,this.outputBytes=0}_transform(e,t,n){if(t!=="buffer"&&(e=Buffer.from(e,t)),!e||!e.length)return setImmediate(n);this.inputBytes+=e.length,this._remainingBytes&&this._remainingBytes.length&&(e=Buffer.concat([this._remainingBytes,e],this._remainingBytes.length+e.length),this._remainingBytes=!1),e.length%3?(this._remainingBytes=e.slice(e.length-e.length%3),e=e.slice(0,e.length-e.length%3)):this._remainingBytes=!1;let i=this._curLine+jr(e);if(this.options.lineLength){i=da(i,this.options.lineLength);let o=i.lastIndexOf(`
3
+ `);o<0?(this._curLine=i,i=""):(this._curLine=i.substring(o+1),i=i.substring(0,o+1),i&&!i.endsWith(`\r
4
+ `)&&(i+=`\r
5
+ `))}else this._curLine="";i&&(this.outputBytes+=i.length,this.push(Buffer.from(i,"ascii"))),setImmediate(n)}_flush(e){this._remainingBytes&&this._remainingBytes.length&&(this._curLine+=jr(this._remainingBytes)),this._curLine&&(this.outputBytes+=this._curLine.length,this.push(Buffer.from(this._curLine,"ascii")),this._curLine=""),e()}};ma.exports={encode:jr,wrap:da,Encoder:Lr}});var Hr=R((_A,ha)=>{"use strict";var{Transform:ql}=require("stream"),Gl=[[9],[10],[13],[32,60],[62,126]];function Br(r){typeof r=="string"&&(r=Buffer.from(r,"utf-8"));let e="",t;for(let n=0,i=r.length;n<i;n++){if(t=r[n],Wl(t,Gl)&&!((t===32||t===9)&&(n===i-1||r[n+1]===10||r[n+1]===13))){e+=String.fromCharCode(t);continue}e+="="+(t<16?"0":"")+t.toString(16).toUpperCase()}return e}l(Br,"encode");function fa(r,e){if(r=(r||"").toString(),e=e||76,r.length<=e)return r;let t=0,n=r.length,i,o,a,s=Math.floor(e/3),c="";for(;t<n;){if(a=r.substr(t,e),i=a.match(/\r\n/)){a=a.substr(0,i.index+i[0].length),c+=a,t+=a.length;continue}if(a.substr(-1)===`
6
+ `){c+=a,t+=a.length;continue}if(i=a.substr(-s).match(/\n.*?$/)){a=a.substr(0,a.length-(i[0].length-1)),c+=a,t+=a.length;continue}if(a.length>e-s&&(i=a.substr(-s).match(/[ \t.,!?][^ \t.,!?]*$/)))a=a.substr(0,a.length-(i[0].length-1));else if(a.match(/[=][\da-f]{0,2}$/i))for((i=a.match(/[=][\da-f]{0,1}$/i))&&(a=a.substr(0,a.length-i[0].length));a.length>3&&a.length<n-t&&!a.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(i=a.match(/[=][\da-f]{2}$/gi))&&(o=parseInt(i[0].substr(1,2),16),!(o<128||(a=a.substr(0,a.length-3),o>=192))););t+a.length<n&&a.substr(-1)!==`
7
+ `?(a.length===e&&a.match(/[=][\da-f]{2}$/i)?a=a.substr(0,a.length-3):a.length===e&&(a=a.substr(0,a.length-1)),t+=a.length,a+=`=\r
8
+ `):t+=a.length,c+=a}return c}l(fa,"wrap");function Wl(r,e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.length&&(n.length===1&&r===n[0]||n.length===2&&r>=n[0]&&r<=n[1]))return!0}return!1}l(Wl,"checkRanges");var Zr=class extends ql{static{l(this,"Encoder")}constructor(e){super(),this.options=e||{},this.options.lineLength!==!1&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(e,t,n){let i;if(t!=="buffer"&&(e=Buffer.from(e,t)),!e||!e.length)return n();this.inputBytes+=e.length,this.options.lineLength?(i=this._curLine+Br(e),i=fa(i,this.options.lineLength),i=i.replace(/(^|\n)([^\n]*)$/,(o,a,s)=>(this._curLine=s,a)),i&&(this.outputBytes+=i.length,this.push(i))):(i=Br(e),this.outputBytes+=i.length,this.push(i,"ascii")),n()}_flush(e){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),e()}};ha.exports={encode:Br,wrap:fa,Encoder:Zr}});var dt=R((EA,xa)=>{"use strict";var ut=Fr(),Kl=Hr(),ga=Rr();xa.exports={isPlainText(r,e){return typeof r=="string"&&!(e?/[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(r)},hasLongerLines(r,e){return r.length>128*1024?!0:new RegExp("^.{"+(e+1)+",}","m").test(r)},encodeWord(r,e,t){e=(e||"Q").toString().toUpperCase().trim().charAt(0),t=t||0;let n,i="UTF-8";if(t&&t>7+i.length&&(t-=7+i.length),e==="Q"?n=Kl.encode(r).replace(/[^a-z0-9!*+\-/=]/gi,o=>{let a=o.charCodeAt(0).toString(16).toUpperCase();return o===" "?"_":"="+(a.length===1?"0"+a:a)}):e==="B"&&(n=typeof r=="string"?r:ut.encode(r),t=t?Math.max(3,(t-t%4)/4*3):0),t&&(e!=="B"?n:ut.encode(r)).length>t)if(e==="Q")n=this.splitMimeEncodedString(n,t).join("?= =?"+i+"?"+e+"?");else{let o=[],a="";for(let s=0,c=n.length;s<c;s++){let p=n.charAt(s);/[\ud83c\ud83d\ud83e]/.test(p)&&s<c-1&&(p+=n.charAt(++s)),Buffer.byteLength(a+p)<=t||s===0?a+=p:(o.push(ut.encode(a)),a=p)}a&&o.push(ut.encode(a)),o.length>1?n=o.join("?= =?"+i+"?"+e+"?"):n=o.join("")}else e==="B"&&(n=ut.encode(r));return"=?"+i+"?"+e+"?"+n+(n.substr(-2)==="?="?"":"?=")},encodeWords(r,e,t,n){t=t||0;let i=r.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!i)return r;if(n)return this.encodeWord(r,e,t);let o=r.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!o)return r;let a=i.index+(i[0].match(/[^\s]/)||{index:0}).index,s=o.index+(o[1]||"").length;return(a?r.substr(0,a):"")+this.encodeWord(r.substring(a,s),e||"Q",t)+(s<r.length?r.substr(s):"")},buildHeaderValue(r){let e=[];return Object.keys(r.params||{}).forEach(t=>{let n=r.params[t];!this.isPlainText(n,!0)||n.length>=75?this.buildHeaderParam(t,n,50).forEach(i=>{!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(i.value)||i.key.substr(-1)==="*"?e.push(i.key+"="+i.value):e.push(i.key+"="+JSON.stringify(i.value))}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)?e.push(t+"="+JSON.stringify(n)):e.push(t+"="+n)}),r.value+(e.length?"; "+e.join("; "):"")},buildHeaderParam(r,e,t){let n=[],i=typeof e=="string"?e:(e||"").toString(),o,a,s,c=0,p,f;if(t=t||50,this.isPlainText(e,!0)){if(i.length<=t)return[{key:r,value:i}];i=i.replace(new RegExp(".{"+t+"}","g"),x=>(n.push({line:x}),"")),i&&n.push({line:i})}else{if(/[\uD800-\uDBFF]/.test(i)){let m=[];for(p=0,f=i.length;p<f;p++)o=i.charAt(p),a=o.charCodeAt(0),a>=55296&&a<=56319&&p<f-1?(o+=i.charAt(p+1),m.push(o),p++):m.push(o);i=m}s="utf-8''";let x=!0;for(c=0,p=0,f=i.length;p<f;p++){if(o=i[p],x)o=this.safeEncodeURIComponent(o);else if(o=o===" "?o:this.safeEncodeURIComponent(o),o!==i[p])if((this.safeEncodeURIComponent(s)+o).length>=t)n.push({line:s,encoded:x}),s="",c=p-1;else{x=!0,p=c,s="";continue}(s+o).length>=t?(n.push({line:s,encoded:x}),s=o=i[p]===" "?" ":this.safeEncodeURIComponent(i[p]),o===i[p]?(x=!1,c=p-1):x=!0):s+=o}s&&n.push({line:s,encoded:x})}return n.map((x,m)=>({key:r+"*"+m+(x.encoded?"*":""),value:x.line}))},parseHeaderValue(r){let e={value:!1,params:{}},t=!1,n="",i="value",o=!1,a=!1,s;for(let c=0,p=r.length;c<p;c++)if(s=r.charAt(c),i==="key"){if(s==="="){t=n.trim().toLowerCase(),i="value",n="";continue}n+=s}else{if(a)n+=s;else if(s==="\\"){a=!0;continue}else o&&s===o?o=!1:!o&&s==='"'?o=s:!o&&s===";"?(t===!1?e.value=n.trim():e.params[t]=n.trim(),i="key",n=""):n+=s;a=!1}return i==="value"?t===!1?e.value=n.trim():e.params[t]=n.trim():n.trim()&&(e.params[n.trim().toLowerCase()]=""),Object.keys(e.params).forEach(c=>{let p,f,x,m;(x=c.match(/(\*(\d+)|\*(\d+)\*|\*)$/))&&(p=c.substr(0,x.index),f=Number(x[2]||x[3])||0,(!e.params[p]||typeof e.params[p]!="object")&&(e.params[p]={charset:!1,values:[]}),m=e.params[c],f===0&&x[0].substr(-1)==="*"&&(x=m.match(/^([^']*)'[^']*'(.*)$/))&&(e.params[p].charset=x[1]||"iso-8859-1",m=x[2]),e.params[p].values[f]=m,delete e.params[c])}),Object.keys(e.params).forEach(c=>{let p;e.params[c]&&Array.isArray(e.params[c].values)&&(p=e.params[c].values.map(f=>f||"").join(""),e.params[c].charset?e.params[c]="=?"+e.params[c].charset+"?Q?"+p.replace(/[=?_\s]/g,f=>{let x=f.charCodeAt(0).toString(16);return f===" "?"_":"%"+(x.length<2?"0":"")+x}).replace(/%/g,"=")+"?=":e.params[c]=p)}),e},detectExtension:l(r=>ga.detectExtension(r),"detectExtension"),detectMimeType:l(r=>ga.detectMimeType(r),"detectMimeType"),foldLines(r,e,t){r=(r||"").toString(),e=e||76;let n=0,i=r.length,o="",a,s;for(;n<i;){if(a=r.substr(n,e),a.length<e){o+=a;break}if(s=a.match(/^[^\n\r]*(\r?\n|\r)/)){a=s[0],o+=a,n+=a.length;continue}else(s=a.match(/(\s+)[^\s]*$/))&&s[0].length-(t?(s[1]||"").length:0)<a.length?a=a.substr(0,a.length-(s[0].length-(t?(s[1]||"").length:0))):(s=r.substr(n+a.length).match(/^[^\s]+(\s*)/))&&(a=a+s[0].substr(0,s[0].length-(t?0:(s[1]||"").length)));o+=a,n+=a.length,n<i&&(o+=`\r
9
+ `)}return o},splitMimeEncodedString:l((r,e)=>{let t=[],n,i,o,a;for(e=Math.max(e||0,12);r.length;){for(n=r.substr(0,e),(i=n.match(/[=][0-9A-F]?$/i))&&(n=n.substr(0,i.index)),a=!1;!a;)a=!0,(i=r.substr(n.length).match(/^[=]([0-9A-F]{2})/i))&&(o=parseInt(i[1],16),o<194&&o>127&&(n=n.substr(0,n.length-3),a=!1));n.length&&t.push(n),r=r.substr(n.length)}return t},"splitMimeEncodedString"),encodeURICharComponent:l(r=>{let e="",t=r.charCodeAt(0).toString(16).toUpperCase();if(t.length%2&&(t="0"+t),t.length>2)for(let n=0,i=t.length/2;n<i;n++)e+="%"+t.substr(n,2);else e+="%"+t;return e},"encodeURICharComponent"),safeEncodeURIComponent(r){r=(r||"").toString();try{r=encodeURIComponent(r)}catch{return r.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g,"")}return r.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,e=>this.encodeURICharComponent(e))}}});var _a=R((TA,ya)=>{"use strict";function Jl(r,e){let t=!1,n="text",i=[],o={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a=!1;for(let s=0,c=r.length;s<c;s++){let p=r[s],f=s?r[s-1]:null;if(p.type==="operator")switch(p.value){case"<":n="address",a=!1;break;case"(":n="comment",a=!1;break;case":":n="group",t=!0,a=!1;break;case'"':a=!a,n="text";break;default:n="text",a=!1;break}else p.value&&(n==="address"&&(p.value=p.value.replace(/^[^<]*<\s*/,"")),f&&f.noBreak&&o[n].length?(o[n][o[n].length-1]+=p.value,n==="text"&&a&&(o.textWasQuoted[o.textWasQuoted.length-1]=!0)):(o[n].push(p.value),n==="text"&&o.textWasQuoted.push(a)))}if(!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),t){o.text=o.text.join(" ");let s=[];o.group.length&&va(o.group.join(","),{_depth:e+1}).forEach(p=>{p.group?s=s.concat(p.group):s.push(p)}),i.push({name:o.text||"",group:s})}else{if(!o.address.length&&o.text.length){for(let c=o.text.length-1;c>=0;c--)if(!o.textWasQuoted[c]&&/^[^@\s]+@[^@\s]+$/.test(o.text[c])){o.address=o.text.splice(c,1),o.textWasQuoted.splice(c,1);break}if(!o.address.length){let c=!1;for(let p=o.text.length-1;p>=0&&!(!o.textWasQuoted[p]&&(o.text[p]=o.text[p].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,f=>c?f:(o.address=[f.trim()],c=!0," ")).trim(),c));p--);}}!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),o.address.length>1&&(o.text=o.text.concat(o.address.splice(1))),o.text=o.text.join(" "),o.address=o.address.join(" ");let s={address:o.address||o.text||"",name:o.text||o.address||""};s.address===s.name&&(/@/.test(s.address||"")?s.name="":s.address=""),i.push(s)}return i}l(Jl,"_handleAddress");var Vr=class{static{l(this,"Tokenizer")}constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let t=0,n=this.str.length;t<n;t++){let i=this.str.charAt(t),o=t<n-1?this.str.charAt(t+1):null;this.checkChar(i,o)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},t&&![" "," ","\r",`
10
+ `,",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],this.escaped=!1;return}else if(['"',"'"].includes(this.operatorExpecting)&&e==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),e===`
11
+ `&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}},Xl=50;function va(r,e){e=e||{};let t=e._depth||0;if(t>Xl)return[];let i=new Vr(r).tokenize(),o=[],a=[],s=[];i.forEach(c=>{c.type==="operator"&&(c.value===","||c.value===";")?(a.length&&o.push(a),a=[]):a.push(c)}),a.length&&o.push(a),o.forEach(c=>{let p=Jl(c,t);p.length&&(s=s.concat(p))});for(let c=s.length-2;c>=0;c--){let p=s[c],f=s[c+1];p.address===""&&p.name&&!p.group&&f.address&&f.name&&(f.name=p.name+", "+f.name,s.splice(c,1))}if(e.flatten){let c=[],p=l(f=>{f.forEach(x=>{if(x.group)return p(x.group);c.push(x)})},"walkAddressList");return p(s),c}return s}l(va,"addressparser");ya.exports=va});var Ea=R((IA,ba)=>{"use strict";var{Transform:Yl}=require("stream"),qr=class extends Yl{static{l(this,"LastNewline")}constructor(){super(),this.lastByte=!1}_transform(e,t,n){e.length&&(this.lastByte=e[e.length-1]),this.push(e),n()}_flush(e){return this.lastByte===10?e():this.lastByte===13?(this.push(Buffer.from(`
12
+ `)),e()):(this.push(Buffer.from(`\r
13
+ `)),e())}};ba.exports=qr});var Wr=R((AA,Pa)=>{"use strict";var{Transform:Ql}=require("stream"),Gr=class extends Ql{static{l(this,"LeWindows")}constructor(e){super(e),this.lastByte=!1}_transform(e,t,n){let i,o=0;for(let a=0,s=e.length;a<s;a++)e[a]===10&&(a&&e[a-1]!==13||!a&&this.lastByte!==13)&&(a>o&&(i=e.slice(o,a),this.push(i)),this.push(Buffer.from(`\r
14
+ `)),o=a+1);o&&o<e.length?(i=e.slice(o),this.push(i)):o||this.push(e),this.lastByte=e[e.length-1],n()}};Pa.exports=Gr});var Sa=R(($A,Ta)=>{"use strict";var{Transform:eu}=require("stream"),Kr=class extends eu{static{l(this,"LeUnix")}constructor(e){super(e)}_transform(e,t,n){let i,o=0;for(let a=0,s=e.length;a<s;a++)e[a]===13&&(i=e.slice(o,a),o=a+1,this.push(i));o&&o<e.length?(i=e.slice(o),this.push(i)):o||this.push(e),n()}};Ta.exports=Kr});var Ft=R((OA,wa)=>{"use strict";var Jr=require("crypto"),tu=require("fs"),ru=Mr(),{PassThrough:mt}=require("stream"),nu=K(),ie=dt(),iu=Hr(),ou=Fr(),au=_a(),su=pt(),Ia=ne(),cu=Ea(),pu=Wr(),lu=Sa(),uu=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"],Xr=class r{static{l(this,"MimeNode")}constructor(e,t){this.nodeCounter=0,t=t||{},this.baseBoundary=t.baseBoundary||Jr.randomBytes(8).toString("hex"),this.boundaryPrefix=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=ie.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&&typeof e=="object"&&(t=e,e=void 0);let n=new r(e,t);return this.appendChild(n),n}appendChild(e){return 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,n)=>{t===this&&(e.rootNode=this.rootNode,e.parentNode=this.parentNode,e._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,e.parentNode.childNodes[n]=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 n=!1;if(!t&&e&&typeof e=="object")return e.key&&"value"in e?this.setHeader(e.key,e.value):Array.isArray(e)?e.forEach(o=>{this.setHeader(o.key,o.value)}):Object.keys(e).forEach(o=>{this.setHeader(o,e[o])}),this;e=this._normalizeHeaderKey(e);let i={key:e,value:t};for(let o=0,a=this._headers.length;o<a;o++)this._headers[o].key===e&&(n?(this._headers.splice(o,1),o--,a--):(this._headers[o]=i,n=!0));return n||this._headers.push(i),this}addHeader(e,t){return!t&&e&&typeof e=="object"?(e.key&&e.value?this.addHeader(e.key,e.value):Array.isArray(e)?e.forEach(n=>{this.addHeader(n.key,n.value)}):Object.keys(e).forEach(n=>{this.addHeader(n,e[n])}),this):Array.isArray(t)?(t.forEach(n=>{this.addHeader(e,n)}),this):(this._headers.push({key:this._normalizeHeaderKey(e),value:t}),this)}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,n=this._headers.length;t<n;t++)if(this._headers[t].key===e)return this._headers[t].value}setContent(e){return this.content=e,typeof this.content.pipe=="function"?(this._contentErrorHandler=t=>{this.content.removeListener("error",this._contentErrorHandler),this.content=t},this.content.once("error",this._contentErrorHandler)):typeof this.content=="string"&&(this._isPlainText=ie.isPlainText(this.content),this._isPlainText&&ie.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(e){let t;e||(t=new Promise((s,c)=>{e=nu.callbackPromise(s,c)}));let n=this.createReadStream(),i=[],o=0,a=!1;return n.on("readable",()=>{let s;for(;(s=n.read())!==null;)i.push(s),o+=s.length}),n.once("error",s=>{if(!a)return a=!0,e(s)}),n.once("end",s=>{if(!a)return a=!0,s&&s.length&&(i.push(s),o+=s.length),e(null,Buffer.concat(i,o))}),t}getTransferEncoding(){let e=!1,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)?this._isPlainText&&!this._hasLongLines?e="7bit":typeof this.content=="string"||this.content instanceof Buffer?e=this._getTextEncoding(this.content)==="Q"?"quoted-printable":"base64":e=this.textEncoding==="B"?"base64":"quoted-printable":/^(multipart|message)\//i.test(t)||(e=e||"base64"))),e}buildHeaders(){let 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 n=this._headers.length-2;n>=0;n--){let i=this._headers[n];i.key==="Content-Type"&&(this._headers.splice(n,1),this._headers.push(i))}}return this._headers.forEach(n=>{let i=n.key,o=n.value,a,s,c={};if(!(o&&typeof o=="object"&&!uu.includes(i)&&(Object.keys(o).forEach(f=>{f!=="value"&&(c[f]=o[f])}),o=(o.value||"").toString(),!o.trim()))){if(c.prepared){c.foldLines?t.push(ie.foldLines(i+": "+o)):t.push(i+": "+o);return}switch(n.key){case"Content-Disposition":a=ie.parseHeaderValue(o),this.filename&&(a.params.filename=this.filename),o=ie.buildHeaderValue(a);break;case"Content-Type":a=ie.parseHeaderValue(o),this._handleContentType(a),a.value.match(/^text\/plain\b/)&&typeof this.content=="string"&&/[\u0080-\uFFFF]/.test(this.content)&&(a.params.charset="utf-8"),o=ie.buildHeaderValue(a),this.filename&&(s=this._encodeWords(this.filename),(s!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(s))&&(s='"'+s+'"'),o+="; name="+s);break;case"Bcc":if(!this.keepBcc)return;break}if(o=this._encodeHeaderValue(i,o),!!(o||"").toString().trim()){if(typeof this.normalizeHeaderKey=="function"){let f=this.normalizeHeaderKey(i,o);f&&typeof f=="string"&&f.length&&(i=f)}t.push(ie.foldLines(i+": "+o,76))}}}),t.join(`\r
15
+ `)}createReadStream(e){e=e||{};let t=new mt(e),n=t,i;this.stream(t,e,o=>{if(o){n.emit("error",o);return}t.end()});for(let o=0,a=this._transforms.length;o<a;o++)i=typeof this._transforms[o]=="function"?this._transforms[o]():this._transforms[o],n.once("error",s=>{i.emit("error",s)}),n=n.pipe(i);i=new cu,n.once("error",o=>{i.emit("error",o)}),n=n.pipe(i);for(let o=0,a=this._processFuncs.length;o<a;o++)i=this._processFuncs[o],n=i(n);if(this.newline){let a=["win","windows","dos",`\r
16
+ `].includes(this.newline.toString().toLowerCase())?new pu:new lu,s=n.pipe(a);return n.on("error",c=>s.emit("error",c)),s}return n}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,n){let i=this.getTransferEncoding(),o,a,s=!1,c=l(x=>{s||(s=!0,n(x))},"callback"),p=l(()=>{let x=0,m=l(()=>{if(x>=this.childNodes.length)return e.write(`\r
17
+ --`+this.boundary+`--\r
18
+ `),c();let d=this.childNodes[x++];e.write((x>1?`\r
19
+ `:"")+"--"+this.boundary+`\r
20
+ `),d.stream(e,t,h=>{if(h)return c(h);setImmediate(m)})},"processChildNode");if(this.multipart)setImmediate(m);else return c()},"finalize"),f=l(()=>{if(this.content){if(Object.prototype.toString.call(this.content)==="[object Error]")return c(this.content);typeof this.content.pipe=="function"&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=m=>c(m),this.content.once("error",this._contentErrorHandler));let x=l(()=>{["quoted-printable","base64"].includes(i)?(o=new(i==="base64"?ou:iu).Encoder(t),o.pipe(e,{end:!1}),o.once("end",p),o.once("error",m=>c(m)),a=this._getStream(this.content),a.pipe(o)):(a=this._getStream(this.content),a.pipe(e,{end:!1}),a.once("end",p)),a.once("error",m=>c(m))},"createStream");if(this.content._resolve){let m=[],d=0,h=!1,y=this._getStream(this.content);y.on("error",v=>{h||(h=!0,c(v))}),y.on("readable",()=>{let v;for(;(v=y.read())!==null;)m.push(v),d+=v.length}),y.on("end",()=>{h||(h=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(m,d),setImmediate(x))})}else setImmediate(x);return}return setImmediate(p)},"sendContent");this._raw?setImmediate(()=>{if(Object.prototype.toString.call(this._raw)==="[object Error]")return c(this._raw);typeof this._raw.pipe=="function"&&this._raw.removeListener("error",this._contentErrorHandler);let x=this._getStream(this._raw);x.pipe(e,{end:!1}),x.on("error",m=>e.emit("error",m)),x.on("end",p)}):(e.write(this.buildHeaders()+`\r
21
+ \r
22
+ `),setImmediate(f))}setEnvelope(e){let t;this._envelope={from:!1,to:[]},e.from&&(t=[],this._convertAddresses(this._parseAddresses(e.from),t),t=t.filter(i=>i&&i.address),t.length&&t[0]&&(this._envelope.from=t[0].address)),["to","cc","bcc"].forEach(i=>{e[i]&&this._convertAddresses(this._parseAddresses(e[i]),this._envelope.to)}),this._envelope.to=this._envelope.to.map(i=>i.address).filter(i=>i);let n=["to","cc","bcc","from"];return Object.keys(e).forEach(i=>{n.includes(i)||(this._envelope[i]=e[i])}),this}getAddresses(){let e={};return this._headers.forEach(t=>{let n=t.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(n)&&(Array.isArray(e[n])||(e[n]=[]),this._convertAddresses(this._parseAddresses(t.value),e[n]))}),e}getEnvelope(){if(this._envelope)return this._envelope;let e={from:!1,to:[]};return this._headers.forEach(t=>{let n=[];t.key==="From"||!e.from&&["Reply-To","Sender"].includes(t.key)?(this._convertAddresses(this._parseAddresses(t.value),n),n.length&&n[0]&&(e.from=n[0].address)):["To","Cc","Bcc"].includes(t.key)&&this._convertAddresses(this._parseAddresses(t.value),e.to)}),e.to=e.to.map(t=>t.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&&typeof this._raw.pipe=="function"&&(this._contentErrorHandler=t=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=t},this._raw.once("error",this._contentErrorHandler)),this}_getStream(e){let t;return e._resolvedValue?(t=new mt,setImmediate(()=>{try{t.end(e._resolvedValue)}catch(n){t.emit("error",n)}}),t):typeof e.pipe=="function"?e:e&&typeof e.path=="string"&&!e.href?this.disableFileAccess?(t=new mt,setImmediate(()=>{let n=new Error("File access rejected for "+e.path);n.code=Ia.EFILEACCESS,t.emit("error",n)}),t):tu.createReadStream(e.path):e&&typeof e.href=="string"?this.disableUrlAccess?(t=new mt,setImmediate(()=>{let n=new Error("Url access rejected for "+e.href);n.code=Ia.EURLACCESS,t.emit("error",n)}),t):su(e.href,{headers:e.httpHeaders}):(t=new mt,setImmediate(()=>{try{t.end(e||"")}catch(n){t.emit("error",n)}}),t)}_parseAddresses(e){return[].concat.apply([],[].concat(e).map(t=>t&&t.address?(t.address=this._normalizeAddress(t.address),t.name=t.name||"",[t]):au(t)))}_normalizeHeaderKey(e){return e=(e||"").toString().replace(/\r?\n|\r/g," ").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,t=>t.toUpperCase()).replace(/^Content-Features$/i,"Content-features"),e}_handleContentType(e){this.contentType=e.value.trim().toLowerCase(),this.multipart=/^multipart\//i.test(this.contentType)?this.contentType.substr(this.contentType.indexOf("/")+1):!1,this.multipart?this.boundary=e.params.boundary=e.params.boundary||this.boundary||this._generateBoundary():this.boundary=!1}_generateBoundary(){return this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){switch(e=this._normalizeHeaderKey(e),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," "),t.charAt(0)!=="<"&&(t="<"+t),t.charAt(t.length-1)!==">"&&(t=t+">"),t;case"References":return t=[].concat.apply([],[].concat(t||"").map(n=>(n=(n||"").toString().replace(/\r?\n|\r/g," ").trim(),n.replace(/<[^>]*>/g,i=>i.replace(/\s/g,"")).split(/\s+/)))).map(n=>(n.charAt(0)!=="<"&&(n="<"+n),n.charAt(n.length-1)!==">"&&(n=n+">"),n)),t.join(" ").trim();case"Date":return Object.prototype.toString.call(t)==="[object Date]"?t.toUTCString().replace(/GMT/,"+0000"):(t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeWords(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._encodeWords(t)}}_convertAddresses(e,t){let n=[];return t=t||[],[].concat(e||[]).forEach(i=>{if(i.address)i.address=this._normalizeAddress(i.address),i.name?n.push(`${this._encodeAddressName(i.name)} <${i.address}>`):n.push(i.address.indexOf(" ")>=0?`<${i.address}>`:`${i.address}`),t.some(o=>o.address===i.address)||t.push(i);else if(i.group){let o=(i.group.length?this._convertAddresses(i.group,t):"").trim();n.push(`${this._encodeAddressName(i.name)}:${o};`)}}),n.join(", ")}_normalizeAddress(e){e=(e||"").toString().replace(/[\x00-\x1F<>]+/g," ").trim();let t=e.lastIndexOf("@");if(t<0)return e;let n=e.substr(0,t),i=e.substr(t+1),o;try{o=ru.toASCII(i.toLowerCase())}catch{}return n.indexOf(" ")>=0&&(n.charAt(0)!=='"'&&(n='"'+n),n.substr(-1)!=='"'&&(n=n+'"')),`${n}@${o}`}_encodeAddressName(e){return/^[\w ]*$/.test(e)?e:/^[\x20-\x7e]*$/.test(e)?'"'+e.replace(/([\\"])/g,"\\$1")+'"':ie.encodeWord(e,this._getTextEncoding(e),52)}_encodeWords(e){return ie.encodeWords(e,this._getTextEncoding(e),52,!0)}_getTextEncoding(e){if(e=(e||"").toString(),this.textEncoding)return this.textEncoding;let t=0,n=0;for(let i=0,o=e.length;i<o;i++){let a=e.charCodeAt(i);a>=0&&a<=8||a===11||a===12||a>=14&&a<=31||a>=128?t++:(a>=65&&a<=90||a>=97&&a<=122)&&n++}return t<n?"Q":"B"}_generateMessageId(){return"<"+[2,2,2,6].reduce((e,t)=>e+"-"+Jr.randomBytes(t).toString("hex"),Jr.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}};wa.exports=Xr});var za=R((NA,Aa)=>{"use strict";var ft=Ft(),Yr=dt(),{parseDataURI:du}=K(),Qr=class{static{l(this,"MailComposer")}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&&this._attachments.attached.length===1,this.mail.raw?this.message=new ft("message/rfc822",{newline:this.mail.newline}).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=>{let t=e.replace(/-(\w)/g,(n,i)=>i.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,n,i=[].concat(this.mail.attachments||[]).map((o,a)=>{/^data:/i.test(o.path||o.href)&&(o=this._processDataUrl(o));let s=o.contentType||Yr.detectMimeType(o.filename||o.path||o.href||"bin"),c=/^image\//i.test(s),p=/^message\//i.test(s),f=o.contentDisposition||(p||c&&o.cid?"inline":"attachment"),x;"contentTransferEncoding"in o?x=o.contentTransferEncoding:p?x="8bit":x="base64";let m={contentType:s,contentDisposition:f,contentTransferEncoding:x};return o.filename?m.filename=o.filename:!p&&o.filename!==!1&&(m.filename=(o.path||o.href||"").split("/").pop().split("?").shift()||"attachment-"+(a+1),m.filename.indexOf(".")<0&&(m.filename+="."+Yr.detectExtension(m.contentType))),/^https?:\/\//i.test(o.path)&&(o.href=o.path,o.path=void 0),o.cid&&(m.cid=o.cid),o.raw?m.raw=o.raw:o.path?m.content={path:o.path}:o.href?m.content={href:o.href,httpHeaders:o.httpHeaders}:m.content=o.content||"",o.encoding&&(m.encoding=o.encoding),o.headers&&(m.headers=o.headers),m});return this.mail.icalEvent&&(typeof this.mail.icalEvent=="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)?t=this.mail.icalEvent:t={content:this.mail.icalEvent},n=Object.assign({},t),n.contentType="application/ics",n.headers||(n.headers={}),n.filename=n.filename||"invite.ics",n.headers["Content-Disposition"]="attachment",n.headers["Content-Transfer-Encoding"]="base64"),e?{attached:i.filter(o=>!o.cid).concat(n||[]),related:i.filter(o=>!!o.cid)}:{attached:i.concat(n||[]),related:[]}}getAlternatives(){let e=[],t,n,i,o,a,s;return this.mail.text&&(typeof this.mail.text=="object"&&(this.mail.text.content||this.mail.text.path||this.mail.text.href||this.mail.text.raw)?t=this.mail.text:t={content:this.mail.text},t.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(typeof this.mail.watchHtml=="object"&&(this.mail.watchHtml.content||this.mail.watchHtml.path||this.mail.watchHtml.href||this.mail.watchHtml.raw)?i=this.mail.watchHtml:i={content:this.mail.watchHtml},i.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(typeof this.mail.amp=="object"&&(this.mail.amp.content||this.mail.amp.path||this.mail.amp.href||this.mail.amp.raw)?o=this.mail.amp:o={content:this.mail.amp},o.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(typeof this.mail.icalEvent=="object"&&(this.mail.icalEvent.content||this.mail.icalEvent.path||this.mail.icalEvent.href||this.mail.icalEvent.raw)?a=this.mail.icalEvent:a={content:this.mail.icalEvent},s=Object.assign({},a),s.content&&typeof s.content=="object"&&(s.content._resolve=!0),s.filename=!1,s.contentType="text/calendar; charset=utf-8; method="+(s.method||"PUBLISH").toString().trim().toUpperCase(),s.headers||(s.headers={})),this.mail.html&&(typeof this.mail.html=="object"&&(this.mail.html.content||this.mail.html.path||this.mail.html.href||this.mail.html.raw)?n=this.mail.html:n={content:this.mail.html},n.contentType="text/html; charset=utf-8"),[].concat(t||[]).concat(i||[]).concat(o||[]).concat(n||[]).concat(s||[]).concat(this.mail.alternatives||[]).forEach(c=>{/^data:/i.test(c.path||c.href)&&(c=this._processDataUrl(c));let p={contentType:c.contentType||Yr.detectMimeType(c.filename||c.path||c.href||"txt"),contentTransferEncoding:c.contentTransferEncoding};c.filename&&(p.filename=c.filename),/^https?:\/\//i.test(c.path)&&(c.href=c.path,c.path=void 0),c.raw?p.raw=c.raw:c.path?p.content={path:c.path}:c.href?p.content={href:c.href}:p.content=c.content||"",c.encoding&&(p.encoding=c.encoding),c.headers&&(p.headers=c.headers),e.push(p)}),e}_createMixed(e){let t=e?e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new ft("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(n=>{(!this._useRelated||n!==this._htmlNode)&&this._createContentNode(t,n)}),t}_createAlternative(e){let t=e?e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new ft("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(n=>{this._useRelated&&this._htmlNode===n?this._createRelated(t):this._createContentNode(t,n)}),t}_createRelated(e){let 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 ft('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(n=>this._createContentNode(t,n)),t}_createContentNode(e,t){t=t||{},t.content=t.content||"";let n=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,""),i=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 ft(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&&i.addHeader(t.headers),t.cid&&i.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">"),t.contentTransferEncoding?i.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(t.contentType)&&i.setHeader("Content-Transfer-Encoding",this.mail.encoding),(!/^text\//i.test(t.contentType)||t.contentDisposition)&&i.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment")),typeof t.content=="string"&&!["utf8","usascii","ascii"].includes(n)&&(t.content=Buffer.from(t.content,n)),t.raw?i.setRaw(t.raw):i.setContent(t.content),i}_processDataUrl(e){let t=e.path||e.href;if(!t||typeof t!="string"||!t.startsWith("data:"))return e;if(t.length>52428800){let i="application/octet-stream",o=t.indexOf(",");if(o>0&&o<200){let s=t.substring(5,o).split(";");s[0]&&s[0].includes("/")&&(i=s[0].trim())}return Object.assign({},e,{path:!1,href:!1,content:Buffer.alloc(0),contentType:e.contentType||i})}let n;try{n=du(t)}catch{return e}return n&&(e.content=n.data,e.contentType=e.contentType||n.contentType,"path"in e&&(e.path=!1),"href"in e&&(e.href=!1)),e}};Aa.exports=Qr});var ka=R((DA,$a)=>{"use strict";var{Transform:mu}=require("stream"),en=class extends mu{static{l(this,"MessageParser")}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){let t=this.lastBytes.length,n=Math.min(e.length,t);for(let i=0,o=t-n;i<o;i++)this.lastBytes[i]=this.lastBytes[i+n];for(let i=1;i<=n;i++)this.lastBytes[t-i]=e[e.length-i]}checkHeaders(e){if(this.headersParsed)return!0;let t=this.lastBytes.length,n=0;for(let i=0,o=this.lastBytes.length+e.length;i<o;i++){let a;if(i<t?a=this.lastBytes[i]:a=e[i-t],a===10&&i){let s=i-1<t?this.lastBytes[i-1]:e[i-1-t],c=i>1?i-2<t?this.lastBytes[i-2]:e[i-2-t]:!1;if(s===10){this.headersParsed=!0,n=i-t+1,this.headerBytes+=n;break}else if(s===13&&c===10){this.headersParsed=!0,n=i-t+1,this.headerBytes+=n;break}}}if(this.headersParsed){if(this.headerChunks.push(e.slice(0,n)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),e.length-1>n){let i=e.slice(n);this.bodySize+=i.length,setImmediate(()=>this.push(i))}return!1}return this.headerBytes+=e.length,this.headerChunks.push(e),this.updateLastBytes(e),!1}_transform(e,t,n){if(!e||!e.length)return n();typeof e=="string"&&(e=Buffer.from(e,t));let i;try{i=this.checkHeaders(e)}catch(o){return n(o)}i&&(this.bodySize+=e.length,this.push(e)),setImmediate(n)}_flush(e){if(this.headerChunks){let t=Buffer.concat(this.headerChunks,this.headerBytes);this.bodySize+=t.length,this.push(t),this.headerChunks=null}e()}parseHeaders(){let e=(this.rawHeaders||"").toString().split(/\r?\n/);for(let t=e.length-1;t>0;t--)/^\s/.test(e[t])&&(e[t-1]+=`
23
+ `+e[t],e.splice(t,1));return e.filter(t=>t.trim()).map(t=>({key:t.substr(0,t.indexOf(":")).trim().toLowerCase(),line:t}))}};$a.exports=en});var Ca=R((MA,Oa)=>{"use strict";var{Transform:fu}=require("stream"),hu=require("crypto"),tn=class extends fu{static{l(this,"RelaxedBody")}constructor(e){super(),e=e||{},this.chunkBuffer=[],this.chunkBufferLen=0,this.bodyHash=hu.createHash(e.hashAlgo||"sha1"),this.remainder="",this.byteLength=0,this.debug=e.debug,this._debugBody=e.debug?[]:!1}updateHash(e){let t,n="",i="file";for(let a=e.length-1;a>=0;a--){let s=e[a];if(!(i==="file"&&(s===10||s===13))){if(i==="file"&&(s===9||s===32))i="line";else if(!(i==="line"&&(s===9||s===32))){if((i==="file"||i==="line")&&(i="body",a===e.length-1))break}}if(a===0){if(i==="file"&&(!this.remainder||/[\r\n]$/.test(this.remainder))||i==="line"&&(!this.remainder||/[ \t]$/.test(this.remainder))){this.remainder+=e.toString("binary");return}else if(i==="line"||i==="file"){n=e.toString("binary"),e=!1;break}}if(i==="body"){n=e.slice(a+1).toString("binary"),e=e.slice(0,a+1);break}}let o=!!this.remainder;if(e&&!o){for(let a=0,s=e.length;a<s;a++)if(a&&e[a]===10&&e[a-1]!==13){o=!0;break}else if(a&&e[a]===13&&e[a-1]===32){o=!0;break}else if(a&&e[a]===32&&e[a-1]===32){o=!0;break}else if(e[a]===9){o=!0;break}}o?(t=this.remainder+(e?e.toString("binary"):""),this.remainder=n,t=t.replace(/\r?\n/g,`
24
+ `).replace(/[ \t]*$/gm,"").replace(/[ \t]+/gm," ").replace(/\n/g,`\r
25
+ `),e=Buffer.from(t,"binary")):n&&(this.remainder=n),this.debug&&this._debugBody.push(e),this.bodyHash.update(e)}_transform(e,t,n){if(!e||!e.length)return n();typeof e=="string"&&(e=Buffer.from(e,t)),this.updateHash(e),this.byteLength+=e.length,this.push(e),n()}_flush(e){/[\r\n]$/.test(this.remainder)&&this.byteLength>2&&this.bodyHash.update(Buffer.from(`\r
26
+ `)),this.byteLength||this.push(Buffer.from(`\r
27
+ `)),this.emit("hash",this.bodyHash.digest("base64"),this.debug?Buffer.concat(this._debugBody):!1),e()}};Oa.exports=tn});var Da=R((LA,rn)=>{"use strict";var gu=Mr(),xu=dt(),vu=require("crypto");rn.exports=(r,e,t,n)=>{n=n||{};let o=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",a=Na(r,o,n.skipFields),s=yu(n.domainName,n.keySelector,a.fieldNames,e,t);a.headers+="dkim-signature:"+Ra(s);let c=vu.createSign(("rsa-"+e).toUpperCase());c.update(a.headers);let p;try{p=c.sign(n.privateKey,"base64")}catch{return!1}return s+p.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,`$&\r
28
+ `).trim()};rn.exports.relaxedHeaders=Na;function yu(r,e,t,n,i){let o=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+gu.toASCII(r),"q=dns/txt","s="+e,"bh="+i,"h="+t].join("; ");return xu.foldLines("DKIM-Signature: "+o,76)+`;\r
29
+ b=`}l(yu,"generateDKIMHeader");function Na(r,e,t){let n=new Set,i=new Set,o=new Map;(t||"").toLowerCase().split(":").forEach(c=>{i.add(c.trim())}),(e||"").toLowerCase().split(":").filter(c=>!i.has(c.trim())).forEach(c=>{n.add(c.trim())});for(let c=r.length-1;c>=0;c--){let p=r[c];n.has(p.key)&&!o.has(p.key)&&o.set(p.key,Ra(p.line))}let a=[],s=[];return n.forEach(c=>{o.has(c)&&(s.push(c),a.push(c+":"+o.get(c)))}),{headers:a.join(`\r
30
+ `)+`\r
31
+ `,fieldNames:s.join(":")}}l(Na,"relaxedHeaders");function Ra(r){return r.substr(r.indexOf(":")+1).replace(/\r?\n/g,"").replace(/\s+/g," ").trim()}l(Ra,"relaxedHeaderLine")});var Ma=R((BA,Ua)=>{"use strict";var _u=ka(),bu=Ca(),Eu=Da(),{PassThrough:nn}=require("stream"),on=require("fs"),Pu=require("path"),Tu=require("crypto"),Su="sha256",Iu=2*1024*1024,an=class{static{l(this,"DKIMSigner")}constructor(e,t,n,i){this.options=e||{},this.keys=t,this.cacheTreshold=Number(this.options.cacheTreshold)||Iu,this.hashAlgo=this.options.hashAlgo||Su,this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=this.cacheDir?Pu.join(this.cacheDir,"message."+Date.now()+"-"+Tu.randomBytes(14).toString("hex")):!1,this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=n,this.output=i,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",o=>{this.hasErrored=!0,this.cleanup(),i.emit("error",o)})}cleanup(){!this.cache||!this.cachePath||on.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=on.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():this.output.end();let e=this.chunks[this.readPos++];if(this.output.write(e)===!1)return this.output.once("drain",()=>{this.sendNextChunk()});setImmediate(()=>this.sendNextChunk())}sendSignedOutput(){let e=0,t=l(()=>{if(e>=this.keys.length)return this.output.write(this.parser.rawHeaders),setImmediate(()=>this.sendNextChunk());let n=this.keys[e++],i=Eu(this.headers,this.hashAlgo,this.bodyHash,{domainName:n.domainName,keySelector:n.keySelector,privateKey:n.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields});return i&&this.output.write(Buffer.from(i+`\r
32
+ `)),setImmediate(t)},"signNextKey");if(this.bodyHash&&this.headers)return t();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=on.createWriteStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;this.relaxedBody.read()!==null;);}),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 _u,this.relaxedBody=new bu({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(;(e=this.relaxedBody.read())!==null;)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))}},sn=class{static{l(this,"DKIM")}constructor(e){this.options=e||{},this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){let n=new nn,i=e,o=!1;Buffer.isBuffer(e)?(o=e,i=new nn):typeof e=="string"&&(o=Buffer.from(e),i=new nn);let a=this.options;t&&Object.keys(t).length&&(a=Object.assign({},t,this.options));let s=new an(a,this.keys,i,n);return setImmediate(()=>{s.signStream(),o&&setImmediate(()=>{i.end(o)})}),n}};Ua.exports=sn});var Za=R((HA,Ba)=>{"use strict";var ja=require("net"),La=require("tls"),wu=require("url"),Au=ne();function Fa(r,e,t,n){let i=wu.parse(r),o={host:i.hostname,port:Number(i.port)?Number(i.port):i.protocol==="https:"?443:80},a;i.protocol==="https:"?(o.rejectUnauthorized=!1,a=La.connect.bind(La)):a=ja.connect.bind(ja);let s,c=!1,p=l(x=>{if(!c){c=!0;try{s.destroy()}catch{}n(x)}},"tempSocketErr"),f=l(()=>{let x=new Error("Proxy socket timed out");x.code="ETIMEDOUT",p(x)},"timeoutErr");s=a(o,()=>{if(c)return;let x={Host:t+":"+e,Connection:"close"};i.auth&&(x["Proxy-Authorization"]="Basic "+Buffer.from(i.auth).toString("base64")),s.write("CONNECT "+t+":"+e+` HTTP/1.1\r
33
+ `+Object.keys(x).map(h=>h+": "+x[h]).join(`\r
34
+ `)+`\r
35
+ \r
36
+ `);let m="",d=l(h=>{let y,v;if(!c&&(m+=h.toString("binary"),y=m.match(/\r\n\r\n/))){if(s.removeListener("data",d),v=m.substr(y.index+y[0].length),m=m.substr(0,y.index),v&&s.unshift(Buffer.from(v,"binary")),c=!0,y=m.match(/^HTTP\/\d+\.\d+ (\d+)/i),!y||(y[1]||"").charAt(0)!=="2"){try{s.destroy()}catch{}let b=new Error("Invalid response from proxy"+(y&&": "+y[1]||""));return b.code=Au.EPROXY,n(b)}return s.removeListener("error",p),s.removeListener("timeout",f),s.setTimeout(0),n(null,s)}},"onSocketData");s.on("data",d)}),s.setTimeout(Fa.timeout||30*1e3),s.on("timeout",f),s.once("error",p)}l(Fa,"httpProxyClient");Ba.exports=Fa});var qa=R((qA,Va)=>{"use strict";var Ha=K(),zu=Ft(),Le=dt(),cn=class{static{l(this,"MailMessage")}constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};let n=e.options||{},i=e._defaults||{};Object.assign(this.data,t),this.data.headers=this.data.headers||{},Object.keys(i).forEach(o=>{o in this.data?o==="headers"&&Object.keys(i.headers).forEach(a=>{a in this.data.headers||(this.data.headers[a]=i.headers[a])}):this.data[o]=i[o]}),["disableFileAccess","disableUrlAccess","normalizeHeaderKey"].forEach(o=>{o in n&&(this.data[o]=n[o])})}resolveContent(...e){return Ha.resolveContent(...e)}resolveAll(e){let 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((c,p)=>{t.push([this.data.alternatives,p])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((c,p)=>{c.filename||(c.filename=(c.path||c.href||"").split("/").pop().split("?").shift()||"attachment-"+(p+1),c.filename.indexOf(".")<0&&(c.filename+="."+Le.detectExtension(c.contentType))),c.contentType||(c.contentType=Le.detectMimeType(c.filename||c.path||c.href||"bin")),t.push([this.data.attachments,p])});let n=new zu;["from","to","cc","bcc","sender","replyTo"].forEach(c=>{let p;this.message?p=[].concat(n._parseAddresses(this.message.getHeader(c==="replyTo"?"reply-to":c))||[]):this.data[c]&&(p=[].concat(n._parseAddresses(this.data[c])||[])),p&&p.length?this.data[c]=p:c in this.data&&(this.data[c]=null)}),["from","sender"].forEach(c=>{this.data[c]&&(this.data[c]=this.data[c].shift())});let a=0,s=l(()=>{if(a>=t.length)return e(null,this.data);let c=t[a++];if(!c[0]||!c[0][c[1]])return s();Ha.resolveContent(...c,(p,f)=>{if(p)return e(p);let x={content:f};c[0][c[1]]&&typeof c[0][c[1]]=="object"&&!Buffer.isBuffer(c[0][c[1]])&&Object.keys(c[0][c[1]]).forEach(m=>{!(m in x)&&!["content","path","href","raw"].includes(m)&&(x[m]=c[0][c[1]][m])}),c[0][c[1]]=x,s()})},"resolveNext");setImmediate(()=>s())}normalize(e){let t=this.data.envelope||this.message.getEnvelope(),n=this.message.messageId();this.resolveAll((i,o)=>i?e(i):(o.envelope=t,o.messageId=n,["html","text","watchHtml","amp"].forEach(a=>{o[a]&&o[a].content&&(typeof o[a].content=="string"?o[a]=o[a].content:Buffer.isBuffer(o[a].content)&&(o[a]=o[a].content.toString()))}),o.icalEvent&&Buffer.isBuffer(o.icalEvent.content)&&(o.icalEvent.content=o.icalEvent.content.toString("base64"),o.icalEvent.encoding="base64"),o.alternatives&&o.alternatives.length&&o.alternatives.forEach(a=>{a&&a.content&&Buffer.isBuffer(a.content)&&(a.content=a.content.toString("base64"),a.encoding="base64")}),o.attachments&&o.attachments.length&&o.attachments.forEach(a=>{a&&a.content&&Buffer.isBuffer(a.content)&&(a.content=a.content.toString("base64"),a.encoding="base64")}),o.normalizedHeaders={},Object.keys(o.headers||{}).forEach(a=>{let s=[].concat(o.headers[a]||[]).shift();s=s&&s.value||s,s&&(["references","in-reply-to","message-id","content-id"].includes(a)&&(s=this.message._encodeHeaderValue(a,s)),o.normalizedHeaders[a]=s)}),o.list&&typeof o.list=="object"&&this._getListHeaders(o.list).forEach(s=>{o.normalizedHeaders[s.key]=s.value.map(c=>c&&c.value||c).join(", ")}),o.references&&(o.normalizedHeaders.references=this.message._encodeHeaderValue("references",o.references)),o.inReplyTo&&(o.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",o.inReplyTo)),e(null,o)))}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");break;default:}}setListHeaders(){!this.message||!this.data.list||typeof this.data.list!="object"||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(n=>({prepared:!0,foldLines:!0,value:[].concat(n||[]).map(i=>{if(typeof i=="string"&&(i={url:i}),i&&i.url){if(t.toLowerCase().trim()==="id"){let a=i.comment||"";return Le.isPlainText(a)?a='"'+a+'"':a=Le.encodeWord(a),(i.comment?a+" ":"")+this._formatListUrl(i.url).replace(/^<[^:]+\/{,2}/,"")}let o=i.comment||"";return Le.isPlainText(o)||(o=Le.encodeWord(o)),this._formatListUrl(i.url)+(i.comment?" ("+o+")":"")}return""}).filter(i=>i).join(", ")}))}))}_formatListUrl(e){return e=e.replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}};Va.exports=cn});var Xa=R((WA,Ja)=>{"use strict";var $u=require("events"),Ga=K(),ku=Rr(),Ou=za(),Wa=Ma(),Cu=Za(),Ka=ne(),Nu=require("util"),Ru=require("url"),pn=re(),Du=qa(),Uu=require("net"),Mu=require("dns"),ju=require("crypto"),ln=class extends $u{static{l(this,"Mail")}constructor(e,t,n){super(),this.options=t||{},this._defaults=n||{},this._defaultPlugins={compile:[(...i)=>this._convertDataImages(...i)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=this.options.dkim?new Wa(this.options.dkim):!1,this.transporter=e,this.transporter.mailer=this,this.logger=Ga.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),typeof this.transporter.on=="function"&&(this.transporter.on("log",i=>{this.logger.debug({tnx:"transport"},"%s: %s",i.type,i.message)}),this.transporter.on("error",i=>{this.logger.error({err:i,tnx:"transport"},"Transport Error: %s",i.message),this.emit("error",i)}),this.transporter.on("idle",(...i)=>{this.emit("idle",...i)}),this.transporter.on("clear",(...i)=>{this.emit("clear",...i)})),["close","isIdle","verify"].forEach(i=>{this[i]=(...o)=>typeof this.transporter[i]=="function"?(i==="verify"&&typeof this.getSocket=="function"&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[i](...o)):(this.logger.warn({tnx:"transport",methodName:i},"Non existing method %s called for transport",i),!1)}),this.options.proxy&&typeof this.options.proxy=="string"&&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 n;t||(n=new Promise((o,a)=>{t=Ga.callbackPromise(o,a)})),typeof this.getSocket=="function"&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);let i=new Du(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",i,o=>{if(o)return this.logger.error({err:o,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",o.message),t(o);i.message=new Ou(i.data).compile(),i.setMailerHeader(),i.setPriorityHeaders(),i.setListHeaders(),this._processPlugins("stream",i,a=>{if(a)return this.logger.error({err:a,tnx:"plugin",action:"stream"},"PluginStream Error: %s",a.message),t(a);(i.data.dkim||this.dkim)&&i.message.processFunc(s=>{let c=i.data.dkim?new Wa(i.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:i.message.messageId(),dkimDomains:c.keys.map(p=>p.keySelector+"."+p.domainName).join(", ")},"Signing outgoing message with %s keys",c.keys.length),c.sign(s,i.data._dkim)}),this.transporter.send(i,(...s)=>{s[0]&&this.logger.error({err:s[0],tnx:"transport",action:"send"},"Send Error: %s",s[0].message),t(...s)})})}),n}getVersionString(){return Nu.format("%s (%s; +%s; %s/%s)",pn.name,pn.version,pn.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,n){if(e=(e||"").toString(),!this._userPlugins.hasOwnProperty(e))return n();let i=this._userPlugins[e]||[],o=this._defaultPlugins[e]||[];if(i.length&&this.logger.debug({tnx:"transaction",pluginCount:i.length,step:e},"Using %s plugins for %s",i.length,e),i.length+o.length===0)return n();let a=0,s="default",c=l(()=>{let p=s==="default"?o:i;if(a>=p.length)if(s==="default"&&i.length)s="user",a=0,p=i;else return n();let f=p[a++];f(t,x=>{if(x)return n(x);c()})},"processPlugins");c()}setupProxy(e){let t=Ru.parse(e);this.getSocket=(n,i)=>{let o=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+o))return this.meta.get("proxy_handler_"+o)(t,n,i);switch(o){case"http":case"https":Cu(t.href,n.port,n.host,(s,c)=>s?i(s):i(null,{connection:c}));return;case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){let c=new Error("Socks module not loaded");return c.code=Ka.EPROXY,i(c)}let s=l(c=>{let p=!!this.meta.get("proxy_socks_module").SocksClient,f=p?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),x=Number(t.protocol.replace(/\D/g,""))||5,m={proxy:{ipaddress:c,port:Number(t.port),type:x},[p?"destination":"target"]:{host:n.host,port:n.port},command:"connect"};if(t.auth){let d=decodeURIComponent(t.auth.split(":").shift()),h=decodeURIComponent(t.auth.split(":").pop());p?(m.proxy.userId=d,m.proxy.password=h):x===4?m.userid=d:m.authentication={username:d,password:h}}f.createConnection(m,(d,h)=>d?i(d):i(null,{connection:h.socket||h}))},"connect");return Uu.isIP(t.hostname)?s(t.hostname):Mu.resolve(t.hostname,(c,p)=>{if(c)return i(c);s(Array.isArray(p)?p[0]:p)})}}let a=new Error("Unknown proxy configuration");a.code=Ka.EPROXY,i(a)}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html)return t();e.resolveContent(e.data,"html",(n,i)=>{if(n)return t(n);let o=0;i=(i||"").toString().replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi,(a,s,c,p)=>{let f=ju.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:c,cid:f,filename:"image-"+ ++o+"."+ku.detectExtension(p)}),s+"cid:"+f}),e.data.html=i,t()})}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}};Ja.exports=ln});var Qa=R((JA,Ya)=>{"use strict";var{Transform:Lu}=require("stream"),un=class extends Lu{static{l(this,"DataStream")}constructor(e){super(e),this.options=e||{},this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(e,t,n){let i=[],o=0,a,s,c=0,p;if(!e||!e.length)return n();for(typeof e=="string"&&(e=Buffer.from(e)),this.inByteCount+=e.length,a=0,s=e.length;a<s;a++)e[a]===46?(a&&e[a-1]===10||!a&&(!this.lastByte||this.lastByte===10))&&(p=e.slice(c,a+1),i.push(p),i.push(Buffer.from(".")),o+=p.length+1,c=a+1):e[a]===10&&(a&&e[a-1]!==13||!a&&this.lastByte!==13)&&(a>c?(p=e.slice(c,a),i.push(p),o+=p.length+2):o+=2,i.push(Buffer.from(`\r
37
+ `)),c=a+1);o?(c<e.length&&(p=e.slice(c),i.push(p),o+=p.length),this.outByteCount+=o,this.push(Buffer.concat(i,o))):(this.outByteCount+=e.length,this.push(e)),this.lastByte=e[e.length-1],n()}_flush(e){let t;this.lastByte===10?t=Buffer.from(`.\r
38
+ `):this.lastByte===13?t=Buffer.from(`
39
+ .\r
40
+ `):t=Buffer.from(`\r
41
+ .\r
42
+ `),this.outByteCount+=t.length,this.push(t),e()}};Ya.exports=un});var Bt=R((YA,as)=>{"use strict";var Fu=re(),{EventEmitter:Bu}=require("events"),es=require("net"),ts=require("tls"),Zu=require("os"),rs=require("crypto"),Hu=Qa(),{PassThrough:ns}=require("stream"),$e=K(),Vu=120*1e3,is=600*1e3,qu=30*1e3,Gu=30*1e3,Wu=l(()=>{},"TEARDOWN_NOOP");function os(r){if(!r)return r;let e=Buffer.from(r,"binary").toString("utf8");return e.includes("\uFFFD")?r:e}l(os,"decodeServerResponse");var dn=class extends Bu{static{l(this,"SMTPConnection")}constructor(e){super(e),this.id=rs.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=e||{},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:es.isIP(this.host)?!1:this.host,this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,typeof this.options.secure>"u"&&this.port===465&&(this.secureConnection=!0),this.name=(this.options.name||this._getHostname()).toString().replace(/[\r\n]+/g,""),this.logger=$e.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map;for(let t of Object.keys(this.options.customAuth||{})){let n=(t||"").toString().trim().toUpperCase();n&&this.customAuth.set(n,this.options.customAuth[t])}this.version=Fu.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],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._onSocketData=t=>this._onData(t),this._onSocketError=t=>this._onError(t,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout(),this._onConnectionSocketError=t=>this._onConnectionError(t,"ESOCKET"),this._connectionAttemptId=0}connect(e){if(typeof e=="function"){this.once("connect",()=>{this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),e()});let n=this._isDestroyedMessage("connect");if(n)return e(this._formatError(n,"ECONNECTION",!1,"CONN"))}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||Gu};if(this.options.localAddress&&(t.localAddress=this.options.localAddress),this.options.connection){this._socket=this.options.connection,this._setupConnectionHandlers(),this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(n=>{if(n){this._onError(new Error("Error initiating TLS - "+(n.message||n)),"ETLS",!1,"CONN");return}this._onConnect()})):setImmediate(()=>this._onConnect());return}else return this.options.socket?(this._socket=this.options.socket,this._resolveAndConnect(t,n=>{try{this._socket.connect(this.port,this.host,()=>{this._socket.setKeepAlive(!0),this._onConnect()}),this._setupConnectionHandlers()}catch(i){return setImmediate(()=>this._onError(i,"ECONNECTION",!1,"CONN"))}})):(this.secureConnection&&(Object.assign(t,this.options.tls||{}),this.servername&&!t.servername&&(t.servername=this.servername)),this._resolveAndConnect(t,n=>{this._fallbackAddresses=(n._addresses||[]).filter(i=>i!==t.host),this._connectOpts=Object.assign({},t),this._connectToHost(t,this.secureConnection)}))}_resolveAndConnect(e,t){return $e.resolveHostname(e,(n,i)=>{if(n)return setImmediate(()=>this._onError(n,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:i.host,cached:!!i.cached},"Resolved %s as %s [cache %s]",e.host,i.host,i.cached?"hit":"miss");for(let o of Object.keys(i))o.charAt(0)!=="_"&&i[o]&&(e[o]=i[o]);t(i)})}_connectToHost(e,t){this._connectionAttemptId++;let n=this._connectionAttemptId,i=t?ts.connect:es.connect;try{this._socket=i(e,()=>{this._connectionAttemptId===n&&(this._socket.setKeepAlive(!0),this._onConnect())}),this._setupConnectionHandlers()}catch(o){return setImmediate(()=>this._onError(o,"ECONNECTION",!1,"CONN"))}}_setupConnectionHandlers(){this._connectionTimeout=setTimeout(()=>{this._onConnectionError("Connection timeout","ETIMEDOUT")},this.options.connectionTimeout||Vu),this._socket.on("error",this._onConnectionSocketError)}_onConnectionError(e,t){if(clearTimeout(this._connectionTimeout),!(this._fallbackAddresses&&this._fallbackAddresses.length&&this.stage==="init"&&!this._destroyed)){this._onError(e,t,!1,"CONN");return}let 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.destroy()}catch{}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;let e=this.stage==="init"?"destroy":"end";this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);let t=this._socket&&this._socket.socket||this._socket;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",Wu),t[e]()}catch{}this._destroy()}login(e,t){let n=this._isDestroyedMessage("login");if(n)return t(this._formatError(n,"ECONNECTION",!1,"API"));if(this._auth=e||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1,!this._authMethod&&this._auth.oauth2&&!this._auth.credentials?this._authMethod="XOAUTH2":(!this._authMethod||this._authMethod==="XOAUTH2"&&!this._auth.oauth2)&&(this._authMethod=(this._supportedAuth[0]||"PLAIN").toUpperCase().trim()),this._authMethod!=="XOAUTH2"&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass))if(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod))this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options};else return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));if(this.customAuth.has(this._authMethod)){let i=this.customAuth.get(this._authMethod),o,a=!1,s=l(()=>{a||(a=!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))},"resolve"),c=l(f=>{a||(a=!0,t(this._formatError(f,"EAUTH",o,"AUTH "+this._authMethod)))},"reject"),p=i({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:l((f,x)=>{let m;return x||(m=new Promise((d,h)=>{x=$e.callbackPromise(d,h)})),this._responseActions.push(d=>{o=d;let h=d.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),y={command:f,response:d};h?(y.status=Number(h[1])||0,h[2]&&(y.code=h[2]),y.text=d.substr(h[0].length)):(y.text=d,y.status=0),x(null,y)}),setImmediate(()=>this._sendCommand(f)),m},"sendCommand"),resolve:s,reject:c});p&&typeof p.catch=="function"&&p.then(s).catch(c);return}switch(this._authMethod){case"XOAUTH2":this._handleXOauth2Token(!1,t);return;case"LOGIN":this._responseActions.push(i=>{this._actionAUTH_LOGIN_USER(i,t)}),this._sendCommand("AUTH LOGIN");return;case"PLAIN":this._responseActions.push(i=>{this._actionAUTHComplete(i,t)}),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"));return;case"CRAM-MD5":this._responseActions.push(i=>{this._actionAUTH_CRAM_MD5(i,t)}),this._sendCommand("AUTH CRAM-MD5");return}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(e,t,n){if(!t)return n(this._formatError("Empty message","EMESSAGE",!1,"API"));let i=this._isDestroyedMessage("send message");if(i)return n(this._formatError(i,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&e.size>this._maxAllowedSize)return setImmediate(()=>{n(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});let o=!1,a=l(function(){o||(o=!0,n(...arguments))},"callback");typeof t.on=="function"&&t.on("error",c=>a(this._formatError(c,"ESTREAM",!1,"API")));let s=Date.now();this._setEnvelope(e,(c,p)=>{if(c){let m=new ns;return typeof t.pipe=="function"?t.pipe(m):(m.write(t),m.end()),a(c)}let f=Date.now(),x=this._createSendStream((m,d)=>m?a(m):(p.envelopeTime=f-s,p.messageTime=Date.now()-f,p.messageSize=x.outByteCount,p.response=d,a(null,p)));typeof t.pipe=="function"?t.pipe(x):(x.write(t),x.end())})}reset(e){this._sendCommand("RSET"),this._responseActions.push(t=>t.charAt(0)!=="2"?e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET")):(this._envelope=!1,e(null,!0)))}_onConnect(){if(clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:this._socket.localAddress,localPort:this._socket.localPort,remoteAddress:this._socket.remoteAddress,remotePort:this._socket.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",this._socket.remoteAddress,this._socket.remotePort),this._destroyed){this.close();return}this.stage="connected",this._socket.removeListener("data",this._onSocketData),this._socket.removeListener("timeout",this._onSocketTimeout),this._socket.removeListener("close",this._onSocketClose),this._socket.removeListener("end",this._onSocketEnd),this._socket.removeListener("error",this._onConnectionSocketError),this._socket.on("error",this._onSocketError),this._socket.on("data",this._onSocketData),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||is),this._socket.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||qu),this._responseActions.push(this._actionGreeting),this._socket.resume()}_onData(e){if(this._destroyed||!e||!e.length)return;let t=(e||"").toString("binary"),n=(this._remainder+t).split(/\r?\n/),i;this._remainder=n.pop();for(let o=0,a=n.length;o<a;o++){if(this._responseQueue.length&&(i=this._responseQueue[this._responseQueue.length-1],/^\d+-/.test(i.split(`
43
+ `).pop()))){this._responseQueue[this._responseQueue.length-1]+=`
44
+ `+n[o];continue}this._responseQueue.push(n[o])}this._responseQueue.length&&(i=this._responseQueue[this._responseQueue.length-1],/^\d+-/.test(i.split(`
45
+ `).pop()))||this._processResponse()}_onError(e,t,n,i){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._destroyed)return;e=this._formatError(e,t,n,i),["ETIMEDOUT","ESOCKET","ECONNECTION"].includes(e.code)?this.logger.warn(n,e.message):this.logger.error(n,e.message),this.emit("error",e),this.close()}_formatError(e,t,n,i){let o;/Error\]$/i.test(Object.prototype.toString.call(e))?o=e:o=new Error(e),t&&t!=="Error"&&(o.code=t),n&&(o.response=n,o.message+=": "+n);let a=typeof n=="string"&&Number((n.match(/^\d+/)||[])[0])||!1;return a&&(o.responseCode=a),i&&(o.command=i),o}_onClose(){let e=!1;if(this._remainder&&this._remainder.trim()&&(this.lastServerResponse=e=os(this._remainder.trim()),(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e)),this.logger.info({tnx:"network"},"Connection closed"),this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",e,"CONN");if(![this._actionGreeting,this.close].includes(this._responseActions[0])&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",e,"CONN");if(/^[45]\d{2}\b/.test(e))return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",e,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.destroy()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.emit("end"))}_upgradeConnection(e){this._socket.removeListener("data",this._onSocketData),this._socket.removeListener("timeout",this._onSocketTimeout);let t=this._socket,n=Object.assign({socket:this._socket,host:this.host},this.options.tls||{});this.servername&&!n.servername&&(n.servername=this.servername),this.upgrading=!0;try{this._socket=ts.connect(n,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),e(null,!0)))}catch(i){return e(i)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||is),this._socket.on("timeout",this._onSocketTimeout),t.resume()}_processResponse(){if(!this._responseQueue.length)return!1;let e=this.lastServerResponse=os((this._responseQueue.shift()||"").toString());if(/^\d+-/.test(e.split(`
46
+ `).pop()))return;(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e.replace(/\r?\n$/,"")),e.trim()||setImmediate(()=>this._processResponse());let t=this._responseActions.shift();if(typeof t=="function")t.call(this,e),setImmediate(()=>this._processResponse());else return this._onError(new Error("Unexpected Response"),"EPROTOCOL",e,"CONN")}_sendCommand(e,t){if(!this._destroyed){if(this._socket.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,"")),this._socket.write(Buffer.from(e+`\r
47
+ `,"utf-8"))}}_setEnvelope(e,t){let n=[],i=!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(o=>(o&&o.address||o||"").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)&&(i=!0);for(let o=0,a=this._envelope.to.length;o<a;o++){if(!this._envelope.to[o]||/[\r\n<>]/.test(this._envelope.to[o]))return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[o]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[o])&&(i=!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(o){return t(this._formatError("Invalid DSN "+o.message,"EENVELOPE",!1,"API"))}if(this._responseActions.push(o=>{this._actionMAIL(o,t)}),i&&this._supportedExtensions.includes("SMTPUTF8")&&(n.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(n.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")){let o=Number(this._envelope.size)||0;o>0&&n.push("SIZE="+o)}if(this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&n.push("RET="+$e.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&n.push("ENVID="+$e.encodeXText(this._envelope.dsn.envid))),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"));n.push("REQUIRETLS")}this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(n.length?" "+n.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";break}if(t&&!["FULL","HDRS"].includes(t))throw new Error("ret: "+JSON.stringify(t));let n=(e.envid||e.id||"").toString()||null,i=e.notify||null;if(i){typeof i=="string"&&(i=i.split(",")),i=i.map(c=>c.trim().toUpperCase());let a=["NEVER","SUCCESS","FAILURE","DELAY"];if(i.filter(c=>!a.includes(c)).length||i.length>1&&i.includes("NEVER"))throw new Error("notify: "+JSON.stringify(i.join(",")));i=i.join(",")}let o=(e.recipient||e.orcpt||"").toString()||null;return o&&o.indexOf(";")<0&&(o="rfc822;"+o),{ret:t,envid:n,notify:i,orcpt:o}}_getDsnRcptToArgs(){let e=[];return this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.notify&&e.push("NOTIFY="+$e.encodeXText(this._envelope.dsn.notify)),this._envelope.dsn.orcpt&&e.push("ORCPT="+$e.encodeXText(this._envelope.dsn.orcpt))),e.length?" "+e.join(" "):""}_createSendStream(e){let t=new Hu;if(this.options.lmtp?this._envelope.accepted.forEach((n,i)=>{let o=i===this._envelope.accepted.length-1;this._responseActions.push(a=>{this._actionLMTPStream(n,o,a,e)})}):this._responseActions.push(n=>{this._actionSMTPStream(n,e)}),t.pipe(this._socket,{end:!1}),this.options.debug){let n=new ns;n.on("readable",()=>{let i;for(;i=n.read();)this.logger.debug({tnx:"message"},i.toString("binary").replace(/\r?\n$/,""))}),t.pipe(n)}return t.once("end",()=>{this.logger.info({tnx:"message",inByteCount:t.inByteCount,outByteCount:t.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",t.outByteCount,t.inByteCount)}),t}_actionGreeting(e){if(clearTimeout(this._greetingTimeout),e.substr(0,3)!=="220"){this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN");return}this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name))}_actionLHLO(e){if(e.charAt(0)!=="2"){this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO");return}this._actionEHLO(e)}_actionEHLO(e){let t;if(e.substr(0,3)==="421"){this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");return}if(e.charAt(0)!=="2"){if(this.options.requireTLS){this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO");return}this._responseActions.push(this._actionHELO),this._sendCommand("HELO "+this.name);return}if(this._ehloLines=e.split(/\r?\n/).map(n=>n.replace(/^\d+[ -]/,"").trim()).filter(n=>n).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS)){this._sendCommand("STARTTLS"),this._responseActions.push(this._actionSTARTTLS);return}/[ -]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),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)PLAIN/i.test(e)&&this._supportedAuth.push("PLAIN"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)LOGIN/i.test(e)&&this._supportedAuth.push("LOGIN"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)CRAM-MD5/i.test(e)&&this._supportedAuth.push("CRAM-MD5"),/[ -]AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH2/i.test(e)&&this._supportedAuth.push("XOAUTH2"),(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(t[1])||0),this.emit("connect")}_actionHELO(e){if(e.charAt(0)!=="2"){this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO");return}this.allowsAuth=!0,this.emit("connect")}_actionSTARTTLS(e){if(e.charAt(0)!=="2"){if(this.options.opportunisticTLS)return this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),this.emit("connect");this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");return}this._upgradeConnection((t,n)=>{if(t){this._onError(new Error("Error initiating TLS - "+(t.message||t)),"ETLS",!1,"STARTTLS");return}this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),n?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){if(!/^334[ -]/.test(e)){t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"));return}this._responseActions.push(n=>{this._actionAUTH_LOGIN_PASS(n,t)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))}_actionAUTH_CRAM_MD5(e,t){let n=e.match(/^334\s+(.+)$/);if(!n)return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"));let i=Buffer.from(n[1],"base64").toString("ascii"),o=rs.createHmac("md5",this._auth.credentials.pass);o.update(i);let a=this._auth.credentials.user+" "+o.digest("hex");this._responseActions.push(s=>{this._actionAUTH_CRAM_MD5_PASS(s,t)}),this._sendCommand(Buffer.from(a).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(n=>{this._actionAUTHComplete(n,t)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,n){if(!n&&typeof t=="function"&&(n=t,t=!1),e.substr(0,3)==="334"){this._responseActions.push(i=>{t||this._authMethod!=="XOAUTH2"?this._actionAUTHComplete(i,!0,n):setImmediate(()=>this._handleXOauth2Token(!0,n))}),this._sendCommand("");return}if(e.charAt(0)!=="2")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)),n(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,n(null,!0)}_actionMAIL(e,t){if(Number(e.charAt(0))!==2){let i=this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(this._envelope.from)?"Internationalized mailbox name not allowed":"Mail command failed";return t(this._formatError(i,"EENVELOPE",e,"MAIL FROM"))}if(!this._envelope.rcptQueue.length)return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"));this._recipientQueue=[];let n=this._supportedExtensions.includes("PIPELINING");do{let i=this._envelope.rcptQueue.shift();this._recipientQueue.push(i),this._responseActions.push(o=>{this._actionRCPT(o,t)}),this._sendCommand("RCPT TO:<"+i+">"+this._getDsnRcptToArgs())}while(n&&this._envelope.rcptQueue.length)}_actionRCPT(e,t){let n,i=this._recipientQueue.shift();if(Number(e.charAt(0))!==2){let o=this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(i)?"Internationalized mailbox name not allowed":"Recipient command failed";this._envelope.rejected.push(i),n=this._formatError(o,"EENVELOPE",e,"RCPT TO"),n.recipient=i,this._envelope.rejectedErrors.push(n)}else this._envelope.accepted.push(i);if(!this._envelope.rcptQueue.length&&!this._recipientQueue.length)if(this._envelope.rejected.length<this._envelope.to.length)this._responseActions.push(o=>{this._actionDATA(o,t)}),this._sendCommand("DATA");else return n=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",e,"RCPT TO"),n.rejected=this._envelope.rejected,n.rejectedErrors=this._envelope.rejectedErrors,t(n);else if(this._envelope.rcptQueue.length){let o=this._envelope.rcptQueue.shift();this._recipientQueue.push(o),this._responseActions.push(a=>{this._actionRCPT(a,t)}),this._sendCommand("RCPT TO:<"+o+">"+this._getDsnRcptToArgs())}}_actionDATA(e,t){if(!/^[23]/.test(e))return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"));let n={accepted:this._envelope.accepted,rejected:this._envelope.rejected};this._ehloLines&&this._ehloLines.length&&(n.ehlo=this._ehloLines),this._envelope.rejectedErrors.length&&(n.rejectedErrors=this._envelope.rejectedErrors),t(null,n)}_actionSMTPStream(e,t){return Number(e.charAt(0))!==2?t(this._formatError("Message failed","EMESSAGE",e,"DATA")):t(null,e)}_actionLMTPStream(e,t,n,i){let o;if(Number(n.charAt(0))!==2){o=this._formatError("Message failed for recipient "+e,"EMESSAGE",n,"DATA"),o.recipient=e,this._envelope.rejected.push(e),this._envelope.rejectedErrors.push(o);for(let a=0,s=this._envelope.accepted.length;a<s;a++)this._envelope.accepted[a]===e&&this._envelope.accepted.splice(a,1)}if(t)return i(null,n)}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,(n,i)=>{if(n)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(n,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(o=>{this._actionAUTHComplete(o,e,t)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(i),"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=Zu.hostname()||""}catch{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}};as.exports=dn});var fn=R((ez,ss)=>{"use strict";var{Stream:Ku}=require("stream"),Ju=pt(),Xu=require("crypto"),Yu=K(),ke=ne(),mn=class extends Ku{static{l(this,"XOAuth2")}constructor(e,t){if(super(),this.options=e||{},e&&e.serviceClient){if(!e.privateKey||!e.user){let i=new Error('Options "privateKey" and "user" are required for service account!');i.code=ke.EOAUTH2,setImmediate(()=>this.emit("error",i));return}let n=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=n||300}if(this.logger=Yu.getLogger({logger:t},{component:this.options.component||"OAuth2"}),this.provisionCallback=typeof this.options.provisionCallback=="function"?this.options.provisionCallback:!1,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{let n=Math.max(Number(this.options.timeout)||0,0);this.expires=n&&Date.now()+n*1e3||0}this.renewing=!1,this.renewalQueue=[]}getToken(e,t){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);let i=new Error("Can't create new access token for user");return i.code=ke.EOAUTH2,t(i)}if(this.renewing)return this.renewalQueue.push({renew:e,callback:t});this.renewing=!0;let n=l((i,o)=>{this.renewalQueue.forEach(a=>a.callback(i,o)),this.renewalQueue=[],this.renewing=!1,i?this.logger.error({err:i,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),t(i,o)},"generateCallback");this.provisionCallback?this.provisionCallback(this.options.user,!!e,(i,o,a)=>{!i&&o&&(this.accessToken=o,this.expires=a||0),n(i,o)}):this.generateToken(n)}updateToken(e,t){this.accessToken=e,t=Math.max(Number(t)||0,0),this.expires=t&&Date.now()+t*1e3||0,this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){let t,n;if(this.options.serviceClient){let i=Math.floor(Date.now()/1e3),o={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:i,exp:i+this.options.serviceRequestTimeout},a;try{a=this.jwtSignRS256(o)}catch{let c=new Error("Can't generate token. Check your auth options");return c.code=ke.EOAUTH2,e(c)}t={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:a},n={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:o}}else{if(!this.options.refreshToken){let i=new Error("Can't create new access token for user");return i.code=ke.EOAUTH2,e(i)}t={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(t,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,t,this.options,(i,o)=>{let a;if(i)return e(i);try{a=JSON.parse(o.toString())}catch(p){return e(p)}if(!a||typeof a!="object"){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(o||"").toString());let p=new Error("Invalid authentication response");return p.code=ke.EOAUTH2,e(p)}let s=Object.assign({},a);if(s.access_token&&(s.access_token=(s.access_token||"").toString().substr(0,6)+"..."),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(s)),a.error){let p=a.error;a.error_description&&(p+=": "+a.error_description),a.error_uri&&(p+=" ("+a.error_uri+")");let f=new Error(p);return f.code=ke.EOAUTH2,e(f)}if(a.access_token)return this.updateToken(a.access_token,a.expires_in),e(null,this.accessToken);let c=new Error("No access token");return c.code=ke.EOAUTH2,e(c)})}buildXOAuth2Token(e){let t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,n,i){let o=!1,a=[],s=0,c=Ju(e,{method:"post",headers:n.customHeaders,body:t,allowErrorResponse:!0});c.on("readable",()=>{let p;for(;(p=c.read())!==null;)a.push(p),s+=p.length}),c.once("error",p=>{if(!o)return o=!0,i(p)}),c.once("end",()=>{if(!o)return o=!0,i(null,Buffer.concat(a,s))})}toBase64URL(e){return typeof e=="string"&&(e=Buffer.from(e)),e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){e=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map(n=>this.toBase64URL(n)).join(".");let t=Xu.createSign("RSA-SHA256").update(e).sign(this.options.privateKey);return e+"."+this.toBase64URL(t)}};ss.exports=mn});var ls=R((rz,ps)=>{"use strict";var Qu=Bt(),ed=K().assign,td=fn(),cs=ne(),rd=require("events"),hn=class extends rd{static{l(this,"PoolResource")}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":{let t=new td(this.options.auth,this.logger);t.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||t.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:t,method:"XOAUTH2"},t.on("token",n=>this.pool.mailer.emit("token",n)),t.on("error",n=>this.emit("error",n));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}connect(e){this.pool.getSocket(this.options,(t,n)=>{if(t)return e(t);let i=!1,o=this.options;n&&n.connection&&(this.logger.info({tnx:"proxy",remoteAddress:n.connection.remoteAddress,remotePort:n.connection.remotePort,destHost:o.host||"",destPort:o.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",n.connection.remoteAddress,n.connection.remotePort,o.host||"",o.port||""),o=Object.assign(ed(!1,o),n)),this.connection=new Qu(o),this.connection.once("error",a=>{if(this.emit("error",a),!i)return i=!0,e(a)}),this.connection.once("end",()=>{if(this.close(),i)return;i=!0;let a=setTimeout(()=>{if(i)return;let s=new Error("Unexpected socket close");this.connection&&this.connection._socket&&this.connection._socket.upgrading&&(s.code=cs.ETLS),e(s)},1e3);try{a.unref()}catch{}}),this.connection.connect(()=>{if(!i)if(this.auth&&(this.connection.allowsAuth||o.forceAuth))this.connection.login(this.auth,a=>{if(!i){if(i=!0,a)return this.connection.close(),this.emit("error",a),e(a);this._connected=!0,e(null,!0)}});else return i=!0,this._connected=!0,e(null,!0)})})}send(e,t){if(!this._connected)return this.connect(a=>a?t(a):this.send(e,t));let n=e.message.getEnvelope(),i=e.message.messageId(),o=[].concat(n.to||[]);o.length>3&&o.push("...and "+o.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:i,cid:this.id},"Sending message %s using #%s to <%s>",i,this.id,o.join(", ")),e.data.dsn&&(n.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(n.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.connection.send(n,e.message.createReadStream(),(a,s)=>{if(this.messages++,a)return this.connection.close(),this.emit("error",a),t(a);s.envelope={from:n.from,to:n.to},s.messageId=i,setImmediate(()=>{if(this.messages>=this.options.maxMessages){let c=new Error("Resource exhausted");c.code=cs.EMAXLIMIT,this.connection.close(),this.emit("error",c)}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")}};ps.exports=hn});var us=R((iz,nd)=>{nd.exports={"1und1":{description:"1&1 Mail (German hosting provider)",host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},"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},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.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:["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\xE3o 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},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"}}});var gn=R((oz,ms)=>{"use strict";var ds=us(),Zt={};Object.keys(ds).forEach(r=>{let e=ds[r],t=id(e);Zt[Ht(r)]=t,[].concat(e.aliases||[]).forEach(n=>{Zt[Ht(n)]=t}),[].concat(e.domains||[]).forEach(n=>{Zt[Ht(n)]=t})});function Ht(r){return r.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}l(Ht,"normalizeKey");function id(r){let e={};return Object.keys(r).forEach(t=>{["domains","aliases"].includes(t)||(e[t]=r[t])}),e}l(id,"normalizeService");ms.exports=function(r){return r=Ht(r.split("@").pop()),Zt[r]||!1}});var vs=R((sz,xs)=>{"use strict";var od=require("events"),fs=ls(),ad=Bt(),sd=gn(),ht=K(),hs=ne(),gs=re(),xn=class extends od{static{l(this,"SMTPPool")}constructor(e){super(),e=e||{},typeof e=="string"&&(e={url:e});let t,n=e.service;typeof e.getSocket=="function"&&(this.getSocket=e.getSocket),e.url&&(t=ht.parseConnectionUrl(e.url),n=n||t.service),this.options=ht.assign(!1,e,t,n&&sd(n)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.logger=ht.getLogger(this.options,{component:this.options.component||"smtp-pool"}),this.name="SMTP (pool)",this.version=gs.version+"[client:"+gs.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){return setImmediate(()=>t(null,!1))}send(e,t){return this._closed?!1:(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,t=this._connections.length;if(this._closed=!0,clearTimeout(this._rateLimit.timeout),!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;let n=l(()=>{if(!this._queue.length){this.logger.debug({tnx:"connection"},"Pending queue entries cleared");return}let i=this._queue.shift();if(i&&typeof i.callback=="function")try{i.callback(new Error("Connection pool was closed"))}catch(o){this.logger.error({err:o,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,o.message)}setImmediate(n)},"invokeCallbacks");setImmediate(n)}_processMessages(){if(this._closed)return;if(!this._queue.length){this.idling||(this.idling=!0,this.emit("idle"));return}let e=this._connections.find(n=>n.available);if(!e&&this._connections.length<this.options.maxConnections&&(e=this._createConnection()),!e){this.idling=!1;return}!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));let 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,(n,i)=>{if(t===e.queueEntry){try{t.callback(n,i)}catch(o){this.logger.error({err:o,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,o.message)}e.queueEntry=!1}})}_createConnection(){let e=new fs(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!==hs.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(n){this.logger.error({err:n,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,n.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(()=>{e.queueEntry&&(this._shouldRequeuOnConnectionClose(e.queueEntry)?this._requeueEntryOnConnectionClose(e):this._failDeliveryOnConnectionClose(e)),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===void 0||this.options.maxRequeues<0?!0:e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{e.queueEntry.callback(new Error("Reached maximum number of retries after connection was closed"))}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){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}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(e){let t=this._connections.indexOf(e);t!==-1&&this._connections.splice(t,1)}_checkRateLimit(e){if(!this._rateLimit.limit)return e();let t=Date.now();if(this._rateLimit.counter<this._rateLimit.limit)return e();if(this._rateLimit.waiting.push(e),this._rateLimit.checkpoint<=t-this._rateLimit.delta)return this._clearRateLimit();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;){let e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;e||(t=new Promise((i,o)=>{e=ht.callbackPromise(i,o)}));let n=new fs(this).auth;return this.getSocket(this.options,(i,o)=>{if(i)return e(i);let a=this.options;o&&o.connection&&(this.logger.info({tnx:"proxy",remoteAddress:o.connection.remoteAddress,remotePort:o.connection.remotePort,destHost:a.host||"",destPort:a.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",o.connection.remoteAddress,o.connection.remotePort,a.host||"",a.port||""),a=Object.assign(ht.assign(!1,a),o));let s=new ad(a),c=!1;s.once("error",f=>{if(!c)return c=!0,s.close(),e(f)}),s.once("end",()=>{if(!c)return c=!0,e(new Error("Connection closed"))});let p=l(()=>{if(!c)return c=!0,s.quit(),e(null,!0)},"finalize");s.connect(()=>{if(!c)if(n&&(s.allowsAuth||a.forceAuth))s.login(n,f=>{if(!c){if(f)return c=!0,s.close(),e(f);p()}});else if(!n&&s.allowsAuth&&a.forceAuth){let f=new Error("Authentication info was not provided");return f.code=hs.ENOAUTH,c=!0,s.close(),e(f)}else p()})}),t}};xs.exports=xn});var Ps=R((pz,Es)=>{"use strict";var cd=require("events"),ys=Bt(),pd=gn(),Fe=K(),ld=fn(),_s=ne(),bs=re(),vn=class extends cd{static{l(this,"SMTPTransport")}constructor(e){super(),e=e||{},typeof e=="string"&&(e={url:e});let t,n=e.service;typeof e.getSocket=="function"&&(this.getSocket=e.getSocket),e.url&&(t=Fe.parseConnectionUrl(e.url),n=n||t.service),this.options=Fe.assign(!1,e,t,n&&pd(n)),this.logger=Fe.getLogger(this.options,{component:this.options.component||"smtp-transport"}),this.name="SMTP",this.version=bs.version+"[client:"+bs.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){return setImmediate(()=>t(null,!1))}getAuth(e){if(!e)return this.auth;let t=Object.assign({},this.options.auth&&typeof this.options.auth=="object"?this.options.auth:{},e&&typeof e=="object"?e:{});if(Object.keys(t).length===0)return!1;switch((t.type||"").toString().toUpperCase()){case"OAUTH2":{if(!t.service&&!t.user)return!1;let n=new ld(t,this.logger);return n.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||n.provisionCallback,n.on("token",i=>this.mailer.emit("token",i)),n.on("error",i=>this.emit("error",i)),{type:"OAUTH2",user:t.user,oauth2:n,method:"XOAUTH2"}}default: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,(n,i)=>{if(n)return t(n);let o=!1,a=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:a.host||"",destPort:a.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,a.host||"",a.port||""),a=Object.assign(Fe.assign(!1,a),i));let s=new ys(a);s.once("error",p=>{if(!o)return o=!0,s.close(),t(p)}),s.once("end",()=>{if(o)return;let p=setTimeout(()=>{if(o)return;o=!0;let f=new Error("Unexpected socket close");s&&s._socket&&s._socket.upgrading&&(f.code=_s.ETLS),t(f)},1e3);try{p.unref()}catch{}});let c=l(()=>{let p=e.message.getEnvelope(),f=e.message.messageId(),x=[].concat(p.to||[]);x.length>3&&x.push("...and "+x.splice(2).length+" more"),e.data.dsn&&(p.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(p.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.logger.info({tnx:"send",messageId:f},"Sending message %s to <%s>",f,x.join(", ")),s.send(p,e.message.createReadStream(),(m,d)=>{if(o=!0,s.close(),m)return this.logger.error({err:m,tnx:"send"},"Send error for %s: %s",f,m.message),t(m);d.envelope={from:p.from,to:p.to},d.messageId=f;try{return t(null,d)}catch(h){this.logger.error({err:h,tnx:"callback"},"Callback error for %s: %s",f,h.message)}})},"sendMessage");s.connect(()=>{if(o)return;let p=this.getAuth(e.data.auth);p&&(s.allowsAuth||a.forceAuth)?s.login(p,f=>{if(p&&p!==this.auth&&p.oauth2&&p.oauth2.removeAllListeners(),!o){if(f)return o=!0,s.close(),t(f);c()}}):c()})})}verify(e){let t;return e||(t=new Promise((n,i)=>{e=Fe.callbackPromise(n,i)})),this.getSocket(this.options,(n,i)=>{if(n)return e(n);let o=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:o.host||"",destPort:o.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,o.host||"",o.port||""),o=Object.assign(Fe.assign(!1,o),i));let a=new ys(o),s=!1;a.once("error",p=>{if(!s)return s=!0,a.close(),e(p)}),a.once("end",()=>{if(!s)return s=!0,e(new Error("Connection closed"))});let c=l(()=>{if(!s)return s=!0,a.quit(),e(null,!0)},"finalize");a.connect(()=>{if(s)return;let p=this.getAuth({});if(p&&(a.allowsAuth||o.forceAuth))a.login(p,f=>{if(!s){if(f)return s=!0,a.close(),e(f);c()}});else if(!p&&a.allowsAuth&&o.forceAuth){let f=new Error("Authentication info was not provided");return f.code=_s.ENOAUTH,s=!0,a.close(),e(f)}else c()})}),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}};Es.exports=vn});var Ss=R((uz,Ts)=>{"use strict";var{spawn:ud}=require("child_process"),dd=re(),md=K(),yn=ne(),_n=class{static{l(this,"SendmailTransport")}constructor(e){e=e||{},this._spawn=ud,this.options=e,this.name="Sendmail",this.version=dd.version,this.path="sendmail",this.args=!1,this.logger=md.getLogger(this.options,{component:this.options.component||"sendmail"}),typeof e=="string"?this.path=e:typeof e=="object"&&(e.path&&(this.path=e.path),Array.isArray(e.args)&&(this.args=e.args))}send(e,t){e.message.keepBcc=!0;let n=e.data.envelope||e.message.getEnvelope(),i=e.message.messageId(),o;if([].concat(n.from||[]).concat(n.to||[]).some(f=>/^-/.test(f))){let f=new Error("Can not send mail. Invalid envelope addresses.");return f.code=yn.ESENDMAIL,t(f)}let s=this.args?["-i"].concat(this.args).concat(n.to):["-i"].concat(n.from?["-f",n.from]:[]).concat(n.to),c=l(f=>{if(!o&&(o=!0,typeof t=="function"))return f?t(f):t(null,{envelope:n,messageId:i,response:"Messages queued for delivery"})},"callback"),p;try{p=this._spawn(this.path,s)}catch(f){return this.logger.error({err:f,tnx:"spawn",messageId:i},"Error occurred while spawning sendmail. %s",f.message),c(f)}if(p){p.on("error",m=>{this.logger.error({err:m,tnx:"spawn",messageId:i},"Error occurred when sending message %s. %s",i,m.message),c(m)}),p.once("exit",m=>{if(!m)return c();let d=new Error(m===127?"Sendmail command not found, process exited with code "+m:"Sendmail exited with code "+m);d.code=yn.ESENDMAIL,this.logger.error({err:d,tnx:"stdin",messageId:i},"Error sending message %s to sendmail. %s",i,d.message),c(d)}),p.once("close",c),p.stdin.on("error",m=>{this.logger.error({err:m,tnx:"stdin",messageId:i},"Error occurred when piping message %s to sendmail. %s",i,m.message),c(m)});let f=[].concat(n.to||[]);f.length>3&&f.push("...and "+f.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:i},"Sending message %s to <%s>",i,f.join(", "));let x=e.message.createReadStream();x.once("error",m=>{this.logger.error({err:m,tnx:"stdin",messageId:i},"Error occurred when generating message %s. %s",i,m.message),p.kill("SIGINT"),c(m)}),x.pipe(p.stdin)}else{let f=new Error("sendmail was not found");return f.code=yn.ESENDMAIL,c(f)}}};Ts.exports=_n});var ws=R((mz,Is)=>{"use strict";var fd=re(),hd=K(),bn=class{static{l(this,"StreamTransport")}constructor(e){e=e||{},this.options=e,this.name="StreamTransport",this.version=fd.version,this.logger=hd.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos",`\r
48
+ `].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;let n=e.data.envelope||e.message.getEnvelope(),i=e.message.messageId(),o=[].concat(n.to||[]);o.length>3&&o.push("...and "+o.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:i},"Sending message %s to <%s> using %s line breaks",i,o.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let a;try{a=e.message.createReadStream()}catch(p){return this.logger.error({err:p,tnx:"send",messageId:i},"Creating send stream failed for %s. %s",i,p.message),t(p)}if(!this.options.buffer)return a.once("error",p=>{this.logger.error({err:p,tnx:"send",messageId:i},"Failed creating message for %s. %s",i,p.message)}),t(null,{envelope:n,messageId:i,message:a});let s=[],c=0;a.on("readable",()=>{let p;for(;(p=a.read())!==null;)s.push(p),c+=p.length}),a.once("error",p=>(this.logger.error({err:p,tnx:"send",messageId:i},"Failed creating message for %s. %s",i,p.message),t(p))),a.on("end",()=>t(null,{envelope:n,messageId:i,message:Buffer.concat(s,c)}))})}};Is.exports=bn});var zs=R((hz,As)=>{"use strict";var gd=re(),xd=K(),En=class{static{l(this,"JSONTransport")}constructor(e){e=e||{},this.options=e,this.name="JSONTransport",this.version=gd.version,this.logger=xd.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=!0;let n=e.data.envelope||e.message.getEnvelope(),i=e.message.messageId(),o=[].concat(n.to||[]);o.length>3&&o.push("...and "+o.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:i},"Composing JSON structure of %s to <%s>",i,o.join(", ")),setImmediate(()=>{e.normalize((a,s)=>a?(this.logger.error({err:a,tnx:"send",messageId:i},"Failed building JSON structure for %s. %s",i,a.message),t(a)):(delete s.envelope,delete s.normalizedHeaders,t(null,{envelope:n,messageId:i,message:this.options.skipEncoding?s:JSON.stringify(s)})))})}};As.exports=En});var Os=R((xz,ks)=>{"use strict";var vd=require("events"),yd=re(),$s=K(),_d=Wr(),bd=Ft(),Pn=class extends vd{static{l(this,"SESTransport")}constructor(e){super(),e=e||{},this.options=e,this.ses=this.options.SES,this.name="SESTransport",this.version=yd.version,this.logger=$s.getLogger(this.options,{component:this.options.component||"ses-transport"})}getRegion(e){return this.ses.sesClient.config&&typeof this.ses.sesClient.config.region=="function"?this.ses.sesClient.config.region().then(t=>e(null,t)).catch(t=>e(t)):e(null,!1)}send(e,t){let n=e.message._headers.find(c=>/^from$/i.test(c.key));if(n){let c=new bd("text/plain");n=c._convertAddresses(c._parseAddresses(n.value))}let i=e.data.envelope||e.message.getEnvelope(),o=e.message.messageId(),a=[].concat(i.to||[]);a.length>3&&a.push("...and "+a.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:o},"Sending message %s to <%s>",o,a.join(", "));let s=l(c=>{e.data._dkim||(e.data._dkim={}),e.data._dkim.skipFields&&typeof e.data._dkim.skipFields=="string"?e.data._dkim.skipFields+=":date:message-id":e.data._dkim.skipFields="date:message-id";let p=e.message.createReadStream(),f=p.pipe(new _d),x=[],m=0;f.on("readable",()=>{let d;for(;(d=f.read())!==null;)x.push(d),m+=d.length}),p.once("error",d=>f.emit("error",d)),f.once("error",d=>c(d)),f.once("end",()=>c(null,Buffer.concat(x,m)))},"getRawMessage");setImmediate(()=>s((c,p)=>{if(c)return this.logger.error({err:c,tnx:"send",messageId:o},"Failed creating message for %s. %s",o,c.message),t(c);let f=Object.assign({Content:{Raw:{Data:p}},FromEmailAddress:n||i.from,Destination:{ToAddresses:i.to}},e.data.ses||{});this.getRegion((x,m)=>{(x||!m)&&(m="us-east-1");let d=new this.ses.SendEmailCommand(f);this.ses.sesClient.send(d).then(y=>{m==="us-east-1"&&(m="email"),t(null,{envelope:{from:i.from,to:i.to},messageId:"<"+y.MessageId+(/@/.test(y.MessageId)?"":"@"+m+".amazonses.com")+">",response:y.MessageId,raw:p})}).catch(y=>{this.logger.error({err:y,tnx:"send"},"Send error for %s: %s",o,y.message),t(y)})})}))}verify(e){let t;e||(t=new Promise((o,a)=>{e=$s.callbackPromise(o,a)}));let n=l(o=>o&&!["InvalidParameterValue","MessageRejected"].includes(o.code||o.Code||o.name)?e(o):e(null,!0),"cb"),i={Content:{Raw:{Data:Buffer.from(`From: <invalid@invalid>\r
49
+ To: <invalid@invalid>\r
50
+ Subject: Invalid\r
51
+ \r
52
+ Invalid`)}},FromEmailAddress:"invalid@invalid",Destination:{ToAddresses:["invalid@invalid"]}};return this.getRegion((o,a)=>{(o||!a)&&(a="us-east-1");let s=new this.ses.SendEmailCommand(i);this.ses.sesClient.send(s).then(p=>n(null,p)).catch(p=>n(p))}),t}};ks.exports=Pn});var Ds=R((yz,Vt)=>{"use strict";var Ed=Xa(),Rs=K(),Pd=vs(),Td=Ps(),Sd=Ss(),Id=ws(),wd=zs(),Ad=Os(),zd=ne(),$d=pt(),Cs=re(),kd=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),Od=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),Ns=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,Cd=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase()),gt=!1;Vt.exports.createTransport=function(r,e){let t;if(typeof r=="object"&&typeof r.send!="function"||typeof r=="string"&&/^(smtps?|direct):/i.test(r)){let n=typeof r=="string"?r:r.url;if(n?t=Rs.parseConnectionUrl(n):t=r,t.pool)r=new Pd(t);else if(t.sendmail)r=new Sd(t);else if(t.streamTransport)r=new Id(t);else if(t.jsonTransport)r=new wd(t);else if(t.SES){if(t.SES.ses&&t.SES.aws){let i=new Error("Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw i.code=zd.ECONFIG,i}r=new Ad(t)}else r=new Td(t)}return new Ed(r,t,e)};Vt.exports.createTestAccount=function(r,e){let t;if(!e&&typeof r=="function"&&(e=r,r=!1),e||(t=new Promise((c,p)=>{e=Rs.callbackPromise(c,p)})),Cd&&gt)return setImmediate(()=>e(null,gt)),t;r=r||kd;let n=[],i=0,o={},a={requestor:Cs.name,version:Cs.version};Ns&&(o.Authorization="Bearer "+Ns);let s=$d(r+"/user",{contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(a))});return s.on("readable",()=>{let c;for(;(c=s.read())!==null;)n.push(c),i+=c.length}),s.once("error",c=>e(c)),s.once("end",()=>{let c=Buffer.concat(n,i),p;try{p=JSON.parse(c.toString())}catch(f){return e(f)}if(p.status!=="success"||p.error)return e(new Error(p.error||"Request failed"));delete p.status,gt=p,e(null,gt)}),t};Vt.exports.getTestMessageUrl=function(r){if(!r||!r.response)return!1;let e=new Map;return r.response.replace(/\[([^\]]+)\]$/,(t,n)=>{n.replace(/\b([A-Z0-9]+)=([^\s]+)/g,(i,o,a)=>{e.set(o,a)})}),e.has("STATUS")&&e.has("MSGID")?(gt.web||Od)+"/message/"+e.get("MSGID"):!1}});var js=R((bz,Ms)=>{"use strict";Ms.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Bs=R(J=>{"use strict";var qt=js(),Nd=require("path").extname,Ls=/^\s*([^;\s]*)(?:;|\s|$)/,Rd=/^text\//i;J.charset=Fs;J.charsets={lookup:Fs};J.contentType=Dd;J.extension=Ud;J.extensions=Object.create(null);J.lookup=Md;J.types=Object.create(null);jd(J.extensions,J.types);function Fs(r){if(!r||typeof r!="string")return!1;var e=Ls.exec(r),t=e&&qt[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&Rd.test(e[1])?"UTF-8":!1}l(Fs,"charset");function Dd(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?J.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=J.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}l(Dd,"contentType");function Ud(r){if(!r||typeof r!="string")return!1;var e=Ls.exec(r),t=e&&J.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}l(Ud,"extension");function Md(r){if(!r||typeof r!="string")return!1;var e=Nd("x."+r).toLowerCase().substr(1);return e&&J.types[e]||!1}l(Md,"lookup");function jd(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(qt).forEach(l(function(i){var o=qt[i],a=o.extensions;if(!(!a||!a.length)){r[i]=a;for(var s=0;s<a.length;s++){var c=a[s];if(e[c]){var p=t.indexOf(qt[e[c]].source),f=t.indexOf(o.source);if(e[c]!=="application/octet-stream"&&(p>f||p===f&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}},"forEachMimeType"))}l(jd,"populateMaps")});var Hd={};In(Hd,{smtp:()=>Zd,smtpAuth:()=>Gt});module.exports=Js(Hd);var Xs=Object.freeze({status:"aborted"});function P(r,e,t){function n(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,c);let p=a.prototype,f=Object.keys(p);for(let x=0;x<f.length;x++){let m=f[x];m in s||(s[m]=p[m].bind(s))}}l(n,"init");let i=t?.Parent??Object;class o extends i{static{l(this,"Definition")}}Object.defineProperty(o,"name",{value:r});function a(s){var c;let p=t?.Parent?new o:this;n(p,s),(c=p._zod).deferred??(c.deferred=[]);for(let f of p._zod.deferred)f();return p}return l(a,"_"),Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:l(s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r),"value")}),Object.defineProperty(a,"name",{value:r}),a}l(P,"$constructor");var oe=class extends Error{static{l(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vt=class extends Error{static{l(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Kt={};function le(r){return r&&Object.assign(Kt,r),Kt}l(le,"config");function Xt(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}l(Xt,"getEnumValues");function zn(r,e){return typeof e=="bigint"?e.toString():e}l(zn,"jsonStringifyReplacer");function _t(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}l(_t,"cached");function $n(r){return r==null}l($n,"nullish");function bt(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}l(bt,"cleanRegex");var An=Symbol("evaluating");function H(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==An)return n===void 0&&(n=An,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}l(H,"defineLazy");var Yt="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Ze(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}l(Ze,"isObject");var Ys=_t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function kn(r){if(Ze(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Ze(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}l(kn,"isPlainObject");var On=new Set(["string","number","symbol"]);function Ce(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}l(Ce,"escapeRegex");function Et(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}l(Et,"clone");function L(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:l(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:l(()=>e.error,"error")}:e}l(L,"normalizeParams");function Cn(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}l(Cn,"optionalKeys");var Nn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ne(r,e=0){if(r.aborted===!0)return!0;for(let t=e;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}l(Ne,"aborted");function ge(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}l(ge,"prefixIssues");function yt(r){return typeof r=="string"?r:r?.message}l(yt,"unwrapMessage");function xe(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=yt(r.inst?._zod.def?.error?.(r))??yt(e?.error?.(r))??yt(t.customError?.(r))??yt(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}l(xe,"finalizeIssue");function Rn(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}l(Rn,"getLengthableOrigin");function Qt(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}l(Qt,"issue");var Dn=l((r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,zn,2),Object.defineProperty(r,"toString",{value:l(()=>r.message,"value"),enumerable:!1})},"initializer"),Un=P("$ZodError",Dn),He=P("$ZodError",Dn,{Parent:Error});var ec=l(r=>(e,t,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new oe;if(a.issues.length){let s=new(i?.Err??r)(a.issues.map(c=>xe(c,o,le())));throw Yt(s,i?.callee),s}return a.value},"_parse"),Pt=ec(He),tc=l(r=>async(e,t,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(i?.Err??r)(a.issues.map(c=>xe(c,o,le())));throw Yt(s,i?.callee),s}return a.value},"_parseAsync"),Tt=tc(He),rc=l(r=>(e,t,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new oe;return o.issues.length?{success:!1,error:new(r??Un)(o.issues.map(a=>xe(a,i,le())))}:{success:!0,data:o.value}},"_safeParse"),Ve=rc(He),nc=l(r=>async(e,t,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>xe(a,i,le())))}:{success:!0,data:o.value}},"_safeParseAsync"),qe=nc(He);var ic="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",oc=new RegExp(`^${ic}$`);var Mn=l(r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),jn=/^-?\d+n?$/,Ln=/^-?\d+$/,er=/^-?\d+(?:\.\d+)?$/,Fn=/^(?:true|false)$/i;var ve=P("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),ac={number:"number",bigint:"bigint",object:"date"};var Bn=P("$ZodCheckGreaterThan",(r,e)=>{ve.init(r,e);let t=ac[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}});var Zn=P("$ZodCheckNumberFormat",(r,e)=>{ve.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),n=t?"int":"number",[i,o]=Nn[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=i,s.maximum=o,t&&(s.pattern=Ln)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:r});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:n,inclusive:!0,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:n,inclusive:!0,continue:!e.abort});return}}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:r,continue:!e.abort})}});var Hn=P("$ZodCheckMinLength",(r,e)=>{var t;ve.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!$n(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let a=Rn(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}});var tr=P("$ZodCheckStringFormat",(r,e)=>{var t,n;ve.init(r,e),r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(n=r._zod).check??(n.check=()=>{})}),Vn=P("$ZodCheckRegex",(r,e)=>{tr.init(r,e),r._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:r,continue:!e.abort})}});var Gn={major:4,minor:3,patch:6};var B=P("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Gn;let n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(let i of n)for(let o of i._zod.onattach)o(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=l((a,s,c)=>{let p=Ne(a),f;for(let x of s){if(x._zod.def.when){if(!x._zod.def.when(a))continue}else if(p)continue;let m=a.issues.length,d=x._zod.check(a);if(d instanceof Promise&&c?.async===!1)throw new oe;if(f||d instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await d,a.issues.length!==m&&(p||(p=Ne(a,m)))});else{if(a.issues.length===m)continue;p||(p=Ne(a,m))}}return f?f.then(()=>a):a},"runChecks"),o=l((a,s,c)=>{if(Ne(a))return a.aborted=!0,a;let p=i(s,n,c);if(p instanceof Promise){if(c.async===!1)throw new oe;return p.then(f=>r._zod.parse(f,c))}return r._zod.parse(p,c)},"handleCanaryResult");r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let p=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return p instanceof Promise?p.then(f=>o(f,a,s)):o(p,a,s)}let c=r._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new oe;return c.then(p=>i(p,n,s))}return i(c,n,s)}}H(r,"~standard",()=>({validate:l(i=>{try{let o=Ve(r,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return qe(r,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=P("$ZodString",(r,e)=>{B.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??Mn(r._zod.bag),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),rr=P("$ZodStringFormat",(r,e)=>{tr.init(r,e),wt.init(r,e)});var Yn=P("$ZodURL",(r,e)=>{rr.init(r,e),r._zod.check=t=>{try{let n=t.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=i.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}});var nr=P("$ZodNumber",(r,e)=>{B.init(r,e),r._zod.pattern=r._zod.bag.pattern??er,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...o?{received:o}:{}}),t}}),Qn=P("$ZodNumberFormat",(r,e)=>{Zn.init(r,e),nr.init(r,e)}),ir=P("$ZodBoolean",(r,e)=>{B.init(r,e),r._zod.pattern=Fn,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),ei=P("$ZodBigInt",(r,e)=>{B.init(r,e),r._zod.pattern=jn,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}});var ti=P("$ZodAny",(r,e)=>{B.init(r,e),r._zod.parse=t=>t}),ri=P("$ZodUnknown",(r,e)=>{B.init(r,e),r._zod.parse=t=>t});var ni=P("$ZodVoid",(r,e)=>{B.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),ii=P("$ZodDate",(r,e)=>{B.init(r,e),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:r}),t}});function Wn(r,e,t){r.issues.length&&e.issues.push(...ge(t,r.issues)),e.value[t]=r.value}l(Wn,"handleArrayResult");var oi=P("$ZodArray",(r,e)=>{B.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let o=[];for(let a=0;a<i.length;a++){let s=i[a],c=e.element._zod.run({value:s,issues:[]},n);c instanceof Promise?o.push(c.then(p=>Wn(p,t,a))):Wn(c,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function It(r,e,t,n,i){if(r.issues.length){if(i&&!(t in n))return;e.issues.push(...ge(t,r.issues))}r.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=r.value}l(It,"handlePropertyResult");function sc(r){let e=Object.keys(r.shape);for(let n of e)if(!r.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let t=Cn(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}l(sc,"normalizeDef");function cc(r,e,t,n,i,o){let a=[],s=i.keySet,c=i.catchall._zod,p=c.def.type,f=c.optout==="optional";for(let x in e){if(s.has(x))continue;if(p==="never"){a.push(x);continue}let m=c.run({value:e[x],issues:[]},n);m instanceof Promise?r.push(m.then(d=>It(d,t,x,e,f))):It(m,t,x,e,f)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}l(cc,"handleCatchall");var ai=P("$ZodObject",(r,e)=>{if(B.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:l(()=>{let c={...s};return Object.defineProperty(e,"shape",{value:c}),c},"get")})}let n=_t(()=>sc(e));H(r._zod,"propValues",()=>{let s=e.shape,c={};for(let p in s){let f=s[p]._zod;if(f.values){c[p]??(c[p]=new Set);for(let x of f.values)c[p].add(x)}}return c});let i=Ze,o=e.catchall,a;r._zod.parse=(s,c)=>{a??(a=n.value);let p=s.value;if(!i(p))return s.issues.push({expected:"object",code:"invalid_type",input:p,inst:r}),s;s.value={};let f=[],x=a.shape;for(let m of a.keys){let d=x[m],h=d._zod.optout==="optional",y=d._zod.run({value:p[m],issues:[]},c);y instanceof Promise?f.push(y.then(v=>It(v,s,m,p,h))):It(y,s,m,p,h)}return o?cc(f,p,s,c,n.value,r):f.length?Promise.all(f).then(()=>s):s}});function Kn(r,e,t,n){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let i=r.filter(o=>!Ne(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>xe(a,n,le())))}),e)}l(Kn,"handleUnionResults");var or=P("$ZodUnion",(r,e)=>{B.init(r,e),H(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),H(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),H(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),H(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>bt(o.source)).join("|")})$`)}});let t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(i,o)=>{if(t)return n(i,o);let a=!1,s=[];for(let c of e.options){let p=c._zod.run({value:i.value,issues:[]},o);if(p instanceof Promise)s.push(p),a=!0;else{if(p.issues.length===0)return p;s.push(p)}}return a?Promise.all(s).then(c=>Kn(c,i,r,o)):Kn(s,i,r,o)}});var si=P("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,or.init(r,e);let t=r._zod.parse;H(r._zod,"propValues",()=>{let i={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){i[s]||(i[s]=new Set);for(let p of c)i[s].add(p)}}return i});let n=_t(()=>{let i=e.options,o=new Map;for(let a of i){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});r._zod.parse=(i,o)=>{let a=i.value;if(!Ze(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),i;let s=n.value.get(a?.[e.discriminator]);return s?s._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),i)}});var ci=P("$ZodRecord",(r,e)=>{B.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!kn(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let p of a)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){s.add(typeof p=="number"?p.toString():p);let f=e.valueType._zod.run({value:i[p],issues:[]},n);f instanceof Promise?o.push(f.then(x=>{x.issues.length&&t.issues.push(...ge(p,x.issues)),t.value[p]=x.value})):(f.issues.length&&t.issues.push(...ge(p,f.issues)),t.value[p]=f.value)}let c;for(let p in i)s.has(p)||(c=c??[],c.push(p));c&&c.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:c})}else{t.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let c=e.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&er.test(s)&&c.issues.length){let x=e.keyType._zod.run({value:Number(s),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(c=x)}if(c.issues.length){e.mode==="loose"?t.value[s]=i[s]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(x=>xe(x,n,le())),input:s,path:[s],inst:r});continue}let f=e.valueType._zod.run({value:i[s],issues:[]},n);f instanceof Promise?o.push(f.then(x=>{x.issues.length&&t.issues.push(...ge(s,x.issues)),t.value[c.value]=x.value})):(f.issues.length&&t.issues.push(...ge(s,f.issues)),t.value[c.value]=f.value)}}return o.length?Promise.all(o).then(()=>t):t}});var pi=P("$ZodEnum",(r,e)=>{B.init(r,e);let t=Xt(e.entries),n=new Set(t);r._zod.values=n,r._zod.pattern=new RegExp(`^(${t.filter(i=>On.has(typeof i)).map(i=>typeof i=="string"?Ce(i):i.toString()).join("|")})$`),r._zod.parse=(i,o)=>{let a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:t,input:a,inst:r}),i}}),li=P("$ZodLiteral",(r,e)=>{if(B.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ce(n):n?Ce(n.toString()):String(n)).join("|")})$`),r._zod.parse=(n,i)=>{let o=n.value;return t.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),n}});var ui=P("$ZodTransform",(r,e)=>{B.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new vt(r.constructor.name);let i=e.transform(t.value,t);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(t.value=a,t));if(i instanceof Promise)throw new oe;return t.value=i,t}});function Jn(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}l(Jn,"handleOptionalResult");var di=P("$ZodOptional",(r,e)=>{B.init(r,e),r._zod.optin="optional",r._zod.optout="optional",H(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),H(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${bt(t.source)})?$`):void 0}),r._zod.parse=(t,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>Jn(o,t.value)):Jn(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}});var mi=P("$ZodNullable",(r,e)=>{B.init(r,e),H(r._zod,"optin",()=>e.innerType._zod.optin),H(r._zod,"optout",()=>e.innerType._zod.optout),H(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${bt(t.source)}|null)$`):void 0}),H(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,n)=>t.value===null?t:e.innerType._zod.run(t,n)});var fi=P("$ZodPipe",(r,e)=>{B.init(r,e),H(r._zod,"values",()=>e.in._zod.values),H(r._zod,"optin",()=>e.in._zod.optin),H(r._zod,"optout",()=>e.out._zod.optout),H(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(a=>St(a,e.in,n)):St(o,e.in,n)}let i=e.in._zod.run(t,n);return i instanceof Promise?i.then(o=>St(o,e.out,n)):St(i,e.out,n)}});function St(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}l(St,"handlePipeResult");var hi=P("$ZodCustom",(r,e)=>{ve.init(r,e),B.init(r,e),r._zod.parse=(t,n)=>t,r._zod.check=t=>{let n=t.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>Xn(o,t,n,r));Xn(i,t,n,r)}});function Xn(r,e,t,n){if(!r){let i={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Qt(i))}}l(Xn,"handleRefineResult");var xi;var ar=class{static{l(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function vi(){return new ar}l(vi,"registry");(xi=globalThis).__zod_globalRegistry??(xi.__zod_globalRegistry=vi());var sr=globalThis.__zod_globalRegistry;function yi(r,e){return new r({type:"string",...L(e)})}l(yi,"_string");function _i(r,e){return new r({type:"string",coerce:!0,...L(e)})}l(_i,"_coercedString");function bi(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...L(e)})}l(bi,"_url");function Ei(r,e){return new r({type:"number",checks:[],...L(e)})}l(Ei,"_number");function Pi(r,e){return new r({type:"number",coerce:!0,checks:[],...L(e)})}l(Pi,"_coercedNumber");function Ti(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...L(e)})}l(Ti,"_int");function Si(r,e){return new r({type:"boolean",...L(e)})}l(Si,"_boolean");function Ii(r,e){return new r({type:"boolean",coerce:!0,...L(e)})}l(Ii,"_coercedBoolean");function wi(r,e){return new r({type:"bigint",coerce:!0,...L(e)})}l(wi,"_coercedBigint");function Ai(r){return new r({type:"any"})}l(Ai,"_any");function zi(r){return new r({type:"unknown"})}l(zi,"_unknown");function $i(r,e){return new r({type:"void",...L(e)})}l($i,"_void");function ki(r,e){return new r({type:"date",coerce:!0,...L(e)})}l(ki,"_coercedDate");function At(r,e){return new Bn({check:"greater_than",...L(e),value:r,inclusive:!0})}l(At,"_gte");function te(r,e){return new Hn({check:"min_length",...L(e),minimum:r})}l(te,"_minLength");function ye(r,e){return new Vn({check:"string_format",format:"regex",...L(e),pattern:r})}l(ye,"_regex");function Oi(r,e,t){let n=L(t);return n.abort??(n.abort=!0),new r({type:"custom",check:"custom",fn:e,...n})}l(Oi,"_custom");var V=P("ZodMiniType",(r,e)=>{if(!r._zod)throw new Error("Uninitialized schema in ZodMiniType.");B.init(r,e),r.def=e,r.type=e.type,r.parse=(t,n)=>Pt(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>Ve(r,t,n),r.parseAsync=async(t,n)=>Tt(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>qe(r,t,n),r.check=(...t)=>r.clone({...e,checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),r.with=r.check,r.clone=(t,n)=>Et(r,t,n),r.brand=()=>r,r.register=((t,n)=>(t.add(r,n),r)),r.apply=t=>t(r)}),$t=P("ZodMiniString",(r,e)=>{wt.init(r,e),V.init(r,e)});function u(r){return yi($t,r)}l(u,"string");var Ci=P("ZodMiniStringFormat",(r,e)=>{rr.init(r,e),$t.init(r,e)});var bc=P("ZodMiniURL",(r,e)=>{Yn.init(r,e),Ci.init(r,e)});function Ni(r){return bi(bc,r)}l(Ni,"url");var kt=P("ZodMiniNumber",(r,e)=>{nr.init(r,e),V.init(r,e)});function W(r){return Ei(kt,r)}l(W,"number");var Ec=P("ZodMiniNumberFormat",(r,e)=>{Qn.init(r,e),kt.init(r,e)});function Ri(r){return Ti(Ec,r)}l(Ri,"int");var cr=P("ZodMiniBoolean",(r,e)=>{ir.init(r,e),V.init(r,e)});function M(r){return Si(cr,r)}l(M,"boolean");var Di=P("ZodMiniBigInt",(r,e)=>{ei.init(r,e),V.init(r,e)});var Pc=P("ZodMiniAny",(r,e)=>{ti.init(r,e),V.init(r,e)});function We(){return Ai(Pc)}l(We,"any");var Tc=P("ZodMiniUnknown",(r,e)=>{ri.init(r,e),V.init(r,e)});function z(){return zi(Tc)}l(z,"unknown");var Sc=P("ZodMiniVoid",(r,e)=>{ni.init(r,e),V.init(r,e)});function Ui(r){return $i(Sc,r)}l(Ui,"_void");var Mi=P("ZodMiniDate",(r,e)=>{ii.init(r,e),V.init(r,e)});var Ic=P("ZodMiniArray",(r,e)=>{oi.init(r,e),V.init(r,e)});function O(r,e){return new Ic({type:"array",element:r,...L(e)})}l(O,"array");var wc=P("ZodMiniObject",(r,e)=>{ai.init(r,e),V.init(r,e),H(r,"shape",()=>e.shape)});function g(r,e){let t={type:"object",shape:r??{},...L(e)};return new wc(t)}l(g,"object");var Ac=P("ZodMiniUnion",(r,e)=>{or.init(r,e),V.init(r,e)});function C(r,e){return new Ac({type:"union",options:r,...L(e)})}l(C,"union");var zc=P("ZodMiniDiscriminatedUnion",(r,e)=>{si.init(r,e),V.init(r,e)});function _e(r,e,t){return new zc({type:"union",options:e,discriminator:r,...L(t)})}l(_e,"discriminatedUnion");var $c=P("ZodMiniRecord",(r,e)=>{ci.init(r,e),V.init(r,e)});function $(r,e,t){return new $c({type:"record",keyType:r,valueType:e,...L(t)})}l($,"record");var kc=P("ZodMiniEnum",(r,e)=>{pi.init(r,e),V.init(r,e),r.options=Object.values(e.entries)});function D(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(n=>[n,n])):r;return new kc({type:"enum",entries:t,...L(e)})}l(D,"_enum");var Oc=P("ZodMiniLiteral",(r,e)=>{li.init(r,e),V.init(r,e)});function S(r,e){return new Oc({type:"literal",values:Array.isArray(r)?r:[r],...L(e)})}l(S,"literal");var Cc=P("ZodMiniTransform",(r,e)=>{ui.init(r,e),V.init(r,e)});function be(r){return new Cc({type:"transform",transform:r})}l(be,"transform");var Nc=P("ZodMiniOptional",(r,e)=>{di.init(r,e),V.init(r,e)});function _(r){return new Nc({type:"optional",innerType:r})}l(_,"optional");var Rc=P("ZodMiniNullable",(r,e)=>{mi.init(r,e),V.init(r,e)});function Ke(r){return new Rc({type:"nullable",innerType:r})}l(Ke,"nullable");var Dc=P("ZodMiniPipe",(r,e)=>{fi.init(r,e),V.init(r,e)});function Ee(r,e){return new Dc({type:"pipe",in:r,out:e})}l(Ee,"pipe");var Uc=P("ZodMiniCustom",(r,e)=>{hi.init(r,e),V.init(r,e)});function Ot(r,e){return Oi(Uc,r??(()=>!0),e)}l(Ot,"custom");var Je={};In(Je,{bigint:()=>Zc,boolean:()=>Bc,date:()=>Hc,number:()=>Fc,string:()=>Lc});function Lc(r){return _i($t,r)}l(Lc,"string");function Fc(r){return Pi(kt,r)}l(Fc,"number");function Bc(r){return Ii(cr,r)}l(Bc,"boolean");function Zc(r){return wi(Di,r)}l(Zc,"bigint");function Hc(r){return ki(Mi,r)}l(Hc,"date");var lr=g({retryOnFailure:g({defaultValue:_(M()),hide:_(M())}),continueOnFailure:g({defaultValue:_(M()),hide:_(M())})}),pr=class{constructor(e,t,n,i,o,a,s,c,p,f,x){this.name=e;this.displayName=t;this.description=n;this.props=i;this.run=o;this.test=a;this.requireAuth=s;this.errorHandlingOptions=c;this.outputSchema=p;this.audience=f;this.aiMetadata=x}static{l(this,"IAction")}},Li=l(r=>new pr(r.name,r.displayName,r.description,r.props,r.run,r.test??r.run,r.requireAuth??!0,r.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},r.outputSchema,r.audience,r.aiMetadata),"createAction");var U=g({displayName:u(),description:_(u())}),N=l((r,e)=>g({type:S(e),required:M(),defaultValue:_(We())}),"TPropertyValue");var X=g({...U.shape,...N(u(),"SHORT_TEXT").shape}),ue=g({...U.shape,...N(u(),"LONG_TEXT").shape});var Fi=g({label:u(),value:z()}),Ct=g({disabled:_(M()),placeholder:_(u()),options:O(Fi)});var Y=g({...U.shape,options:Ct,...N(z(),"STATIC_DROPDOWN").shape}),de=g({...U.shape,options:Ct,...N(O(z()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var ur=g({...U.shape,...N(z(),"DROPDOWN").shape,refreshers:O(u())}),Xe=g({...U.shape,...N(O(z()),"MULTI_SELECT_DROPDOWN").shape,refreshers:O(u())});var me=g({...U.shape,...N(M(),"CHECKBOX").shape});var fe=g({...U.shape,...N(W(),"NUMBER").shape});var Ye=g({...U.shape,...N(z(),"FILE").shape});var Qe=g({...U.shape,...N(u(),"DATE_TIME").shape});var Bi=$(u(),C([X,ue,Y,Xe,de,me,fe,Ye,Qe])),et=g({...U.shape,properties:Bi,...N(O(z()),"ARRAY").shape});var tt=g({...U.shape,...N(C([$(u(),z())]),"JSON").shape});var Zi=C([X,Y,tt,et,de]),qc=$(u(),Zi),dr=g({refreshers:O(u()),...U.shape,...N(z(),"DYNAMIC").shape});var Nt=g({...U.shape,...N(Ui(),"MARKDOWN").shape});var rt=(t=>(t.ARCHIVE="ARCHIVE",t.REGISTRY="REGISTRY",t))(rt||{}),Re=(t=>(t.CUSTOM="CUSTOM",t.OFFICIAL="OFFICIAL",t))(Re||{}),De=(b=>(b.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",b.COMMUNICATION="COMMUNICATION",b.COMMERCE="COMMERCE",b.CORE="CORE",b.UNIVERSAL_AI="UNIVERSAL_AI",b.FLOW_CONTROL="FLOW_CONTROL",b.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",b.ACCOUNTING="ACCOUNTING",b.PRODUCTIVITY="PRODUCTIVITY",b.CONTENT_AND_FILES="CONTENT_AND_FILES",b.DEVELOPER_TOOLS="DEVELOPER_TOOLS",b.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",b.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",b.HUMAN_RESOURCES="HUMAN_RESOURCES",b.PAYMENT_PROCESSING="PAYMENT_PROCESSING",b.MARKETING="MARKETING",b.SALES_AND_CRM="SALES_AND_CRM",b))(De||{});var nt=(t=>(t.AUTHORIZATION_CODE="authorization_code",t.CLIENT_CREDENTIALS="client_credentials",t))(nt||{}),mr="both_client_credentials_and_authorization_code";var Ie=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ie||{}),it=(o=>(o.NONE="NONE",o.HEADER_PRESENT="HEADER_PRESENT",o.QUERY_PRESENT="QUERY_PRESENT",o.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",o.HEAD_REQUEST="HEAD_REQUEST",o))(it||{}),Gc=g({strategy:D(it),paramName:_(u())}),ot=(t=>(t.SIMULATION="SIMULATION",t.TEST_FUNCTION="TEST_FUNCTION",t))(ot||{});var Rt=(t=>(t.WEBSOCKET="WEBSOCKET",t.NONE="NONE",t))(Rt||{}),Hi=g({status:_(W()),body:_(z()),headers:_($(u(),u()))}),Vi=g({type:S("DELAY"),resumeDateTime:u(),requestIdToReply:_(u()),handlerId:_(u()),streamStepProgress:_(D(Rt))}),qi=g({type:S("WEBHOOK"),requestId:u(),requestIdToReply:_(u()),response:Hi,handlerId:_(u()),streamStepProgress:_(D(Rt))}),Wc=C([Vi,qi]);var Kc=g({body:z(),rawBody:_(z()),headers:$(u(),u()),queryParams:$(u(),u())});var fr=Oe(require("crypto"),1);var Jc=128,we,Ue,Xc=l(r=>{!we||we.length<r?(we=Buffer.allocUnsafe(r*Jc),fr.default.randomFillSync(we),Ue=0):Ue+r>we.length&&(fr.default.randomFillSync(we),Ue=0),Ue+=r},"fillPool"),Yc=l(r=>(Xc(r|=0),we.subarray(Ue-r,Ue)),"random"),Qc=l((r,e,t)=>{let n=(2<<31-Math.clz32(r.length-1|1))-1,i=Math.ceil(1.6*n*e/r.length);return(o=e)=>{let a="";for(;;){let s=t(i),c=i;for(;c--;)if(a+=r[s[c]&n]||"",a.length===o)return a}}},"customRandom"),Wi=l((r,e=21)=>Qc(r,e,Yc),"customAlphabet");var ep="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ki=21,SE=u().check(ye(new RegExp(`^[0-9a-zA-Z]{${Ki}}$`))),tp=Wi(ep,Ki);var Pe=Ee(be(r=>r instanceof Date?r.toISOString():r),u()),Q={id:u(),created:Pe,updated:Pe},F=l(r=>_(Ke(r)),"Nullable");function hr(r){return _(Ke(D(r)))}l(hr,"NullableEnum");var AE=Ee(be(r=>r==="true"||r===!0?!0:r==="false"||r===!1?!1:void 0),_(M())),Dt=l(r=>Ee(be(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),_(O(r))),"OptionalArrayFromQuery");var kE=$(u(),z());var st=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(st||{});var ZE=u().check(ye(/^#[0-9A-Fa-f]{6}$/));var VE=g({filename:u(),data:z(),type:S("file"),mimetype:_(u())});var rp=Oe(Xi());var YE=g({...Q,name:u(),permissions:O(u()),platformId:F(u()),type:u(),userCount:_(W())});var Yi=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Yi||{}),gr=(t=>(t.FILE="FILE",t.TABLE="TABLE",t))(gr||{}),xr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(xr||{});var vr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(vr||{});var yr=(t=>(t.IN_PROGRESS="in-progress",t.COMPLETED="completed",t))(yr||{});var np=g({mode:D(Yi),value:z()}),ip=g({auth:_(u()),fields:$(u(),np)}),op=g({pieceName:u(),pieceVersion:u(),actionName:u(),predefinedInput:_(ip)}),ap=g({type:S("PIECE"),toolName:u().check(te(1)),pieceMetadata:op}),sp=g({type:S("none")}),cp=g({type:S("access_token"),accessToken:u()}),pp=g({type:S("api_key"),apiKey:u(),apiKeyHeader:u()}),lp=g({type:S("headers"),headers:$(u(),u())}),up=_e("type",[sp,cp,pp,lp]),Qi=g({type:S("FLOW"),toolName:u().check(te(1)),externalFlowId:u(),flowDisplayName:_(u())}),eo=g({type:S("MCP"),toolName:u().check(te(1)),serverUrl:Ni(),protocol:D(xr),auth:up}),to=g({type:S("KNOWLEDGE_BASE"),toolName:u().check(te(1)),sourceType:D(gr),sourceId:u(),sourceName:u()}),dp=_e("type",[ap,Qi,eo,to]),mp=g({displayName:u(),description:_(u()),type:D(vr)}),ro=g({type:S("MARKDOWN"),markdown:u()}),Me={type:S("TOOL_CALL"),input:F($(u(),z())),output:_(z()),toolName:u(),status:D(yr),toolCallId:u(),startTime:u(),endTime:_(u())},SP=g(Me),no=_e("toolCallType",[g({...Me,toolCallType:S("PIECE"),pieceName:u(),pieceVersion:u(),actionName:u()}),g({...Me,toolCallType:S("FLOW"),displayName:u(),externalFlowId:u()}),g({...Me,toolCallType:S("MCP"),displayName:u(),serverUrl:u()}),g({...Me,toolCallType:S("KNOWLEDGE_BASE"),displayName:u(),sourceType:u()}),g({...Me,toolCallType:S("UNKNOWN"),displayName:u()})]),fp=C([ro,no]);var _r=(t=>(t.IMAGE="image",t.TEXT="text",t))(_r||{}),he=g({apiKey:u()}),hp=he,gp=g({apiKey:u(),apiKeyHash:u()}),xp=he,vp=he,yp=he,_p=he,bp=he,Ep=he,Pp=he,io=g({accessKeyId:u().check(te(1)),secretAccessKey:u().check(te(1))}),Tp=g({}),Sp=g({}),Ip=g({}),wp=g({}),Ap=g({}),zp=g({}),oo=g({modelId:u(),modelName:u(),modelType:D(_r)}),ao=g({apiKeyHeader:u(),baseUrl:u(),models:O(oo),defaultHeaders:_($(u(),u()))}),so=g({accountId:u(),gatewayId:u(),models:O(oo),vertexProject:_(u()),vertexRegion:_(u())}),co=g({resourceName:u(),apiVersion:Ee(be(r=>typeof r=="string"&&r.trim().length===0?void 0:r),_(u()))}),po=g({region:u().check(te(1))}),$p=C([hp,yp,_p,bp,Ep,vp,xp,gp,io,Pp]),lo=C([ao,so,co,po,Tp,Ip,wp,Ap,Sp,zp]),kp=g({id:u(),name:u(),type:D(_r)}),Op=g({id:u(),name:u(),provider:D(st),config:lo,enabledForChat:M()}),Cp=g({provider:D(st),config:lo,auth:$p,platformId:u()});var zP={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Np=g({base64Url:u(),fileName:u(),extension:_(u())}),Rp=g({mimeType:u(),url:u(),fileName:_(u())}),br=C([Np,Rp]);var Dp=C([g({type:S("file"),value:br}),g({type:S("markdown"),value:u(),files:_(O(br))})]),Up=g({sessionId:u(),message:u(),files:_(O(u()))});var mo=(t=>(t.ON_NEW_RECORD="ON_NEW_RECORD",t.ON_UPDATE_RECORD="ON_UPDATE_RECORD",t))(mo||{}),fo=(t=>(t.ENABLED="ENABLED",t.DISABLED="DISABLED",t))(fo||{}),Er=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Er||{});var Mp=C([g({...Q,name:u(),externalId:u(),type:S("STATIC_DROPDOWN"),tableId:u(),projectId:u(),data:g({options:O(g({value:u()}))})}),g({...Q,name:u(),externalId:u(),type:C([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:u(),projectId:u()})]),jp=g({...Q,name:u(),folderId:F(u()),projectId:u(),externalId:u(),status:hr(fo),trigger:hr(mo)}),Lp=g({...Q,tableId:u(),projectId:u(),cells:$(u(),g({updated:u(),created:u(),value:z(),fieldName:u()}))}),Fp=g({events:O(D(Er)),webhookUrl:u(),flowId:u()}),Bp=g({fields:O(g({id:u(),name:u()})),rows:O($(u(),u())),name:u()}),Zp=g({projectId:u(),limit:_(Je.number()),cursor:_(u()),name:_(u()),externalIds:Dt(u()),folderId:_(u()),folderIds:Dt(u())}),Hp=g({records:O(O(g({fieldId:u(),value:go()}))),tableId:u()}),Vp=g({cells:_(O(g({fieldId:u(),value:go()}))),tableId:u(),agentUpdate:_(M())}),ho=_e("operator",[Ae("eq"),Ae("neq"),Ae("gt"),Ae("gte"),Ae("lt"),Ae("lte"),Ae("co"),uo("exists"),uo("not_exists")]),qp=g({tableId:u(),limit:_(Je.number()),cursor:_(u()),filters:Dt(ho)});function go(){return Ee(be(r=>r==null?r:String(r)),Ke(u()))}l(go,"coerceToString");function Ae(r){return g({fieldId:u(),operator:S(r),value:u()})}l(Ae,"valueFilter");function uo(r){return g({fieldId:u(),operator:S(r)})}l(uo,"existenceFilter");var Gp=g({status:_(W()),body:_(z()),headers:_($(u(),u()))}),Wp=g({...Q,deleted:F(Pe),ownerId:u(),displayName:u(),platformId:u(),externalId:F(u())});var xo=g({name:u(),description:_(u()),type:u(),required:M()}),Kp=g({pieceName:u(),triggerName:u(),input:g({toolName:u(),toolDescription:u(),inputSchema:O(xo),returnsResponse:M()})});var vo="^[0-9]+\\.[0-9]+\\.[0-9]+$",WP=new RegExp(vo),Xp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",KP=u().check(ye(new RegExp(vo))),JP=u().check(ye(new RegExp(Xp))),Yp=g({packageType:S("ARCHIVE"),pieceType:D(Re),pieceName:u(),pieceVersion:u(),archiveId:u(),platformId:u()}),yo=g({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:u(),pieceVersion:u()}),_o=g({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:u(),pieceVersion:u(),platformId:u()}),XP=C([yo,_o]),YP=C([Yp,yo,_o]);var Qp=_e("type",[g({type:S("CRON_EXPRESSION"),cronExpression:u(),timezone:u()}),g({type:S("INTERVAL"),intervalMs:Ri().check(At(6e4))})]),QP=g({...Q,type:D(Ie),projectId:u(),flowId:u(),triggerName:u(),schedule:F(Qp),flowVersionId:u(),pieceName:u(),pieceVersion:u(),deleted:F(u()),simulate:M()}),bo=(v=>(v.UNKNOWN="UNKNOWN",v.FLOW_RUN_LOG="FLOW_RUN_LOG",v.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",v.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",v.FLOW_STEP_FILE="FLOW_STEP_FILE",v.SAMPLE_DATA="SAMPLE_DATA",v.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",v.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",v.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",v.PROJECT_RELEASE="PROJECT_RELEASE",v.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",v.PLATFORM_ASSET="PLATFORM_ASSET",v.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",v.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",v.KNOWLEDGE_BASE="KNOWLEDGE_BASE",v.FLOW_BUNDLE="FLOW_BUNDLE",v))(bo||{}),Eo=(t=>(t.NONE="NONE",t.ZSTD="ZSTD",t))(Eo||{}),Po=(t=>(t.S3="S3",t.DB="DB",t))(Po||{}),eT=g({...Q,projectId:F(u()),platformId:F(u()),type:D(bo),compression:D(Eo),data:_(z()),location:D(Po),size:F(W()),fileName:F(u()),s3Key:F(u()),metadata:F($(u(),u()))}),To=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(To||{}),So=(t=>(t.ACTIVE="ACTIVE",t.INACTIVE="INACTIVE",t))(So||{}),tT=g({id:u(),email:u(),firstName:u(),status:D(So),externalId:F(u()),platformId:F(u()),platformRole:D(To),lastName:u(),created:Pe,updated:Pe,lastActiveDate:F(Pe),imageUrl:F(u())});var Pr=g({...U.shape,...N($(u(),z()),"OBJECT").shape});var zo=g({...U.shape,...N(u(),"COLOR").shape});var Tr=C([X,ue,Nt,me,Y,de,ur,Xe,dr,fe,et,Pr,tt,Qe,Ye,zo]),q={ShortText(r){return{...r,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(r){return{...r,valueSchema:void 0,type:"CHECKBOX"}},LongText(r){return{...r,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(r){return{displayName:"Markdown",required:!1,description:r.value,type:"MARKDOWN",valueSchema:void 0,variant:r.variant??"INFO"}},Number(r){return{...r,valueSchema:void 0,type:"NUMBER"}},Json(r){return{...r,valueSchema:void 0,type:"JSON"}},Array(r){return{...r,valueSchema:void 0,type:"ARRAY"}},Object(r){return{...r,valueSchema:void 0,type:"OBJECT"}},Dropdown(r){return{...r,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(r){return{...r,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(r){return{...r,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(r){return{...r,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(r){return{...r,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(r){return{...r,valueSchema:void 0,type:"DATE_TIME"}},File(r){return{...r,valueSchema:void 0,type:"FILE"}},Custom(r){let e=r.code.toString();return{...r,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(r){return{...r,valueSchema:void 0,type:"COLOR"}}};var ae=g({displayName:u(),description:_(u())});var $o=g({username:u(),password:u()}),Sr=g({...ae.shape,username:g({displayName:u(),description:_(u())}),password:g({displayName:u(),description:_(u())}),...N($o,"BASIC_AUTH").shape});var nl=$(u(),C([X,ue,fe,me,Y])),Ir=g({...ae.shape,props:nl,...N(z(),"CUSTOM_AUTH").shape});var ze=g({...ae.shape,...N(g({auth:u()}),"SECRET_TEXT").shape});var il=$(u(),C([X,ue,ze,fe,me,Y,de,Nt])),ko=g({...ae.shape,props:il,...N(z(),"OIDC").shape});var wr=(t=>(t.HEADER="HEADER",t.BODY="BODY",t))(wr||{}),Oo=C([X,ze,Y]),Co=$(u(),Oo),ol=g({props:_($(u(),Oo)),authUrl:u(),tokenUrl:u(),scope:O(u()),prompt:_(C([S("none"),S("consent"),S("login"),S("omit")])),pkce:_(M()),pkceMethod:_(C([S("plain"),S("S256")])),authorizationMethod:_(D(wr)),grantType:_(C([D(nt),S(mr)])),extra:_($(u(),u()))}),No=g({access_token:u(),props:_(Co),data:$(u(),We())}),Ar=g({...ae.shape,...ol.shape,...N(No,"OAUTH2").shape});var je=C([Sr,Ir,ko,Ar,ze]),ct="Connection",Mt={SecretText(r){return{...r,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(r){return{...r,valueSchema:void 0,type:"OAUTH2",displayName:r.displayName||ct}},BasicAuth(r){return{...r,valueSchema:void 0,type:"BASIC_AUTH",displayName:r.displayName||ct,required:!0}},CustomAuth(r){return{...r,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:r.displayName||ct}},OIDC(r){return{...r,valueSchema:void 0,type:"OIDC",displayName:r.displayName||ct}},None(){}};var CS={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var al=g({...U.shape,...N(z(),"CUSTOM").shape,code:u()});var cl=C([Tr,je]),zr=$(u(),cl),QS=$(u(),Tr);var Ro=C([g({strategy:S("CRON"),cronExpression:u()}),g({strategy:S("NONE")})]);var Do="2",jt="0.82.0";var $r=class{constructor(e,t,n,i,o,a,s,c,p=jt,f,x="",m){this.displayName=e;this.logoUrl=t;this.authors=n;this.events=i;this.categories=s;this.auth=c;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=x;this.deprecated=m;this._actions={};this._triggers={};this.getContextInfo=l(()=>({version:Do}),"getContextInfo");(!pl(p)||ll(p,jt))&&(this.minimumSupportedRelease=jt),o.forEach(d=>this._actions[d.name]=d),a.forEach(d=>this._triggers[d.name]=d)}static{l(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},Uo=l(r=>{if(r.auth&&Array.isArray(r.auth)&&!r.auth.every((t,n,i)=>n===i.findIndex(o=>o.type===t.type)))throw new Error("Auth properties must be unique by type");return new $r(r.displayName,r.logoUrl,r.authors??[],r.events,r.actions,r.triggers,r.categories??[],r.auth,r.minimumSupportedRelease,r.maximumSupportedRelease,r.description,r.deprecated)},"createPiece");function pl(r){return/^\d+\.\d+\.\d+$/.test(r)}l(pl,"isValidSimpleSemver");function ll(r,e){let[t,n,i]=r.split(".").map(Number),[o,a,s]=e.split(".").map(Number);return t!==o?t<o:n!==a?n<a:i<s}l(ll,"isSemverLessThan");var ul=_($(u(),$(u(),u()))),Mo=g({id:_(u()),name:u(),displayName:u(),logoUrl:u(),description:u(),authors:O(u()),platformId:_(u()),directoryPath:_(u()),auth:_(C([je,O(je)])),version:u(),categories:_(O(D(De))),minimumSupportedRelease:_(u()),maximumSupportedRelease:_(u()),deprecated:_(M()),i18n:ul}),dl=D(["human","ai","both"]),jo=g({description:_(u()),idempotent:_(M())}),Lo=g({name:u(),displayName:u(),description:u(),props:zr,requireAuth:M(),errorHandlingOptions:_(lr),outputSchema:_(Ot()),audience:_(dl),aiMetadata:_(jo)}),Fo=g({name:u(),displayName:u(),description:u(),props:zr,errorHandlingOptions:_(lr),type:D(Ie),sampleData:z(),handshakeConfiguration:_(Ot()),renewConfiguration:_(Ro),testStrategy:D(ot),outputSchema:_(Ot()),aiMetadata:_(jo)}),ml=g({...Mo.shape,actions:$(u(),Lo),triggers:$(u(),Fo)}),fl=g({...Mo.shape,actions:W(),triggers:W(),suggestedActions:_(O(Lo)),suggestedTriggers:_(O(Fo))}),Bo=g({projectUsage:W(),pieceType:D(Re),packageType:D(rt),platformId:_(u()),archiveId:_(u())}),QI=g({...ml.shape,...Bo.shape}),ew=g({...fl.shape,...Bo.shape}),tw=g({name:u(),version:u()});var hl=Oe(require("path")),gl=Oe(require("fs/promises"));var Us=Oe(Ds()),xt={constructConfig(r){let e=r.email&&r.password;return{host:r.host,port:r.port,requireTLS:r.TLS,...e?{auth:{user:r.email,pass:r.password}}:{},connectionTimeout:6e4,secure:r.port===465}},createSMTPTransport(r){let e=xt.constructConfig(r);return Us.default.createTransport(e)}};var Zs=Oe(Bs());var Hs=Li({audience:"both",auth:Gt,name:"send-email",displayName:"Send Email",description:"Send an email using a custom SMTP server.",props:{from:q.ShortText({displayName:"From Email",required:!0}),senderName:q.ShortText({displayName:"Sender Name",required:!1}),to:q.Array({displayName:"To",required:!0}),cc:q.Array({displayName:"CC",required:!1}),replyTo:q.ShortText({displayName:"Reply To",required:!1}),bcc:q.Array({displayName:"BCC",required:!1}),subject:q.ShortText({displayName:"Subject",required:!0}),body_type:q.StaticDropdown({displayName:"Body Type",required:!0,defaultValue:"plain_text",options:{disabled:!1,options:[{label:"plain text",value:"plain_text"},{label:"html",value:"html"}]}}),body:q.LongText({displayName:"Body",required:!0}),customHeaders:q.Object({displayName:"Custom Headers",required:!1}),attachments:q.Array({displayName:"Attachments",required:!1,properties:{file:q.File({displayName:"File",description:"File to attach to the email you want to send",required:!0}),name:q.ShortText({displayName:"Attachment Name",description:"In case you want to change the name of the attachment",required:!1})}})},run:l(async({auth:r,propsValue:e})=>{let t=xt.createSMTPTransport(r.props),i=e.attachments.map(({file:a,name:s})=>{let c=Zs.default.lookup(a.extension?a.extension:"");return{filename:s??a.filename,content:a?.base64,contentType:c||void 0,encoding:"base64"}}),o={from:Fd(e.senderName,e.from),to:e.to.join(","),cc:e.cc?.join(","),inReplyTo:e.replyTo,bcc:e.bcc?.join(","),subject:e.subject,text:e.body_type==="plain_text"?e.body:void 0,html:e.body_type==="html"?e.body:void 0,attachments:i||void 0,headers:e.customHeaders};return await Ld(t,o)},"run")});async function Ld(r,e){let n=0;for(;n<3;)try{return await r.sendMail(e)}catch(i){if("code"in i&&i.code==="ECONNRESET"&&n<2){n++,await new Promise(o=>setTimeout(o,3e3));continue}throw i}}l(Ld,"sendWithRetry");function Fd(r,e){return r?`"${r}" <${e}>`:e}l(Fd,"getFrom");var Bd=[25,465,587,2525],Gt=Mt.CustomAuth({required:!0,props:{host:q.ShortText({displayName:"Host",required:!0}),email:q.ShortText({displayName:"Email",description:"Leave blank if your mail relay does not require authentication.",required:!1}),password:Mt.SecretText({displayName:"Password",description:"Leave blank if your mail relay does not require authentication.",required:!1}),port:q.StaticDropdown({displayName:"Port",required:!0,options:{disabled:!1,options:Bd.map(r=>({label:r.toString(),value:r}))}}),TLS:q.Checkbox({displayName:"Require TLS?",defaultValue:!1,required:!0})},validate:l(async({auth:r})=>{try{let e=xt.createSMTPTransport(r);return new Promise((t,n)=>{e.verify(function(i,o){t(i?{valid:!1,error:JSON.stringify(i)}:{valid:!0})})})}catch(e){switch(e?.code){case"EDNS":return{valid:!1,error:"SMTP server not found or unreachable with error code: EDNS"};case"CONN":return{valid:!1,error:"SMTP server connection failed with error code: CONN"};default:break}return{valid:!1,error:JSON.stringify(e)}}},"validate")}),Zd=Uo({displayName:"SMTP",description:"Send emails using Simple Mail Transfer Protocol",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/new-core/smtp.svg",categories:["CORE"],authors:["tahboubali","abaza738","kishanprmr","MoShizzle","khaledmashaly","abuaboud","pfernandez98"],auth:Gt,actions:[Hs],triggers:[]});0&&(module.exports={smtp,smtpAuth});
53
+ /*! Bundled license information:
54
+
55
+ mime-types/index.js:
56
+ (*!
57
+ * mime-types
58
+ * Copyright(c) 2014 Jonathan Ong
59
+ * Copyright(c) 2015 Douglas Christopher Wilson
60
+ * MIT Licensed
61
+ *)
62
+ */