@activepieces/piece-microsoft-outlook 0.3.6 → 0.5.0
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/package.json +7 -13
- package/src/index.js +39 -63
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-label-to-email.d.ts +0 -5
- package/src/lib/actions/add-label-to-email.d.ts.map +0 -1
- package/src/lib/actions/add-label-to-email.js +0 -50
- package/src/lib/actions/add-label-to-email.js.map +0 -1
- package/src/lib/actions/create-draft-email.d.ts +0 -10
- package/src/lib/actions/create-draft-email.d.ts.map +0 -1
- package/src/lib/actions/create-draft-email.js +0 -114
- package/src/lib/actions/create-draft-email.js.map +0 -1
- package/src/lib/actions/download-email-attachment.d.ts +0 -4
- package/src/lib/actions/download-email-attachment.d.ts.map +0 -1
- package/src/lib/actions/download-email-attachment.js +0 -50
- package/src/lib/actions/download-email-attachment.js.map +0 -1
- package/src/lib/actions/find-email.d.ts +0 -6
- package/src/lib/actions/find-email.d.ts.map +0 -1
- package/src/lib/actions/find-email.js +0 -73
- package/src/lib/actions/find-email.js.map +0 -1
- package/src/lib/actions/forward-email.d.ts +0 -6
- package/src/lib/actions/forward-email.d.ts.map +0 -1
- package/src/lib/actions/forward-email.js +0 -67
- package/src/lib/actions/forward-email.js.map +0 -1
- package/src/lib/actions/move-email-to-folder.d.ts +0 -5
- package/src/lib/actions/move-email-to-folder.d.ts.map +0 -1
- package/src/lib/actions/move-email-to-folder.js +0 -47
- package/src/lib/actions/move-email-to-folder.js.map +0 -1
- package/src/lib/actions/remove-label-from-email.d.ts +0 -5
- package/src/lib/actions/remove-label-from-email.d.ts.map +0 -1
- package/src/lib/actions/remove-label-from-email.js +0 -50
- package/src/lib/actions/remove-label-from-email.js.map +0 -1
- package/src/lib/actions/reply-email.d.ts +0 -10
- package/src/lib/actions/reply-email.d.ts.map +0 -1
- package/src/lib/actions/reply-email.js +0 -174
- package/src/lib/actions/reply-email.js.map +0 -1
- package/src/lib/actions/request-approval-send-email.d.ts +0 -6
- package/src/lib/actions/request-approval-send-email.d.ts.map +0 -1
- package/src/lib/actions/request-approval-send-email.js +0 -110
- package/src/lib/actions/request-approval-send-email.js.map +0 -1
- package/src/lib/actions/send-draft-email.d.ts +0 -4
- package/src/lib/actions/send-draft-email.d.ts.map +0 -1
- package/src/lib/actions/send-draft-email.js +0 -44
- package/src/lib/actions/send-draft-email.js.map +0 -1
- package/src/lib/actions/send-email.d.ts +0 -10
- package/src/lib/actions/send-email.d.ts.map +0 -1
- package/src/lib/actions/send-email.js +0 -117
- package/src/lib/actions/send-email.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -2
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -51
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/microsoft-cloud.d.ts +0 -5
- package/src/lib/common/microsoft-cloud.d.ts.map +0 -1
- package/src/lib/common/microsoft-cloud.js +0 -38
- package/src/lib/common/microsoft-cloud.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -10
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -141
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-attachment.d.ts +0 -19
- package/src/lib/triggers/new-attachment.d.ts.map +0 -1
- package/src/lib/triggers/new-attachment.js +0 -142
- package/src/lib/triggers/new-attachment.js.map +0 -1
- package/src/lib/triggers/new-email-in-folder.d.ts +0 -11
- package/src/lib/triggers/new-email-in-folder.d.ts.map +0 -1
- package/src/lib/triggers/new-email-in-folder.js +0 -102
- package/src/lib/triggers/new-email-in-folder.js.map +0 -1
- package/src/lib/triggers/new-email.d.ts +0 -15
- package/src/lib/triggers/new-email.d.ts.map +0 -1
- package/src/lib/triggers/new-email.js +0 -126
- package/src/lib/triggers/new-email.js.map +0 -1
package/src/index.js
CHANGED
|
@@ -1,63 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const new_email_in_folder_1 = require("./lib/triggers/new-email-in-folder");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
send_draft_email_1.sendDraftEmailAction,
|
|
41
|
-
forward_email_1.forwardEmailAction,
|
|
42
|
-
find_email_1.findEmailAction,
|
|
43
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
44
|
-
auth: auth_1.microsoftOutlookAuth,
|
|
45
|
-
baseUrl: (auth) => {
|
|
46
|
-
var _a;
|
|
47
|
-
const cloud = (_a = auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
|
|
48
|
-
return (0, microsoft_cloud_1.getGraphBaseUrl)(cloud) + '/v1.0/';
|
|
49
|
-
},
|
|
50
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
return ({
|
|
52
|
-
Authorization: `Bearer ${auth.access_token}`,
|
|
53
|
-
});
|
|
54
|
-
}),
|
|
55
|
-
}),
|
|
56
|
-
],
|
|
57
|
-
triggers: [
|
|
58
|
-
new_email_1.newEmailTrigger,
|
|
59
|
-
new_email_in_folder_1.newEmailInFolderTrigger,
|
|
60
|
-
new_attachment_1.newAttachmentTrigger,
|
|
61
|
-
],
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var qp=Object.create;var Zt=Object.defineProperty;var Gp=Object.getOwnPropertyDescriptor;var Wp=Object.getOwnPropertyNames;var Kp=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty;var a=(e,t)=>Zt(e,"name",{value:t,configurable:!0});var Xp=(e,t)=>()=>(e&&(t=e(e=0)),t);var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),io=(e,t)=>{for(var r in t)Zt(e,r,{get:t[r],enumerable:!0})},Vi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wp(t))!Jp.call(e,o)&&o!==r&&Zt(e,o,{get:()=>t[o],enumerable:!(n=Gp(t,o))||n.enumerable});return e};var ze=(e,t,r)=>(r=e!=null?qp(Kp(e)):{},Vi(t||!e||!e.__esModule?Zt(r,"default",{value:e,enumerable:!0}):r,e)),oe=e=>Vi(Zt({},"__esModule",{value:!0}),e);var as=b((is,Fr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function p(l,m){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let _=0,h=-1,x=(l.match(u.zoneIndex)||[])[0],T,V;for(x&&(x=x.substring(1),l=l.replace(/%.+$/,""));(h=l.indexOf(":",h+1))>=0;)_++;if(l.substr(0,2)==="::"&&_--,l.substr(-2,2)==="::"&&_--,_>m)return null;for(V=m-_,T=":";V--;)T+="0:";return l=l.replace("::",T),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),m=function(){let de=l.split(":"),xe=[];for(let De=0;De<de.length;De++)xe.push(parseInt(de[De],16));return xe}(),{parts:m,zoneId:x}}a(p,"expandIPv6");function d(l,m,_,h){if(l.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,T;for(;h>0;){if(T=_-h,T<0&&(T=0),l[x]>>T!==m[x]>>T)return!1;h-=_,x+=1}return!0}a(d,"matchCIDR");function f(l){if(o.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}a(f,"parseIntAuto");function v(l,m){for(;l.length<m;)l=`0${l}`;return l}a(v,"padPart");let y={};y.IPv4=function(){function l(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,h;for(_=0;_<m.length;_++)if(h=m[_],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return a(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(m,_){let h;if(_===void 0&&(h=m,m=h[0],_=h[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,m.octets,8,_)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,T,V;for(x=3;x>=0;x-=1)if(T=this.octets[x],T in h){if(V=h[T],_&&V!==0)return null;V!==8&&(_=!0),m+=V}else return null;return 32-m},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l}(),y.IPv4.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],T=0;for(;T<4;)x.push(parseInt(_[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(l){return this.parser(l)!==null},y.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(l){return!!(y.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(l){let m=l.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(l)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(l){let m,_,h,x,T;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),T=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<4;)x.push(parseInt(h[_],10)&parseInt(T[_],10)),_++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(l){let m=this.parser(l);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(l){let m;if(m=l.match(/^(.+)\/(\d+)$/)){let _=parseInt(m[2]);if(_>=0&&_<=32){let h=[this.parse(m[1]),_];return Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(l){let m,_,h;if(m=l.match(r.fourOctet))return function(){let x=m.slice(1,6),T=[];for(let V=0;V<x.length;V++)_=x[V],T.push(f(_));return T}();if(m=l.match(r.longValue)){if(h=f(m[1]),h>4294967295||h<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],T;for(T=0;T<=24;T+=8)x.push(h>>T&255);return x}().reverse()}else return(m=l.match(r.twoOctet))?function(){let x=m.slice(1,4),T=[];if(h=f(x[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return T.push(f(x[0])),T.push(h>>16&255),T.push(h>>8&255),T.push(h&255),T}():(m=l.match(r.threeOctet))?function(){let x=m.slice(1,5),T=[];if(h=f(x[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return T.push(f(x[0])),T.push(f(x[1])),T.push(h>>8&255),T.push(h&255),T}():null},y.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],_=0,h=Math.floor(l/8);for(;_<h;)m[_]=255,_++;return h<4&&(m[h]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.IPv6=function(){function l(m,_){let h,x;if(m.length===16)for(this.parts=[],h=0;h<=14;h+=2)this.parts.push(m[h]<<8|m[h+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(h=0;h<this.parts.length;h++)if(x=this.parts[h],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");_&&(this.zoneId=_)}return a(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(m,_){let h;if(_===void 0&&(h=m,m=h[0],_=h[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,m.parts,16,_)},l.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,h={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},x,T;for(let V=7;V>=0;V-=1)if(x=this.parts[V],x in h){if(T=h[x],_&&T!==0)return null;T!==16&&(_=!0),m+=T}else return null;return 128-m},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let m,_=[],h=this.parts;for(let x=0;x<h.length;x++)m=h[x],_.push(m>>8),_.push(m&255);return _},l.prototype.toFixedLengthString=function(){let m=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(v(this.parts[x].toString(16),4));return h}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),_=m[0],h=m[1];return new y.IPv4([_>>8,_&255,h>>8,h&255])},l.prototype.toNormalizedString=function(){let m=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(this.parts[x].toString(16));return h}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},l.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,_=this.toNormalizedString(),h=0,x=-1,T;for(;T=m.exec(_);)T[0].length>x&&(h=T.index,x=T[0].length);return x<0?_:`${_.substring(0,h)}::${_.substring(h+x)}`},l.prototype.toString=function(){return this.toRFC5952String()},l}(),y.IPv6.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],T=0;for(;T<16;)x.push(parseInt(_[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},y.IPv6.isIPv6=function(l){return this.parser(l)!==null},y.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let m=this.parser(l);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(l){let m,_,h,x,T;try{for(m=this.parseCIDR(l),h=m[0].toByteArray(),T=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<16;)x.push(parseInt(h[_],10)&parseInt(T[_],10)),_++;return new this(x)}catch(V){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${V})`)}},y.IPv6.parse=function(l){let m=this.parser(l);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},y.IPv6.parseCIDR=function(l){let m,_,h;if((_=l.match(/^(.+)\/(\d+)$/))&&(m=parseInt(_[2]),m>=0&&m<=128))return h=[this.parse(_[1]),m],Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(l){let m,_,h,x,T,V;if(h=l.match(u.deprecatedTransitional))return this.parser(`::ffff:${h[1]}`);if(u.native.test(l))return p(l,8);if((h=l.match(u.transitional))&&(V=h[6]||"",m=h[1],h[1].endsWith("::")||(m=m.slice(0,-1)),m=p(m+V,6),m.parts)){for(T=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],_=0;_<T.length;_++)if(x=T[_],!(0<=x&&x<=255))return null;return m.parts.push(T[0]<<8|T[1]),m.parts.push(T[2]<<8|T[3]),{parts:m.parts,zoneId:m.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0,h=Math.floor(l/8);for(;_<h;)m[_]=255,_++;return h<16&&(m[h]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.fromByteArray=function(l){let m=l.length;if(m===4)return new y.IPv4(l);if(m===16)return new y.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(l){return y.IPv6.isValid(l)||y.IPv4.isValid(l)},y.isValidCIDR=function(l){return y.IPv6.isValidCIDR(l)||y.IPv4.isValidCIDR(l)},y.parse=function(l){if(y.IPv6.isValid(l))return y.IPv6.parse(l);if(y.IPv4.isValid(l))return y.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(l){try{return y.IPv6.parseCIDR(l)}catch{try{return y.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(l){let m=this.parse(l);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},y.subnetMatch=function(l,m,_){let h,x,T,V;_==null&&(_="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(T=m[x],T[0]&&!(T[0]instanceof Array)&&(T=[T]),h=0;h<T.length;h++)if(V=T[h],l.kind()===V[0].kind()&&l.match.apply(l,V))return x}return _},typeof Fr<"u"&&Fr.exports?Fr.exports=y:e.ipaddr=y})(is)});var ru=b((ED,tu)=>{var eu=require("stream").Stream,Sm=require("util");tu.exports=ke;function ke(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(ke,"DelayedStream");Sm.inherits(ke,eu);ke.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ke.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});ke.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ke.prototype.resume=function(){this._released||this.release(),this.source.resume()};ke.prototype.pause=function(){this.source.pause()};ke.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ke.prototype.pipe=function(){var e=eu.prototype.pipe.apply(this,arguments);return this.resume(),e};ke.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ke.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var au=b((AD,iu)=>{var $m=require("util"),ou=require("stream").Stream,nu=ru();iu.exports=pe;function pe(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}a(pe,"CombinedStream");$m.inherits(pe,ou);pe.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};pe.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};pe.prototype.append=function(e){var t=pe.isStreamLike(e);if(t){if(!(e instanceof nu)){var r=nu.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};pe.prototype.pipe=function(e,t){return ou.prototype.pipe.call(this,e,t),this.resume(),e};pe.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};pe.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=pe.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};pe.prototype._pipeNext=function(e){this._currentStream=e;var t=pe.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};pe.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};pe.prototype.write=function(e){this.emit("data",e)};pe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};pe.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};pe.prototype.end=function(){this._reset(),this.emit("end")};pe.prototype.destroy=function(){this._reset(),this.emit("close")};pe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};pe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};pe.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};pe.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var uu=b(($D,su)=>{"use strict";su.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 pu=b(Te=>{"use strict";var Gr=uu(),wm=require("path").extname,cu=/^\s*([^;\s]*)(?:;|\s|$)/,Om=/^text\//i;Te.charset=lu;Te.charsets={lookup:lu};Te.contentType=zm;Te.extension=Rm;Te.extensions=Object.create(null);Te.lookup=km;Te.types=Object.create(null);Dm(Te.extensions,Te.types);function lu(e){if(!e||typeof e!="string")return!1;var t=cu.exec(e),r=t&&Gr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Om.test(t[1])?"UTF-8":!1}a(lu,"charset");function zm(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(zm,"contentType");function Rm(e){if(!e||typeof e!="string")return!1;var t=cu.exec(e),r=t&&Te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Rm,"extension");function km(e){if(!e||typeof e!="string")return!1;var t=wm("x."+e).toLowerCase().substr(1);return t&&Te.types[t]||!1}a(km,"lookup");function Dm(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Gr).forEach(a(function(o){var i=Gr[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var u=0;u<s.length;u++){var p=s[u];if(t[p]){var d=r.indexOf(Gr[t[p]].source),f=r.indexOf(i.source);if(t[p]!=="application/octet-stream"&&(d>f||d===f&&t[p].substr(0,12)==="application/"))continue}t[p]=o}}},"forEachMimeType"))}a(Dm,"populateMaps")});var fu=b((zD,du)=>{du.exports=Cm;function Cm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(Cm,"defer")});var Wo=b((kD,gu)=>{var mu=fu();gu.exports=Nm;function Nm(e){var t=!1;return mu(function(){t=!0}),a(function(n,o){t?e(n,o):mu(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(Nm,"async")});var Ko=b((CD,hu)=>{hu.exports=Mm;function Mm(e){Object.keys(e.jobs).forEach(Um.bind(e)),e.jobs={}}a(Mm,"abort");function Um(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(Um,"clean")});var Jo=b((MD,vu)=>{var yu=Wo(),Lm=Ko();vu.exports=jm;function jm(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Fm(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?Lm(r):r.results[o]=s,n(i,r.results))})}a(jm,"iterate");function Fm(e,t,r,n){var o;return e.length==2?o=e(r,yu(n)):o=e(r,t,yu(n)),o}a(Fm,"runJob")});var Xo=b((LD,_u)=>{_u.exports=Bm;function Bm(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,i){return t(e[o],e[i])}),n}a(Bm,"state")});var Yo=b((FD,xu)=>{var Vm=Ko(),Hm=Wo();xu.exports=Zm;function Zm(e){Object.keys(this.jobs).length&&(this.index=this.size,Vm(this),Hm(e)(null,this.results))}a(Zm,"terminator")});var bu=b((VD,Pu)=>{var qm=Jo(),Gm=Xo(),Wm=Yo();Pu.exports=Km;function Km(e,t,r){for(var n=Gm(e);n.index<(n.keyedList||e).length;)qm(e,t,n,function(o,i){if(o){r(o,i);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Wm.bind(n,r)}a(Km,"parallel")});var Qo=b((ZD,Wr)=>{var Tu=Jo(),Jm=Xo(),Xm=Yo();Wr.exports=Ym;Wr.exports.ascending=Eu;Wr.exports.descending=Qm;function Ym(e,t,r,n){var o=Jm(e,r);return Tu(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Tu(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),Xm.bind(o,n)}a(Ym,"serialOrdered");function Eu(e,t){return e<t?-1:e>t?1:0}a(Eu,"ascending");function Qm(e,t){return-1*Eu(e,t)}a(Qm,"descending")});var Au=b((GD,Iu)=>{var eg=Qo();Iu.exports=tg;function tg(e,t,r){return eg(e,t,null,r)}a(tg,"serial")});var $u=b((KD,Su)=>{Su.exports={parallel:bu(),serial:Au(),serialOrdered:Qo()}});var ei=b((JD,wu)=>{"use strict";wu.exports=Object});var zu=b((XD,Ou)=>{"use strict";Ou.exports=Error});var ku=b((YD,Ru)=>{"use strict";Ru.exports=EvalError});var Cu=b((QD,Du)=>{"use strict";Du.exports=RangeError});var Mu=b((eC,Nu)=>{"use strict";Nu.exports=ReferenceError});var Lu=b((tC,Uu)=>{"use strict";Uu.exports=SyntaxError});var Kr=b((rC,ju)=>{"use strict";ju.exports=TypeError});var Bu=b((nC,Fu)=>{"use strict";Fu.exports=URIError});var Hu=b((oC,Vu)=>{"use strict";Vu.exports=Math.abs});var qu=b((iC,Zu)=>{"use strict";Zu.exports=Math.floor});var Wu=b((aC,Gu)=>{"use strict";Gu.exports=Math.max});var Ju=b((sC,Ku)=>{"use strict";Ku.exports=Math.min});var Yu=b((uC,Xu)=>{"use strict";Xu.exports=Math.pow});var ec=b((cC,Qu)=>{"use strict";Qu.exports=Math.round});var rc=b((lC,tc)=>{"use strict";tc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var oc=b((dC,nc)=>{"use strict";var rg=rc();nc.exports=a(function(t){return rg(t)||t===0?t:t<0?-1:1},"sign")});var ac=b((mC,ic)=>{"use strict";ic.exports=Object.getOwnPropertyDescriptor});var ti=b((gC,sc)=>{"use strict";var Jr=ac();if(Jr)try{Jr([],"length")}catch{Jr=null}sc.exports=Jr});var cc=b((hC,uc)=>{"use strict";var Xr=Object.defineProperty||!1;if(Xr)try{Xr({},"a",{value:1})}catch{Xr=!1}uc.exports=Xr});var ri=b((yC,lc)=>{"use strict";lc.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,r);if(u.value!==o||u.enumerable!==!0)return!1}return!0},"hasSymbols")});var fc=b((_C,dc)=>{"use strict";var pc=typeof Symbol<"u"&&Symbol,ng=ri();dc.exports=a(function(){return typeof pc!="function"||typeof Symbol!="function"||typeof pc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ng()},"hasNativeSymbols")});var ni=b((PC,mc)=>{"use strict";mc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var oi=b((bC,gc)=>{"use strict";var og=ei();gc.exports=og.getPrototypeOf||null});var vc=b((TC,yc)=>{"use strict";var ig="Function.prototype.bind called on incompatible ",ag=Object.prototype.toString,sg=Math.max,ug="[object Function]",hc=a(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},"concatty"),cg=a(function(t,r){for(var n=[],o=r||0,i=0;o<t.length;o+=1,i+=1)n[i]=t[o];return n},"slicy"),lg=a(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");yc.exports=a(function(t){var r=this;if(typeof r!="function"||ag.apply(r)!==ug)throw new TypeError(ig+r);for(var n=cg(arguments,1),o,i=a(function(){if(this instanceof o){var f=r.apply(this,hc(n,arguments));return Object(f)===f?f:this}return r.apply(t,hc(n,arguments))},"binder"),s=sg(0,r.length-n.length),u=[],p=0;p<s;p++)u[p]="$"+p;if(o=Function("binder","return function ("+lg(u,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var d=a(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var $t=b((IC,_c)=>{"use strict";var pg=vc();_c.exports=Function.prototype.bind||pg});var Yr=b((AC,xc)=>{"use strict";xc.exports=Function.prototype.call});var ii=b((SC,Pc)=>{"use strict";Pc.exports=Function.prototype.apply});var Tc=b(($C,bc)=>{"use strict";bc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ic=b((wC,Ec)=>{"use strict";var dg=$t(),fg=ii(),mg=Yr(),gg=Tc();Ec.exports=gg||dg.call(mg,fg)});var Sc=b((OC,Ac)=>{"use strict";var hg=$t(),yg=Kr(),vg=Yr(),_g=Ic();Ac.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new yg("a function is required");return _g(hg,vg,t)},"callBindBasic")});var kc=b((RC,Rc)=>{"use strict";var xg=Sc(),$c=ti(),Oc;try{Oc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var ai=!!Oc&&$c&&$c(Object.prototype,"__proto__"),zc=Object,wc=zc.getPrototypeOf;Rc.exports=ai&&typeof ai.get=="function"?xg([ai.get]):typeof wc=="function"?a(function(t){return wc(t==null?t:zc(t))},"getDunder"):!1});var Uc=b((DC,Mc)=>{"use strict";var Dc=ni(),Cc=oi(),Nc=kc();Mc.exports=Dc?a(function(t){return Dc(t)},"getProto"):Cc?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Cc(t)},"getProto"):Nc?a(function(t){return Nc(t)},"getProto"):null});var si=b((NC,Lc)=>{"use strict";var Pg=Function.prototype.call,bg=Object.prototype.hasOwnProperty,Tg=$t();Lc.exports=Tg.call(Pg,bg)});var qc=b((MC,Zc)=>{"use strict";var K,Eg=ei(),Ig=zu(),Ag=ku(),Sg=Cu(),$g=Mu(),Rt=Lu(),zt=Kr(),wg=Bu(),Og=Hu(),zg=qu(),Rg=Wu(),kg=Ju(),Dg=Yu(),Cg=ec(),Ng=oc(),Vc=Function,ui=a(function(e){try{return Vc('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),dr=ti(),Mg=cc(),ci=a(function(){throw new zt},"throwTypeError"),Ug=dr?function(){try{return arguments.callee,ci}catch{try{return dr(arguments,"callee").get}catch{return ci}}}():ci,wt=fc()(),ve=Uc(),Lg=oi(),jg=ni(),Hc=ii(),fr=Yr(),Ot={},Fg=typeof Uint8Array>"u"||!ve?K:ve(Uint8Array),dt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":wt&&ve?ve([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":Ot,"%AsyncGenerator%":Ot,"%AsyncGeneratorFunction%":Ot,"%AsyncIteratorPrototype%":Ot,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ig,"%eval%":eval,"%EvalError%":Ag,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":Vc,"%GeneratorFunction%":Ot,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":wt&&ve?ve(ve([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!wt||!ve?K:ve(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Eg,"%Object.getOwnPropertyDescriptor%":dr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":Sg,"%ReferenceError%":$g,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!wt||!ve?K:ve(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":wt&&ve?ve(""[Symbol.iterator]()):K,"%Symbol%":wt?Symbol:K,"%SyntaxError%":Rt,"%ThrowTypeError%":Ug,"%TypedArray%":Fg,"%TypeError%":zt,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":wg,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":fr,"%Function.prototype.apply%":Hc,"%Object.defineProperty%":Mg,"%Object.getPrototypeOf%":Lg,"%Math.abs%":Og,"%Math.floor%":zg,"%Math.max%":Rg,"%Math.min%":kg,"%Math.pow%":Dg,"%Math.round%":Cg,"%Math.sign%":Ng,"%Reflect.getPrototypeOf%":jg};if(ve)try{null.error}catch(e){jc=ve(ve(e)),dt["%Error.prototype%"]=jc}var jc,Bg=a(function e(t){var r;if(t==="%AsyncFunction%")r=ui("async function () {}");else if(t==="%GeneratorFunction%")r=ui("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ui("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ve&&(r=ve(o.prototype))}return dt[t]=r,r},"doEval"),Fc={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},mr=$t(),Qr=si(),Vg=mr.call(fr,Array.prototype.concat),Hg=mr.call(Hc,Array.prototype.splice),Bc=mr.call(fr,String.prototype.replace),en=mr.call(fr,String.prototype.slice),Zg=mr.call(fr,RegExp.prototype.exec),qg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gg=/\\(\\)?/g,Wg=a(function(t){var r=en(t,0,1),n=en(t,-1);if(r==="%"&&n!=="%")throw new Rt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Rt("invalid intrinsic syntax, expected opening `%`");var o=[];return Bc(t,qg,function(i,s,u,p){o[o.length]=u?Bc(p,Gg,"$1"):s||i}),o},"stringToPath"),Kg=a(function(t,r){var n=t,o;if(Qr(Fc,n)&&(o=Fc[n],n="%"+o[0]+"%"),Qr(dt,n)){var i=dt[n];if(i===Ot&&(i=Bg(n)),typeof i>"u"&&!r)throw new zt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Rt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Zc.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new zt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new zt('"allowMissing" argument must be a boolean');if(Zg(/^%?[^%]*%?$/,t)===null)throw new Rt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wg(t),o=n.length>0?n[0]:"",i=Kg("%"+o+"%",r),s=i.name,u=i.value,p=!1,d=i.alias;d&&(o=d[0],Hg(n,Vg([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],l=en(y,0,1),m=en(y,-1);if((l==='"'||l==="'"||l==="`"||m==='"'||m==="'"||m==="`")&&l!==m)throw new Rt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(p=!0),o+="."+y,s="%"+o+"%",Qr(dt,s))u=dt[s];else if(u!=null){if(!(y in u)){if(!r)throw new zt("base intrinsic for "+t+" exists, but the property is not available.");return}if(dr&&f+1>=n.length){var _=dr(u,y);v=!!_,v&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[y]}else v=Qr(u,y),u=u[y];v&&!p&&(dt[s]=u)}}return u},"GetIntrinsic")});var Wc=b((LC,Gc)=>{"use strict";var Jg=ri();Gc.exports=a(function(){return Jg()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Xc=b((FC,Jc)=>{"use strict";var Xg=qc(),Kc=Xg("%Object.defineProperty%",!0),Yg=Wc()(),Qg=si(),eh=Kr(),tn=Yg?Symbol.toStringTag:null;Jc.exports=a(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new eh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tn&&(n||!Qg(t,tn))&&(Kc?Kc(t,tn,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[tn]=r)},"setToStringTag")});var Qc=b((VC,Yc)=>{"use strict";var th=Function.prototype.call,rh=Object.prototype.hasOwnProperty,nh=$t();Yc.exports=nh.call(th,rh)});var tl=b((HC,el)=>{"use strict";el.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ol=b((ZC,nl)=>{"use strict";var fi=au(),oh=require("util"),li=require("path"),ih=require("http"),ah=require("https"),sh=require("url").parse,uh=require("fs"),ch=require("stream").Stream,lh=require("crypto"),pi=pu(),ph=$u(),dh=Xc(),tt=Qc(),di=tl();function rl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(rl,"escapeHeaderParam");function X(e){if(!(this instanceof X))return new X(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fi.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(X,"FormData");oh.inherits(X,fi);X.LINE_BREAK=`\r
|
|
2
|
+
`;X.DEFAULT_CONTENT_TYPE="application/octet-stream";X.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=fi.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),i=this._multiPartFooter();n(o),n(t),n(i),this._trackLength(o,t,r)};X.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+X.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&tt(t,"httpVersion"))&&!(t instanceof ch))&&(r.knownLength||this._valuesToMeasure.push(t))};X.prototype._lengthRetriever=function(e,t){tt(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):uh.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):tt(e,"httpVersion")?t(null,Number(e.headers["content-length"])):tt(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};X.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),i="",s={"Content-Disposition":["form-data",'name="'+rl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&di(s,r.header);var u;for(var p in s)if(tt(s,p)){if(u=s[p],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=p+": "+u.join("; ")+X.LINE_BREAK)}return"--"+this.getBoundary()+X.LINE_BREAK+i+X.LINE_BREAK};X.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=li.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=li.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&tt(e,"httpVersion")&&(r=li.basename(e.client._httpMessage.path||"")),r)return'filename="'+rl(r)+'"'};X.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pi.lookup(e.name)),!r&&e&&e.path&&(r=pi.lookup(e.path)),!r&&e&&e.readable&&tt(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pi.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=X.DEFAULT_CONTENT_TYPE),r};X.prototype._multiPartFooter=function(){return function(e){var t=X.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};X.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+X.LINE_BREAK};X.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)tt(e,t)&&(r[t.toLowerCase()]=e[t]);return r};X.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};X.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};X.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(X.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};X.prototype._generateBoundary=function(){this._boundary="--------------------------"+lh.randomBytes(12).toString("hex")};X.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};X.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};X.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}ph.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};X.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=sh(e),n=di({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=di(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ah.request(n):r=ih.request(n),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var u,p=a(function(d,f){return r.removeListener("error",p),r.removeListener("response",u),t.call(this,d,f)},"callback");u=p.bind(this,null),r.on("error",p),r.on("response",u)}}.bind(this)),r};X.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};X.prototype.toString=function(){return"[object FormData]"};dh(X.prototype,"FormData");nl.exports=X});var ae={};io(ae,{__addDisposableResource:()=>Ul,__assign:()=>nn,__asyncDelegator:()=>Ol,__asyncGenerator:()=>wl,__asyncValues:()=>zl,__await:()=>kt,__awaiter:()=>Tl,__classPrivateFieldGet:()=>Cl,__classPrivateFieldIn:()=>Ml,__classPrivateFieldSet:()=>Nl,__createBinding:()=>an,__decorate:()=>hl,__disposeResources:()=>Ll,__esDecorate:()=>vl,__exportStar:()=>Il,__extends:()=>ml,__generator:()=>El,__importDefault:()=>Dl,__importStar:()=>kl,__makeTemplateObject:()=>Rl,__metadata:()=>bl,__param:()=>yl,__propKey:()=>xl,__read:()=>hi,__rest:()=>gl,__rewriteRelativeImportExtension:()=>jl,__runInitializers:()=>_l,__setFunctionName:()=>Pl,__spread:()=>Al,__spreadArray:()=>$l,__spreadArrays:()=>Sl,__values:()=>on,default:()=>Ih});function ml(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mi(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function gl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function hl(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function yl(e,t){return function(r,n){t(r,n,e)}}function vl(e,t,r,n,o,i){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}a(s,"accept");for(var u=n.kind,p=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,f=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),v,y=!1,l=r.length-1;l>=0;l--){var m={};for(var _ in n)m[_]=_==="access"?{}:n[_];for(var _ in n.access)m.access[_]=n.access[_];m.addInitializer=function(x){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(x||null))};var h=(0,r[l])(u==="accessor"?{get:f.get,set:f.set}:f[p],m);if(u==="accessor"){if(h===void 0)continue;if(h===null||typeof h!="object")throw new TypeError("Object expected");(v=s(h.get))&&(f.get=v),(v=s(h.set))&&(f.set=v),(v=s(h.init))&&o.unshift(v)}else(v=s(h))&&(u==="field"?o.unshift(v):f[p]=v)}d&&Object.defineProperty(d,n.name,f),y=!0}function _l(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function xl(e){return typeof e=="symbol"?e:"".concat(e)}function Pl(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function bl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Tl(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return a(o,"adopt"),new(r||(r=Promise))(function(i,s){function u(f){try{d(n.next(f))}catch(v){s(v)}}a(u,"fulfilled");function p(f){try{d(n.throw(f))}catch(v){s(v)}}a(p,"rejected");function d(f){f.done?i(f.value):o(f.value).then(u,p)}a(d,"step"),d((n=n.apply(e,t||[])).next())})}function El(e,t){var r={label:0,sent:a(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(d){return function(f){return p([d,f])}}function p(d){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(i=d[0]&2?o.return:d[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,d[1])).done)return i;switch(o=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){r.label=d[1];break}if(d[0]===6&&r.label<i[1]){r.label=i[1],i=d;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(d);break}i[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(f){d=[6,f],o=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Il(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&an(t,e,r)}function on(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:a(function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}},"next")};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(u){s={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function Al(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(hi(arguments[t]));return e}function Sl(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,o++)n[o]=i[s];return n}function $l(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function kt(e){return this instanceof kt?(this.v=e,this):new kt(e)}function wl(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(m){return Promise.resolve(m).then(l,v)}}function u(l,m){n[l]&&(o[l]=function(_){return new Promise(function(h,x){i.push([l,_,h,x])>1||p(l,_)})},m&&(o[l]=m(o[l])))}function p(l,m){try{d(n[l](m))}catch(_){y(i[0][3],_)}}function d(l){l.value instanceof kt?Promise.resolve(l.value.v).then(f,v):y(i[0][2],l)}function f(l){p("next",l)}function v(l){p("throw",l)}function y(l,m){l(m),i.shift(),i.length&&p(i[0][0],i[0][1])}}function Ol(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(s){return(r=!r)?{value:kt(e[o](s)),done:!1}:i?i(s):s}:i}}function zl(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof on=="function"?on(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(u,p){s=e[i](s),o(u,p,s.done,s.value)})}}function o(i,s,u,p){Promise.resolve(p).then(function(d){i({value:d,done:u})},s)}}function Rl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function kl(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=gi(e),n=0;n<r.length;n++)r[n]!=="default"&&an(t,e,r[n]);return Th(t,e),t}function Dl(e){return e&&e.__esModule?e:{default:e}}function Cl(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Nl(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function Ml(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Ul(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=a(function(){try{o.call(this)}catch(i){return Promise.reject(i)}},"dispose")),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}function Ll(e){function t(i){e.error=e.hasError?new Eh(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}a(t,"fail");var r,n=0;function o(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(s){return t(s),o()})}else n|=1}catch(s){t(s)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a(o,"next"),o()}function jl(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,s){return n?t?".jsx":".js":o&&(!i||!s)?r:o+i+"."+s.toLowerCase()+"js"}):e}var mi,nn,an,Th,gi,Eh,Ih,se=Xp(()=>{mi=a(function(e,t){return mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},mi(e,t)},"extendStatics");a(ml,"__extends");nn=a(function(){return nn=Object.assign||a(function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},"__assign"),nn.apply(this,arguments)},"__assign");a(gl,"__rest");a(hl,"__decorate");a(yl,"__param");a(vl,"__esDecorate");a(_l,"__runInitializers");a(xl,"__propKey");a(Pl,"__setFunctionName");a(bl,"__metadata");a(Tl,"__awaiter");a(El,"__generator");an=Object.create?function(e,t,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return t[r]},"get")}),Object.defineProperty(e,n,o)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};a(Il,"__exportStar");a(on,"__values");a(hi,"__read");a(Al,"__spread");a(Sl,"__spreadArrays");a($l,"__spreadArray");a(kt,"__await");a(wl,"__asyncGenerator");a(Ol,"__asyncDelegator");a(zl,"__asyncValues");a(Rl,"__makeTemplateObject");Th=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},gi=a(function(e){return gi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},gi(e)},"ownKeys");a(kl,"__importStar");a(Dl,"__importDefault");a(Cl,"__classPrivateFieldGet");a(Nl,"__classPrivateFieldSet");a(Ml,"__classPrivateFieldIn");a(Ul,"__addDisposableResource");Eh=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};a(Ll,"__disposeResources");a(jl,"__rewriteRelativeImportExtension");Ih={__extends:ml,__assign:nn,__rest:gl,__decorate:hl,__param:yl,__esDecorate:vl,__runInitializers:_l,__propKey:xl,__setFunctionName:Pl,__metadata:bl,__awaiter:Tl,__generator:El,__createBinding:an,__exportStar:Il,__values:on,__read:hi,__spread:Al,__spreadArrays:Sl,__spreadArray:$l,__await:kt,__asyncGenerator:wl,__asyncDelegator:Ol,__asyncValues:zl,__makeTemplateObject:Rl,__importStar:kl,__importDefault:Dl,__classPrivateFieldGet:Cl,__classPrivateFieldSet:Nl,__classPrivateFieldIn:Ml,__addDisposableResource:Ul,__disposeResources:Ll,__rewriteRelativeImportExtension:jl}});var hr=b(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.RequestMethod=void 0;var Fl;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(Fl||(sn.RequestMethod=Fl={}))});var Bl=b(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.BatchRequestContent=void 0;var Dt=(se(),oe(ae)),yi=hr(),Ah=function(){function e(t){if(this.requests=new Map,typeof t<"u"){var r=e.requestLimit;if(t.length>r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}for(var o=0,i=t;o<i.length;o++){var s=i[o];this.addRequest(s)}}}return a(e,"BatchRequestContent"),e.validateDependencies=function(t){var r=a(function(s){for(var u=s.entries(),p=u.next();!p.done;){var d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;p=u.next()}return!0},"isParallel"),n=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;var f=p;for(p=u.next();!p.done;){var v=p.value[1];if(v.dependsOn===void 0||v.dependsOn.length!==1||v.dependsOn[0]!==f.value[1].id)return!1;f=p,p=u.next()}return!0},"isSerial"),o=a(function(s){var u=s.entries(),p=u.next(),d=p.value[1],f;if(d.dependsOn===void 0||d.dependsOn.length===0)f=d.id;else if(d.dependsOn.length===1){var v=d.dependsOn[0];if(v!==d.id&&s.has(v))f=v;else return!1}else return!1;for(p=u.next();!p.done;){var y=p.value[1];if((y.dependsOn===void 0||y.dependsOn.length===0)&&f!==y.id||y.dependsOn!==void 0&&y.dependsOn.length!==0&&(y.dependsOn.length===1&&(y.id===f||y.dependsOn[0]!==f)||y.dependsOn.length>1))return!1;p=u.next()}return!0},"isSame");if(t.size===0){var i=new Error("Empty requests map, Please provide at least one request.");throw i.name="Empty Requests Error",i}return r(t)||n(t)||o(t)},e.getRequestData=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Dt.__generator(this,function(s){switch(s.label){case 0:return r={url:""},n=new RegExp("^https?://"),r.url=n.test(t.url)?"/"+t.url.split(/.*?\/\/.*?\//)[1]:t.url,r.method=t.method,o={},t.headers.forEach(function(u,p){o[p]=u}),Object.keys(o).length&&(r.headers=o),t.method===yi.RequestMethod.PATCH||t.method===yi.RequestMethod.POST||t.method===yi.RequestMethod.PUT?(i=r,[4,e.getRequestBody(t)]):[3,2];case 1:i.body=s.sent(),s.label=2;case 2:return[2,r]}})})},e.getRequestBody=function(t){return Dt.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p,d;return Dt.__generator(this,function(f){switch(f.label){case 0:r=!1,f.label=1;case 1:return f.trys.push([1,3,,4]),o=t.clone(),[4,o.json()];case 2:return n=f.sent(),r=!0,[3,4];case 3:return i=f.sent(),[3,4];case 4:if(r)return[3,12];f.label=5;case 5:return f.trys.push([5,11,,12]),typeof Blob<"u"?[4,t.blob()]:[3,8];case 6:return s=f.sent(),u=new FileReader,[4,new Promise(function(v){u.addEventListener("load",function(){var y=u.result,l=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=l.exec(y);v(m[4])},!1),u.readAsDataURL(s)})];case 7:return n=f.sent(),[3,10];case 8:return typeof Buffer<"u"?[4,t.buffer()]:[3,10];case 9:p=f.sent(),n=p.toString("base64"),f.label=10;case 10:return r=!0,[3,12];case 11:return d=f.sent(),[3,12];case 12:return[2,n]}})})},e.prototype.addRequest=function(t){var r=e.requestLimit;if(t.id===""){var n=new Error("Id for a request is empty, Please provide an unique id");throw n.name="Empty Id For Request",n}if(this.requests.size===r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}if(this.requests.has(t.id)){var n=new Error("Adding request with duplicate id ".concat(t.id,", Make the id of the requests unique"));throw n.name="Duplicate RequestId Error",n}return this.requests.set(t.id,t),t.id},e.prototype.removeRequest=function(t){for(var r=this.requests.delete(t),n=this.requests.entries(),o=n.next();!o.done;){var i=o.value[1].dependsOn;if(typeof i<"u"){var s=i.indexOf(t);s!==-1&&i.splice(s,1),i.length===0&&delete o.value[1].dependsOn}o=n.next()}return r},e.prototype.getContent=function(){return Dt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Dt.__generator(this,function(p){switch(p.label){case 0:if(t=[],r={requests:t},n=this.requests.entries(),o=n.next(),o.done)throw u=new Error("No requests added yet, Please add at least one request."),u.name="Empty Payload",u;if(!e.validateDependencies(this.requests))throw u=new Error(`Invalid dependency found, Dependency should be:
|
|
3
|
+
1. Parallel - no individual request states a dependency in the dependsOn property.
|
|
4
|
+
2. Serial - all individual requests depend on the previous individual request.
|
|
5
|
+
3. Same - all individual requests that state a dependency in the dependsOn property, state the same dependency.`),u.name="Invalid Dependency",u;p.label=1;case 1:return o.done?[3,3]:(i=o.value[1],[4,e.getRequestData(i.request)]);case 2:if(s=p.sent(),s.body!==void 0&&(s.headers===void 0||s.headers["content-type"]===void 0))throw u=new Error("Content-type header is not mentioned for request #".concat(i.id,", For request having body, Content-type header should be mentioned")),u.name="Invalid Content-type header",u;return s.id=i.id,i.dependsOn!==void 0&&i.dependsOn.length>0&&(s.dependsOn=i.dependsOn),t.push(s),o=n.next(),[3,1];case 3:return r.requests=t,[2,r]}})})},e.prototype.addDependency=function(t,r){if(!this.requests.has(t)){var n=new Error("Dependent ".concat(t," does not exists, Please check the id"));throw n.name="Invalid Dependent",n}if(typeof r<"u"&&!this.requests.has(r)){var n=new Error("Dependency ".concat(r," does not exists, Please check the id"));throw n.name="Invalid Dependency",n}if(typeof r<"u"){var o=this.requests.get(t);if(o.dependsOn===void 0&&(o.dependsOn=[]),o.dependsOn.indexOf(r)!==-1){var n=new Error("Dependency ".concat(r," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}o.dependsOn.push(r)}else{for(var i=this.requests.entries(),s=void 0,u=i.next();!u.done&&u.value[1].id!==t;)s=u,u=i.next();if(typeof s<"u"){var p=s.value[0];if(u.value[1].dependsOn===void 0&&(u.value[1].dependsOn=[]),u.value[1].dependsOn.indexOf(p)!==-1){var n=new Error("Dependency ".concat(p," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}u.value[1].dependsOn.push(p)}else{var n=new Error("Can't add dependency ".concat(r,", There is only a dependent request in the batch"));throw n.name="Invalid Dependency Addition",n}}},e.prototype.removeDependency=function(t,r){var n=this.requests.get(t);if(typeof n>"u"||n.dependsOn===void 0||n.dependsOn.length===0)return!1;if(typeof r<"u"){var o=n.dependsOn.indexOf(r);return o===-1?!1:(n.dependsOn.splice(o,1),!0)}else return delete n.dependsOn,!0},e.requestLimit=20,e}();un.BatchRequestContent=Ah});var Vl=b(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.BatchResponseContent=void 0;var Sh=(se(),oe(ae)),$h=function(){function e(t){this.responses=new Map,this.update(t)}return a(e,"BatchResponseContent"),e.prototype.createResponseObject=function(t){var r=t.body,n={};if(n.status=t.status,t.statusText!==void 0&&(n.statusText=t.statusText),n.headers=t.headers,n.headers!==void 0&&n.headers["Content-Type"]!==void 0&&n.headers["Content-Type"].split(";")[0]==="application/json"){var o=JSON.stringify(r);return new Response(o,n)}return new Response(r,n)},e.prototype.update=function(t){this.nextLink=t["@odata.nextLink"];for(var r=t.responses,n=0,o=r.length;n<o;n++)this.responses.set(r[n].id,this.createResponseObject(r[n]))},e.prototype.getResponseById=function(t){return this.responses.get(t)},e.prototype.getResponses=function(){return this.responses},e.prototype.getResponsesIterator=function(){var t,r;return Sh.__generator(this,function(n){switch(n.label){case 0:t=this.responses.entries(),r=t.next(),n.label=1;case 1:return r.done?[3,3]:[4,r.value];case 2:return n.sent(),r=t.next(),[3,1];case 3:return[2]}})},e}();cn.BatchResponseContent=$h});var vi=b(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.GRAPH_URLS=rt.GRAPH_BASE_URL=rt.GRAPH_API_VERSION=void 0;rt.GRAPH_API_VERSION="v1.0";rt.GRAPH_BASE_URL="https://graph.microsoft.com/";rt.GRAPH_URLS=new Set(["graph.microsoft.com","graph.microsoft.us","dod-graph.microsoft.us","graph.microsoft.de","microsoftgraph.chinacloudapi.cn","canary.graph.microsoft.com"])});var qe=b(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.GraphClientError=void 0;var wh=(se(),oe(ae)),Oh=function(e){wh.__extends(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return a(t,"GraphClientError"),t.setGraphClientError=function(r){var n;return r instanceof Error?n=r:(n=new t,n.customError=r),n},t}(Error);ln.GraphClientError=Oh});var pn=b(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.isCustomHost=we.isGraphURL=we.serializeContent=we.urlJoin=we.oDataQueryNames=void 0;var zh=vi(),Rh=qe();we.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var kh=a(function(e){var t=a(function(i){return i.replace(/\/+$/,"")},"removePostSlash"),r=a(function(i){return i.replace(/^\/+/,"")},"removePreSlash"),n=a(function(i,s){return[t(i),r(s)].join("/")},"joiner"),o=Array.prototype.slice.call(e);return o.reduce(n)},"urlJoin");we.urlJoin=kh;var Dh=a(function(e){var t=e&&e.constructor&&e.constructor.name;if(t==="Buffer"||t==="Blob"||t==="File"||t==="FormData"||typeof e=="string")return e;if(t==="ArrayBuffer")e=Buffer.from(e);else if(t==="Int8Array"||t==="Int16Array"||t==="Int32Array"||t==="Uint8Array"||t==="Uint16Array"||t==="Uint32Array"||t==="Uint8ClampedArray"||t==="Float32Array"||t==="Float64Array"||t==="DataView")e=Buffer.from(e.buffer);else try{e=JSON.stringify(e)}catch{throw new Error("Unable to stringify the content")}return e},"serializeContent");we.serializeContent=Dh;var Ch=a(function(e){return Hl(e)},"isGraphURL");we.isGraphURL=Ch;var Nh=a(function(e,t){return t.forEach(function(r){return Mh(r)}),Hl(e,t)},"isCustomHost");we.isCustomHost=Nh;var Hl=a(function(e,t){if(t===void 0&&(t=zh.GRAPH_URLS),e=e.toLowerCase(),e.indexOf("https://")!==-1){e=e.replace("https://","");var r=e.indexOf(":"),n=e.indexOf("/"),o="";if(n!==-1)return r!==-1&&r<n?(o=e.substring(0,r),t.has(o)):(o=e.substring(0,n),t.has(o))}return!1},"isValidEndpoint"),Mh=a(function(e){if(e.indexOf("/")!==-1)throw new Rh.GraphClientError("Please add only hosts or hostnames to the CustomHosts config. If the url is `http://example.com:3000/`, host is `example:3000`")},"isCustomHostValid")});var nt=b(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.MiddlewareControl=void 0;var Uh=function(){function e(t){t===void 0&&(t=[]),this.middlewareOptions=new Map;for(var r=0,n=t;r<n.length;r++){var o=n[r],i=o.constructor;this.middlewareOptions.set(i,o)}}return a(e,"MiddlewareControl"),e.prototype.getMiddlewareOptions=function(t){return this.middlewareOptions.get(t)},e.prototype.setMiddlewareOptions=function(t,r){this.middlewareOptions.set(t,r)},e}();dn.MiddlewareControl=Uh});var Ct=b(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.cloneRequestWithNewUrl=Oe.appendRequestHeader=Oe.setRequestHeader=Oe.getRequestHeader=Oe.generateUUID=void 0;var Zl=(se(),oe(ae)),Lh=a(function(){for(var e="",t=0;t<32;t++)(t===8||t===12||t===16||t===20)&&(e+="-"),e+=Math.floor(Math.random()*16).toString(16);return e},"generateUUID");Oe.generateUUID=Lh;var jh=a(function(e,t,r){var n=null;if(typeof Request<"u"&&e instanceof Request)n=e.headers.get(r);else if(typeof t<"u"&&t.headers!==void 0)if(typeof Headers<"u"&&t.headers instanceof Headers)n=t.headers.get(r);else if(t.headers instanceof Array){for(var o=t.headers,i=0,s=o.length;i<s;i++)if(o[i][0]===r){n=o[i][1];break}}else t.headers[r]!==void 0&&(n=t.headers[r]);return n},"getRequestHeader");Oe.getRequestHeader=jh;var Fh=a(function(e,t,r,n){var o,i;if(typeof Request<"u"&&e instanceof Request)e.headers.set(r,n);else if(typeof t<"u")if(t.headers===void 0)t.headers=new Headers((o={},o[r]=n,o));else if(typeof Headers<"u"&&t.headers instanceof Headers)t.headers.set(r,n);else if(t.headers instanceof Array){for(var s=0,u=t.headers.length;s<u;s++){var p=t.headers[s];if(p[0]===r){p[1]=n;break}}s===u&&t.headers.push([r,n])}else Object.assign(t.headers,(i={},i[r]=n,i))},"setRequestHeader");Oe.setRequestHeader=Fh;var Bh=a(function(e,t,r,n){var o,i;typeof Request<"u"&&e instanceof Request?e.headers.append(r,n):typeof t<"u"&&(t.headers===void 0?t.headers=new Headers((o={},o[r]=n,o)):typeof Headers<"u"&&t.headers instanceof Headers?t.headers.append(r,n):t.headers instanceof Array?t.headers.push([r,n]):t.headers===void 0?t.headers=(i={},i[r]=n,i):t.headers[r]===void 0?t.headers[r]=n:t.headers[r]+=", ".concat(n))},"appendRequestHeader");Oe.appendRequestHeader=Bh;var Vh=a(function(e,t){return Zl.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,p,d,f,v,y,l,m;return Zl.__generator(this,function(_){switch(_.label){case 0:return t.headers.get("Content-Type")?[4,t.blob()]:[3,2];case 1:return n=_.sent(),[3,4];case 2:return[4,Promise.resolve(void 0)];case 3:n=_.sent(),_.label=4;case 4:return r=n,o=t.method,i=t.headers,s=t.referrer,u=t.referrerPolicy,p=t.mode,d=t.credentials,f=t.cache,v=t.redirect,y=t.integrity,l=t.keepalive,m=t.signal,[2,new Request(e,{method:o,headers:i,body:r,referrer:s,referrerPolicy:u,mode:p,credentials:d,cache:f,redirect:v,integrity:y,keepalive:l,signal:m})]}})})},"cloneRequestWithNewUrl");Oe.cloneRequestWithNewUrl=Vh});var _i=b(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.AuthenticationHandlerOptions=void 0;var Hh=function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e}();fn.AuthenticationHandlerOptions=Hh});var Mt=b(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.TelemetryHandlerOptions=Nt.FeatureUsageFlag=void 0;var ql=nt(),xi;(function(e){e[e.NONE=0]="NONE",e[e.REDIRECT_HANDLER_ENABLED=1]="REDIRECT_HANDLER_ENABLED",e[e.RETRY_HANDLER_ENABLED=2]="RETRY_HANDLER_ENABLED",e[e.AUTHENTICATION_HANDLER_ENABLED=4]="AUTHENTICATION_HANDLER_ENABLED"})(xi||(Nt.FeatureUsageFlag=xi={}));var Zh=function(){function e(){this.featureUsage=xi.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof ql.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new ql.MiddlewareControl,typeof n>"u"&&(n=new e,t.middlewareControl.setMiddlewareOptions(e,n)),n.setFeatureUsage(r)},e.prototype.setFeatureUsage=function(t){this.featureUsage=this.featureUsage|t},e.prototype.getFeatureUsage=function(){return this.featureUsage.toString(16)},e}();Nt.TelemetryHandlerOptions=Zh});var gn=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.AuthenticationHandler=void 0;var Gl=(se(),oe(ae)),Wl=pn(),qh=nt(),Gh=Ct(),Wh=_i(),Kl=Mt(),Kh=function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return Gl.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return Gl.__generator(this,function(p){switch(p.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Wl.isGraphURL)(r)||t.customHosts&&(0,Wl.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof qh.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(Wh.AuthenticationHandlerOptions)),o=void 0,i=void 0,n&&(o=n.authenticationProvider,i=n.authenticationProviderOptions),o||(o=this.authenticationProvider),[4,o.getAccessToken(i)]):[3,2];case 1:return s=p.sent(),u="Bearer ".concat(s),(0,Gh.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),Kl.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Kl.FeatureUsageFlag.AUTHENTICATION_HANDLER_ENABLED),[3,3];case 2:t.options.headers&&delete t.options.headers[e.AUTHORIZATION_HEADER],p.label=3;case 3:return[4,this.nextMiddleware.execute(t)];case 4:return[2,p.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.AUTHORIZATION_HEADER="Authorization",e}();mn.AuthenticationHandler=Kh});var yn=b(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.HTTPMessageHandler=void 0;var Jl=(se(),oe(ae)),Jh=function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return Jl.__awaiter(this,void 0,void 0,function(){var r;return Jl.__generator(this,function(n){switch(n.label){case 0:return r=t,[4,fetch(t.request,t.options)];case 1:return r.response=n.sent(),[2]}})})},e}();hn.HTTPMessageHandler=Jh});var yr=b(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.RetryHandlerOptions=void 0;var Xh=function(){function e(t,r,n){if(t===void 0&&(t=e.DEFAULT_DELAY),r===void 0&&(r=e.DEFAULT_MAX_RETRIES),n===void 0&&(n=e.defaultShouldRetry),t>e.MAX_DELAY&&r>e.MAX_MAX_RETRIES){var o=new Error("Delay and MaxRetries should not be more than ".concat(e.MAX_DELAY," and ").concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t>e.MAX_DELAY){var o=new Error("Delay should not be more than ".concat(e.MAX_DELAY));throw o.name="MaxLimitExceeded",o}else if(r>e.MAX_MAX_RETRIES){var o=new Error("MaxRetries should not be more than ".concat(e.MAX_MAX_RETRIES));throw o.name="MaxLimitExceeded",o}else if(t<0&&r<0){var o=new Error("Delay and MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}else if(t<0){var o=new Error("Delay should not be negative");throw o.name="MinExpectationNotMet",o}else if(r<0){var o=new Error("MaxRetries should not be negative");throw o.name="MinExpectationNotMet",o}this.delay=Math.min(t,e.MAX_DELAY),this.maxRetries=Math.min(r,e.MAX_MAX_RETRIES),this.shouldRetry=n}return a(e,"RetryHandlerOptions"),e.prototype.getMaxDelay=function(){return e.MAX_DELAY},e.DEFAULT_DELAY=3,e.DEFAULT_MAX_RETRIES=3,e.MAX_DELAY=180,e.MAX_MAX_RETRIES=10,e.defaultShouldRetry=function(){return!0},e}();vn.RetryHandlerOptions=Xh});var xn=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.RetryHandler=void 0;var Ut=(se(),oe(ae)),Pi=hr(),Yh=nt(),Xl=Ct(),Yl=yr(),Ql=Mt(),Qh=function(){function e(t){t===void 0&&(t=new Yl.RetryHandlerOptions),this.options=t}return a(e,"RetryHandler"),e.prototype.isRetry=function(t){return e.RETRY_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.isBuffered=function(t,r){var n=typeof t=="string"?r.method:t.method,o=n===Pi.RequestMethod.PUT||n===Pi.RequestMethod.PATCH||n===Pi.RequestMethod.POST;if(o){var i=(0,Xl.getRequestHeader)(t,r,"Content-Type")==="application/octet-stream";if(i)return!1}return!0},e.prototype.getDelay=function(t,r,n){var o=a(function(){return Number(Math.random().toFixed(3))},"getRandomness"),i=t.headers!==void 0?t.headers.get(e.RETRY_AFTER_HEADER):null,s;return i!==null?Number.isNaN(Number(i))?s=Math.round((new Date(i).getTime()-Date.now())/1e3):s=Number(i):s=r>=2?this.getExponentialBackOffTime(r)+n+o():n+o(),Math.min(s,this.options.getMaxDelay()+o())},e.prototype.getExponentialBackOffTime=function(t){return Math.round(1/2*(Math.pow(2,t)-1))},e.prototype.sleep=function(t){return Ut.__awaiter(this,void 0,void 0,function(){var r;return Ut.__generator(this,function(n){return r=t*1e3,[2,new Promise(function(o){return setTimeout(o,r)})]})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof Yh.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new Yl.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return Ut.__awaiter(this,void 0,void 0,function(){var o;return Ut.__generator(this,function(i){switch(i.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return i.sent(),r<n.maxRetries&&this.isRetry(t.response)&&this.isBuffered(t.request,t.options)&&n.shouldRetry(n.delay,r,t.request,t.options,t.response)?(++r,(0,Xl.setRequestHeader)(t.request,t.options,e.RETRY_ATTEMPT_HEADER,r.toString()),o=this.getDelay(t.response,r,n.delay),[4,this.sleep(o)]):[3,4];case 2:return i.sent(),[4,this.executeWithRetry(t,r,n)];case 3:return[2,i.sent()];case 4:return[2]}})})},e.prototype.execute=function(t){return Ut.__awaiter(this,void 0,void 0,function(){var r,n;return Ut.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),Ql.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Ql.FeatureUsageFlag.RETRY_HANDLER_ENABLED),[4,this.executeWithRetry(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.RETRY_STATUS_CODES=[429,503,504],e.RETRY_ATTEMPT_HEADER="Retry-Attempt",e.RETRY_AFTER_HEADER="Retry-After",e}();_n.RetryHandler=Qh});var vr=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.RedirectHandlerOptions=void 0;var ey=function(){function e(t,r){if(t===void 0&&(t=e.DEFAULT_MAX_REDIRECTS),r===void 0&&(r=e.defaultShouldRedirect),t>e.MAX_MAX_REDIRECTS){var n=new Error("MaxRedirects should not be more than ".concat(e.MAX_MAX_REDIRECTS));throw n.name="MaxLimitExceeded",n}if(t<0){var n=new Error("MaxRedirects should not be negative");throw n.name="MinExpectationNotMet",n}this.maxRedirects=t,this.shouldRedirect=r}return a(e,"RedirectHandlerOptions"),e.DEFAULT_MAX_REDIRECTS=5,e.MAX_MAX_REDIRECTS=20,e.defaultShouldRedirect=function(){return!0},e}();Pn.RedirectHandlerOptions=ey});var Tn=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RedirectHandler=void 0;var Lt=(se(),oe(ae)),ty=hr(),ry=nt(),ny=Ct(),bi=vr(),ep=Mt(),oy=function(){function e(t){t===void 0&&(t=new bi.RedirectHandlerOptions),this.options=t}return a(e,"RedirectHandler"),e.prototype.isRedirect=function(t){return e.REDIRECT_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.hasLocationHeader=function(t){return t.headers.has(e.LOCATION_HEADER)},e.prototype.getLocationHeader=function(t){return t.headers.get(e.LOCATION_HEADER)},e.prototype.isRelativeURL=function(t){return t.indexOf("://")===-1},e.prototype.shouldDropAuthorizationHeader=function(t,r){var n=/^[A-Za-z].+?:\/\/.+?(?=\/|$)/,o=n.exec(t),i,s;o!==null&&(i=o[0]);var u=n.exec(r);return u!==null&&(s=u[0]),typeof i<"u"&&typeof s<"u"&&i!==s},e.prototype.updateRequestUrl=function(t,r){return Lt.__awaiter(this,void 0,void 0,function(){var n,o;return Lt.__generator(this,function(i){switch(i.label){case 0:return n=r,typeof r.request!="string"?[3,1]:(o=t,[3,3]);case 1:return[4,(0,ny.cloneRequestWithNewUrl)(t,r.request)];case 2:o=i.sent(),i.label=3;case 3:return n.request=o,[2]}})})},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof ry.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(bi.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new bi.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return Lt.__awaiter(this,void 0,void 0,function(){var o,i;return Lt.__generator(this,function(s){switch(s.label){case 0:return[4,this.nextMiddleware.execute(t)];case 1:return s.sent(),o=t.response,r<n.maxRedirects&&this.isRedirect(o)&&this.hasLocationHeader(o)&&n.shouldRedirect(o)?(++r,o.status!==e.STATUS_CODE_SEE_OTHER?[3,2]:(t.options.method=ty.RequestMethod.GET,delete t.options.body,[3,4])):[3,6];case 2:return i=this.getLocationHeader(o),!this.isRelativeURL(i)&&this.shouldDropAuthorizationHeader(o.url,i)&&delete t.options.headers[e.AUTHORIZATION_HEADER],[4,this.updateRequestUrl(i,t)];case 3:s.sent(),s.label=4;case 4:return[4,this.executeWithRedirect(t,r,n)];case 5:return s.sent(),[3,7];case 6:return[2];case 7:return[2]}})})},e.prototype.execute=function(t){return Lt.__awaiter(this,void 0,void 0,function(){var r,n;return Lt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,ep.TelemetryHandlerOptions.updateFeatureUsageFlag(t,ep.FeatureUsageFlag.REDIRECT_HANDLER_ENABLED),[4,this.executeWithRedirect(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.REDIRECT_STATUS_CODES=[301,302,303,307,308],e.STATUS_CODE_SEE_OTHER=303,e.LOCATION_HEADER="Location",e.AUTHORIZATION_HEADER="Authorization",e.MANUAL_REDIRECT="manual",e}();bn.RedirectHandler=oy});var tp=b(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.PACKAGE_VERSION=void 0;En.PACKAGE_VERSION="3.0.7"});var Sn=b(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.TelemetryHandler=void 0;var rp=(se(),oe(ae)),np=pn(),iy=tp(),ay=nt(),In=Ct(),sy=Mt(),uy=function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return rp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return rp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,np.isGraphURL)(r)||t.customHosts&&(0,np.isCustomHost)(r,t.customHosts)?(n=(0,In.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,In.generateUUID)(),(0,In.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(iy.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof ay.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(sy.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,In.appendRequestHeader)(t.request,t.options,e.SDK_VERSION_HEADER,o)):(delete t.options.headers[e.CLIENT_REQUEST_ID_HEADER],delete t.options.headers[e.SDK_VERSION_HEADER]),[4,this.nextMiddleware.execute(t)];case 1:return[2,u.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.CLIENT_REQUEST_ID_HEADER="client-request-id",e.SDK_VERSION_HEADER="SdkVersion",e.PRODUCT_NAME="graph-js",e.FEATURE_USAGE_STRING="featureUsage",e}();An.TelemetryHandler=uy});var op=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.MiddlewareFactory=void 0;var cy=gn(),ly=yn(),py=vr(),dy=yr(),fy=Tn(),my=xn(),gy=Sn(),hy=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),yy=function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new cy.AuthenticationHandler(t),o=new my.RetryHandler(new dy.RetryHandlerOptions),i=new gy.TelemetryHandler,s=new ly.HTTPMessageHandler;if(r.push(n),r.push(o),hy()){var u=new fy.RedirectHandler(new py.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e}();$n.MiddlewareFactory=yy});var On=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ChaosStrategy=void 0;var ip;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(ip||(wn.ChaosStrategy=ip={}))});var Ti=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.ChaosHandlerOptions=void 0;var vy=On(),_y=function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=vy.ChaosStrategy.RANDOM),r===void 0&&(r="Some error Happened"),this.chaosStrategy=t,this.statusCode=n,this.statusMessage=r,this.chaosPercentage=o!==void 0?o:10,this.responseBody=i,this.headers=s,this.chaosPercentage>100)throw new Error("Error Pecentage can not be more than 100")}return a(e,"ChaosHandlerOptions"),e}();zn.ChaosHandlerOptions=_y});var ap=b(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.httpStatusCode=jt.methodStatusCode=void 0;jt.methodStatusCode={GET:[429,500,502,503,504],POST:[429,500,502,503,504,507],PUT:[429,500,502,503,504,507],PATCH:[429,500,502,503,504],DELETE:[429,500,502,503,504,507]};jt.httpStatusCode={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}});var cp=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.ChaosHandler=void 0;var Rn=(se(),oe(ae)),xy=nt(),Py=Ct(),sp=ap(),Ei=Ti(),up=On(),by=function(){function e(t,r){t===void 0&&(t=new Ei.ChaosHandlerOptions),this.options=t,this.manualMap=r}return a(e,"ChaosHandler"),e.prototype.createResponseHeaders=function(t,r,n){var o=t.headers?new Headers(t.headers):new Headers;return o.append("Cache-Control","no-store"),o.append("request-id",r),o.append("client-request-id",r),o.append("x-ms-ags-diagnostic",""),o.append("Date",n),o.append("Strict-Transport-Security",""),t.statusCode===429&&o.append("retry-after","3"),o},e.prototype.createResponseBody=function(t,r,n){if(t.responseBody)return t.responseBody;var o;if(t.statusCode>=400){var i=sp.httpStatusCode[t.statusCode],s=t.statusMessage;o={error:{code:i,message:s,innerError:{"request-id":r,date:n}}}}else o={};return o},e.prototype.createResponse=function(t,r){var n=r.request,o=(0,Py.generateUUID)(),i=new Date,s=this.createResponseHeaders(t,o,i.toString()),u=this.createResponseBody(t,o,i.toString()),p={url:n,status:t.statusCode,statusText:t.statusMessage,headers:s};r.response=new Response(typeof u=="string"?u:JSON.stringify(u),p)},e.prototype.sendRequest=function(t,r){return Rn.__awaiter(this,void 0,void 0,function(){return Rn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===up.ChaosStrategy.MANUAL&&!this.nextMiddleware||Math.floor(Math.random()*100)<t.chaosPercentage?(this.createResponse(t,r),[3,3]):[3,1];case 1:return this.nextMiddleware?[4,this.nextMiddleware.execute(r)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.getRandomStatusCode=function(t){var r=sp.methodStatusCode[t];return r[Math.floor(Math.random()*r.length)]},e.prototype.getRelativeURL=function(t){var r=/https?:\/\/graph\.microsoft\.com\/[^/]+(.+?)(\?|$)/,n;return r.exec(t)!==null&&(n=r.exec(t)[1]),n},e.prototype.setStatusCode=function(t,r,n){var o=this;if(t.chaosStrategy===up.ChaosStrategy.MANUAL){if(t.statusCode===void 0){var i=this.getRelativeURL(r);this.manualMap.get(i)!==void 0?this.manualMap.get(i).get(n)!==void 0&&(t.statusCode=this.manualMap.get(i).get(n)):this.manualMap.forEach(function(s,u){var p=new RegExp(u+"$");p.test(i)&&o.manualMap.get(u).get(n)!==void 0&&(t.statusCode=o.manualMap.get(u).get(n))})}}else t.statusCode=this.getRandomStatusCode(n)},e.prototype.getOptions=function(t){var r;return t.middlewareControl instanceof xy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Ei.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Ei.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Rn.__awaiter(this,void 0,void 0,function(){var r;return Rn.__generator(this,function(n){switch(n.label){case 0:return r=this.getOptions(t),[4,this.sendRequest(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e}();kn.ChaosHandler=by});var _r=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ResponseType=void 0;var lp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(lp||(Dn.ResponseType=lp={}))});var Ai=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.GraphResponseHandler=Ft.DocumentType=void 0;var Cn=(se(),oe(ae)),ft=_r(),Ii;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Ii||(Ft.DocumentType=Ii={}));var Nn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Nn||(Nn={}));var Mn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Mn||(Mn={}));var Ty=function(){function e(){}return a(e,"GraphResponseHandler"),e.parseDocumentResponse=function(t,r){return typeof DOMParser<"u"?new Promise(function(n,o){t.text().then(function(i){try{var s=new DOMParser,u=s.parseFromString(i,r);n(u)}catch(p){o(p)}})}):Promise.resolve(t.body)},e.convertResponse=function(t,r){return Cn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Cn.__generator(this,function(u){switch(u.label){case 0:if(t.status===204)return[2,Promise.resolve()];switch(o=t.headers.get("Content-type"),i=r,i){case ft.ResponseType.ARRAYBUFFER:return[3,1];case ft.ResponseType.BLOB:return[3,3];case ft.ResponseType.DOCUMENT:return[3,5];case ft.ResponseType.JSON:return[3,7];case ft.ResponseType.STREAM:return[3,9];case ft.ResponseType.TEXT:return[3,11]}return[3,13];case 1:return[4,t.arrayBuffer()];case 2:return n=u.sent(),[3,24];case 3:return[4,t.blob()];case 4:return n=u.sent(),[3,24];case 5:return[4,e.parseDocumentResponse(t,Ii.TEXT_XML)];case 6:return n=u.sent(),[3,24];case 7:return[4,t.json()];case 8:return n=u.sent(),[3,24];case 9:return[4,Promise.resolve(t.body)];case 10:return n=u.sent(),[3,24];case 11:return[4,t.text()];case 12:return n=u.sent(),[3,24];case 13:return o===null?[3,22]:(s=o.split(";")[0],new RegExp(Mn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Mn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Nn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Nn.APPLICATION_JSON?[3,20]:[4,t.json()];case 19:return n=u.sent(),[3,21];case 20:n=Promise.resolve(t.body),u.label=21;case 21:return[3,23];case 22:n=Promise.resolve(t.body),u.label=23;case 23:return[3,24];case 24:return[2,n]}})})},e.getResponse=function(t,r,n){return Cn.__awaiter(this,void 0,void 0,function(){var o;return Cn.__generator(this,function(i){switch(i.label){case 0:return r!==ft.ResponseType.RAW?[3,1]:[2,Promise.resolve(t)];case 1:return[4,e.convertResponse(t,r)];case 2:if(o=i.sent(),t.ok)if(typeof n=="function")n(null,o);else return[2,o];else throw o;i.label=3;case 3:return[2]}})})},e}();Ft.GraphResponseHandler=Ty});var Si=b(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.Range=void 0;var Ey=function(){function e(t,r){t===void 0&&(t=-1),r===void 0&&(r=-1),this.minValue=t,this.maxValue=r}return a(e,"Range"),e}();Un.Range=Ey});var $i=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.UploadResult=void 0;var Iy=function(){function e(t,r){this._location=r,this._responseBody=t}return a(e,"UploadResult"),Object.defineProperty(e.prototype,"location",{get:a(function(){return this._location},"get"),set:a(function(t){this._location=t},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseBody",{get:a(function(){return this._responseBody},"get"),set:a(function(t){this._responseBody=t},"set"),enumerable:!1,configurable:!0}),e.CreateUploadResult=function(t,r){return new e(t,r.get("location"))},e}();Ln.UploadResult=Iy});var Oi=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.LargeFileUploadTask=void 0;var Ee=(se(),oe(ae)),wi=qe(),Ay=Ai(),pp=_r(),jn=Si(),Sy=$i(),$y=function(){function e(t,r,n,o){if(o===void 0&&(o={}),this.DEFAULT_FILE_SIZE=5*1024*1024,this.client=t,r.sliceFile)this.file=r;else throw new wi.GraphClientError("Please pass the FileUpload object, StreamUpload object or any custom implementation of the FileObject interface");this.file=r,o.rangeSize||(o.rangeSize=this.DEFAULT_FILE_SIZE),this.options=o,this.uploadSession=n,this.nextRange=new jn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),Ee.__awaiter(this,void 0,void 0,function(){var i,s;return Ee.__generator(this,function(u){switch(u.label){case 0:return[4,t.api(r).headers(o).post(n)];case 1:return i=u.sent(),s={url:i.uploadUrl,expiry:new Date(i.expirationDateTime),isCancelled:!1},[2,s]}})})},e.prototype.parseRange=function(t){var r=t[0];if(typeof r>"u"||r==="")return new jn.Range;var n=r.split("-"),o=parseInt(n[0],10),i=parseInt(n[1],10);return Number.isNaN(i)&&(i=this.file.size-1),new jn.Range(o,i)},e.prototype.updateTaskStatus=function(t){this.uploadSession.expiry=new Date(t.expirationDateTime),this.nextRange=this.parseRange(t.nextExpectedRanges)},e.prototype.getNextRange=function(){if(this.nextRange.minValue===-1)return this.nextRange;var t=this.nextRange.minValue,r=t+this.options.rangeSize-1;return r>=this.file.size&&(r=this.file.size-1),new jn.Range(t,r)},e.prototype.sliceFile=function(t){if(console.warn("The LargeFileUploadTask.sliceFile() function has been deprecated and moved into the FileObject interface."),this.file.content instanceof ArrayBuffer||this.file.content instanceof Blob||this.file.content instanceof Uint8Array)return this.file.content.slice(t.minValue,t.maxValue+1);throw new wi.GraphClientError("The LargeFileUploadTask.sliceFile() function expects only Blob, ArrayBuffer or Uint8Array file content. Please note that the sliceFile() function is deprecated.")},e.prototype.upload=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,s,u;return Ee.__generator(this,function(p){switch(p.label){case 0:t=this.options&&this.options.uploadEventHandlers,p.label=1;case 1:if(this.uploadSession.isCancelled)return[3,5];if(r=this.getNextRange(),r.maxValue===-1)throw n=new Error("Task with which you are trying to upload is already completed, Please check for your uploaded file"),n.name="Invalid Session",n;return[4,this.file.sliceFile(r)];case 2:return o=p.sent(),[4,this.uploadSliceGetRawResponse(o,r,this.file.size)];case 3:if(i=p.sent(),!i)throw new wi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,Ay.GraphResponseHandler.getResponse(i)];case 4:return s=p.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,Sy.UploadResult.CreateUploadResult(s,i.headers)]):(u={expirationDateTime:s.expirationDateTime||s.ExpirationDateTime,nextExpectedRanges:s.NextExpectedRanges||s.nextExpectedRanges},this.updateTaskStatus(u),this.reportProgress(t,r),[3,1]);case 5:return[2]}})})},e.prototype.reportProgress=function(t,r){t&&t.progress&&t.progress(r,t.extraCallbackParam)},e.prototype.uploadSlice=function(t,r,n){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.uploadSliceGetRawResponse=function(t,r,n){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(o){switch(o.label){case 0:return[4,this.client.api(this.uploadSession.url).headers({"Content-Length":"".concat(r.maxValue-r.minValue+1),"Content-Range":"bytes ".concat(r.minValue,"-").concat(r.maxValue,"/").concat(n),"Content-Type":"application/octet-stream"}).responseType(pp.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t;return Ee.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(pp.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return Ee.__awaiter(this,void 0,void 0,function(){var t;return Ee.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).get()];case 1:return t=r.sent(),this.updateTaskStatus(t),[2,t]}})})},e.prototype.resume=function(){return Ee.__awaiter(this,void 0,void 0,function(){return Ee.__generator(this,function(t){switch(t.label){case 0:return[4,this.getStatus()];case 1:return t.sent(),[4,this.upload()];case 2:return[2,t.sent()]}})})},e.prototype.getUploadSession=function(){return this.uploadSession},e}();Fn.LargeFileUploadTask=$y});var zi=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.FileUpload=void 0;var wy=qe(),Oy=function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new wy.GraphClientError("Please provide the upload content, name of the file and size of the file")}return a(e,"FileUpload"),e.prototype.sliceFile=function(t){return this.content.slice(t.minValue,t.maxValue+1)},e}();Bn.FileUpload=Oy});var Ri=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.getValidRangeSize=void 0;var zy=5*1024*1024,Ry=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),ky=a(function(e){e===void 0&&(e=zy);var t=60*1024*1024;return e>t&&(e=t),Ry(e)},"getValidRangeSize");Vn.getValidRangeSize=ky});var fp=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.OneDriveLargeFileUploadTask=void 0;var Ge=(se(),oe(ae)),dp=qe(),Dy=zi(),Cy=Oi(),Ny=Ri(),My=function(e){Ge.__extends(t,e);function t(r,n,o,i){return e.call(this,r,n,o,i)||this}return a(t,"OneDriveLargeFileUploadTask"),t.constructCreateSessionUrl=function(r,n){return n===void 0&&(n=t.DEFAULT_UPLOAD_PATH),r=r.trim(),n=n.trim(),n===""&&(n="/"),n[0]!=="/"&&(n="/".concat(n)),n[n.length-1]!=="/"&&(n="".concat(n,"/")),"/me/drive/root:".concat(n.split("/").map(function(o){return encodeURIComponent(o)}).join("/")).concat(encodeURIComponent(r),":/createUploadSession")},t.getFileInfo=function(r,n){var o,i;if(typeof Blob<"u"&&r instanceof Blob)o=new File([r],n),i=o.size;else if(typeof File<"u"&&r instanceof File)o=r,i=o.size;else if(typeof Uint8Array<"u"&&r instanceof Uint8Array){var s=r;i=s.byteLength,o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}return{content:o,size:i}},t.create=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i,s,u;return Ge.__generator(this,function(p){if(!r||!n||!o)throw new dp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new Dy.FileUpload(s.content,i,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i,s,u,p;return Ge.__generator(this,function(d){switch(d.label){case 0:if(!r||!n||!o)throw new dp.GraphClientError("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");return i=o.uploadSessionURL?o.uploadSessionURL:t.constructCreateSessionUrl(o.fileName,o.path),s={fileName:o.fileName,fileDescription:o.fileDescription,conflictBehavior:o.conflictBehavior},[4,t.createUploadSession(r,i,s)];case 1:return u=d.sent(),p=(0,Ny.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:p,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return Ge.__awaiter(this,void 0,void 0,function(){var i;return Ge.__generator(this,function(s){return i={item:{"@microsoft.graph.conflictBehavior":o?.conflictBehavior||"rename",name:o?.fileName,description:o?.fileDescription}},[2,e.createUploadSession.call(this,r,n,i)]})})},t.prototype.commit=function(r,n){return n===void 0&&(n="rename"),Ge.__awaiter(this,void 0,void 0,function(){var o;return Ge.__generator(this,function(i){switch(i.label){case 0:return o={name:this.file.name,"@microsoft.graph.conflictBehavior":n,"@microsoft.graph.sourceUrl":this.uploadSession.url},[4,this.client.api(r).put(o)];case 1:return[2,i.sent()]}})})},t.DEFAULT_UPLOAD_PATH="/",t}(Cy.LargeFileUploadTask);Hn.OneDriveLargeFileUploadTask=My});var gp=b(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.StreamUpload=void 0;var mp=(se(),oe(ae)),xr=qe(),Uy=function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new xr.GraphClientError("Please provide the Readable Stream content, name of the file and size of the file")}return a(e,"StreamUpload"),e.prototype.sliceFile=function(t){return mp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,p;return mp.__generator(this,function(d){switch(d.label){case 0:if(r=t.maxValue-t.minValue+1,n=[],this.previousSlice){if(t.minValue<this.previousSlice.range.minValue)throw new xr.GraphClientError("An error occurred while uploading the stream. Please restart the stream upload from the first byte of the file.");if(t.minValue<this.previousSlice.range.maxValue){if(o=this.previousSlice.range.minValue,i=this.previousSlice.range.maxValue,t.minValue===o&&t.maxValue===i)return[2,this.previousSlice.fileSlice];if(t.maxValue===i)return[2,this.previousSlice.fileSlice.slice(t.minValue,t.maxValue+1)];n.push(this.previousSlice.fileSlice.slice(t.minValue,i+1)),r=t.maxValue-i}}return this.content&&this.content.readable?this.content.readableLength>=r?(n.push(this.content.read(r)),[3,3]):[3,1]:[3,4];case 1:return u=(s=n).push,[4,this.readNBytesFromStream(r)];case 2:u.apply(s,[d.sent()]),d.label=3;case 3:return[3,5];case 4:throw new xr.GraphClientError("Stream is not readable.");case 5:return p=Buffer.concat(n),this.previousSlice={fileSlice:p,range:t},[2,p]}})})},e.prototype.readNBytesFromStream=function(t){var r=this;return new Promise(function(n,o){var i=[],s=t,u=0;r.content.on("end",function(){if(s>0)return o(new xr.GraphClientError("Stream ended before reading required range size"))}),r.content.on("readable",function(){for(var p;u<t&&(p=r.content.read(s))!==null;)u+=p.length,i.push(p),s>0&&(s=t-u);if(u===t)return n(Buffer.concat(i));if(!r.content||!r.content.readable)return o(new xr.GraphClientError("Error encountered while reading the stream during the upload"))})})},e}();Zn.StreamUpload=Uy});var hp=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.PageIterator=void 0;var Bt=(se(),oe(ae)),Ly=function(){function e(t,r,n,o){this.client=t,this.collection=r.value,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],this.callback=n,this.cursor=0,this.complete=!1,this.requestOptions=o}return a(e,"PageIterator"),e.prototype.iterationHelper=function(){if(this.collection===void 0)return!1;for(var t=!0;t&&this.cursor<this.collection.length;){var r=this.collection[this.cursor];t=this.callback(r),this.cursor++}return t},e.prototype.fetchAndUpdateNextPageData=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t,r;return Bt.__generator(this,function(n){switch(n.label){case 0:return t=this.client.api(this.nextLink),this.requestOptions&&(this.requestOptions.headers&&(t=t.headers(this.requestOptions.headers)),this.requestOptions.middlewareOptions&&(t=t.middlewareOptions(this.requestOptions.middlewareOptions)),this.requestOptions.options&&(t=t.options(this.requestOptions.options))),[4,t.get()];case 1:return r=n.sent(),this.collection=r.value,this.cursor=0,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],[2]}})})},e.prototype.getDeltaLink=function(){return this.deltaLink},e.prototype.iterate=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t;return Bt.__generator(this,function(r){switch(r.label){case 0:t=this.iterationHelper(),r.label=1;case 1:return t?this.nextLink===void 0?[3,3]:[4,this.fetchAndUpdateNextPageData()]:[3,5];case 2:return r.sent(),t=this.iterationHelper(),[3,4];case 3:t=!1,r.label=4;case 4:return[3,1];case 5:return this.nextLink===void 0&&this.cursor>=this.collection.length&&(this.complete=!0),[2]}})})},e.prototype.resume=function(){return Bt.__awaiter(this,void 0,void 0,function(){return Bt.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e}();qn.PageIterator=Ly});var ki=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CustomAuthenticationProvider=void 0;var Gn=(se(),oe(ae)),yp=qe(),jy=function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return Gn.__awaiter(this,void 0,void 0,function(){var t=this;return Gn.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return Gn.__awaiter(t,void 0,void 0,function(){var u,p;return Gn.__generator(this,function(d){switch(d.label){case 0:return s?(n(s),[3,3]):[3,1];case 1:return i||(u="Access token is undefined or empty. Please provide a valid token. For more help - https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/CustomAuthenticationProvider.md",i=new yp.GraphClientError(u)),[4,yp.GraphClientError.setGraphClientError(i)];case 2:p=d.sent(),o(p),d.label=3;case 3:return[2]}})})})})]})})},e}();Wn.CustomAuthenticationProvider=jy});var Di=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.GraphError=void 0;var Fy=(se(),oe(ae)),By=function(e){Fy.__extends(t,e);function t(r,n,o){r===void 0&&(r=-1);var i=e.call(this,n||o&&o.message)||this;return Object.setPrototypeOf(i,t.prototype),i.statusCode=r,i.code=null,i.requestId=null,i.date=new Date,i.body=null,i.stack=o?o.stack:i.stack,i}return a(t,"GraphError"),t}(Error);Kn.GraphError=By});var _p=b(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.GraphErrorHandler=void 0;var vp=(se(),oe(ae)),Ci=Di(),Vy=function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Ci.GraphError(r,"",t);return t.name!==void 0&&(o.code=t.name),o.body=t.toString(),o.date=new Date,o.headers=n?.headers,o},e.constructErrorFromResponse=function(t,r,n){var o=t.error,i=new Ci.GraphError(r,o.message);return i.code=o.code,o.innerError!==void 0&&(i.requestId=o.innerError["request-id"],i.date=new Date(o.innerError.date)),i.body=JSON.stringify(o),i.headers=n?.headers,i},e.getError=function(t,r,n,o){return t===void 0&&(t=null),r===void 0&&(r=-1),vp.__awaiter(this,void 0,void 0,function(){var i;return vp.__generator(this,function(s){if(t&&t.error?i=e.constructErrorFromResponse(t,r,o):t instanceof Error?i=e.constructError(t,r,o):(i=new Ci.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e}();Jn.GraphErrorHandler=Vy});var Ni=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.GraphRequest=void 0;var re=(se(),oe(ae)),Hy=qe(),Zy=_p(),Pr=pn(),qy=Ai(),Gy=nt(),mt=hr(),Wy=_r(),Ky=function(){function e(t,r,n){var o=this;this.parsePath=function(i){if(i.indexOf("https://")!==-1){i=i.replace("https://","");var s=i.indexOf("/");s!==-1&&(o.urlComponents.host="https://"+i.substring(0,s),i=i.substring(s+1,i.length));var u=i.indexOf("/");u!==-1&&(o.urlComponents.version=i.substring(0,u),i=i.substring(u+1,i.length))}i.charAt(0)==="/"&&(i=i.substr(1));var p=i.indexOf("?");if(p===-1)o.urlComponents.path=i;else{o.urlComponents.path=i.substr(0,p);for(var d=i.substring(p+1,i.length).split("&"),f=0,v=d;f<v.length;f++){var y=v[f];o.parseQueryParameter(y)}}},this.httpClient=t,this.config=r,this.urlComponents={host:this.config.baseUrl,version:this.config.defaultVersion,oDataQueryParams:{},otherURLQueryParams:{},otherURLQueryOptions:[]},this._headers={},this._options={},this._middlewareOptions=[],this.parsePath(n)}return a(e,"GraphRequest"),e.prototype.addCsvQueryParameter=function(t,r,n){this.urlComponents.oDataQueryParams[t]=this.urlComponents.oDataQueryParams[t]?this.urlComponents.oDataQueryParams[t]+",":"";var o=[];n.length>1&&typeof r=="string"?o=Array.prototype.slice.call(n):typeof r=="string"?o.push(r):o=o.concat(r),this.urlComponents.oDataQueryParams[t]+=o.join(",")},e.prototype.buildFullUrl=function(){var t=(0,Pr.urlJoin)([this.urlComponents.host,this.urlComponents.version,this.urlComponents.path])+this.createQueryString();return this.config.debugLogging&&console.log(t),t},e.prototype.createQueryString=function(){var t=this.urlComponents,r=[];if(Object.keys(t.oDataQueryParams).length!==0)for(var n in t.oDataQueryParams)Object.prototype.hasOwnProperty.call(t.oDataQueryParams,n)&&r.push(n+"="+t.oDataQueryParams[n]);if(Object.keys(t.otherURLQueryParams).length!==0)for(var n in t.otherURLQueryParams)Object.prototype.hasOwnProperty.call(t.otherURLQueryParams,n)&&r.push(n+"="+t.otherURLQueryParams[n]);if(t.otherURLQueryOptions.length!==0)for(var o=0,i=t.otherURLQueryOptions;o<i.length;o++){var s=i[o];r.push(s)}return r.length>0?"?"+r.join("&"):""},e.prototype.parseQueryParameter=function(t){if(typeof t=="string")if(t.charAt(0)==="?"&&(t=t.substring(1)),t.indexOf("&")!==-1)for(var r=t.split("&"),n=0,o=r;n<o.length;n++){var i=o[n];this.parseQueryParamenterString(i)}else this.parseQueryParamenterString(t);else if(t.constructor===Object)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&this.setURLComponentsQueryParamater(s,t[s]);return this},e.prototype.parseQueryParamenterString=function(t){if(this.isValidQueryKeyValuePair(t)){var r=t.indexOf("="),n=t.substring(0,r),o=t.substring(r+1);this.setURLComponentsQueryParamater(n,o)}else this.urlComponents.otherURLQueryOptions.push(t)},e.prototype.setURLComponentsQueryParamater=function(t,r){if(Pr.oDataQueryNames.indexOf(t)!==-1){var n=this.urlComponents.oDataQueryParams[t],o=n&&(t==="$expand"||t==="$select"||t==="$orderby");this.urlComponents.oDataQueryParams[t]=o?n+","+r:r}else this.urlComponents.otherURLQueryParams[t]=r},e.prototype.isValidQueryKeyValuePair=function(t){var r=t.indexOf("=");if(r===-1)return!1;var n=t.indexOf("(");return!(n!==-1&&t.indexOf("(")<r)},e.prototype.updateRequestOptions=function(t){var r=re.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=re.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=re.__assign({},this.config.fetchOptions.headers))}Object.assign(t,this._options),t.headers!==void 0&&Object.assign(r,t.headers),Object.assign(r,this._headers),t.headers=r},e.prototype.send=function(t,r,n){var o;return re.__awaiter(this,void 0,void 0,function(){var i,s,u,p,d,f,v,y;return re.__generator(this,function(l){switch(l.label){case 0:s=new Gy.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,l.label=1;case 1:return l.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return p=l.sent(),i=p.response,[4,qy.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(f=l.sent(),f instanceof Hy.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,Zy.GraphErrorHandler.getError(f,v,n,i)];case 5:throw y=l.sent(),y;case 6:return[2]}})})},e.prototype.setHeaderContentType=function(){if(!this._headers){this.header("Content-Type","application/json");return}for(var t=Object.keys(this._headers),r=0,n=t;r<n.length;r++){var o=n[r];if(o.toLowerCase()==="content-type")return}this.header("Content-Type","application/json")},e.prototype.header=function(t,r){return this._headers[t]=r,this},e.prototype.headers=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._headers[r]=t[r]);return this},e.prototype.option=function(t,r){return this._options[t]=r,this},e.prototype.options=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._options[r]=t[r]);return this},e.prototype.middlewareOptions=function(t){return this._middlewareOptions=t,this},e.prototype.version=function(t){return this.urlComponents.version=t,this},e.prototype.responseType=function(t){return this._responseType=t,this},e.prototype.select=function(t){return this.addCsvQueryParameter("$select",t,arguments),this},e.prototype.expand=function(t){return this.addCsvQueryParameter("$expand",t,arguments),this},e.prototype.orderby=function(t){return this.addCsvQueryParameter("$orderby",t,arguments),this},e.prototype.filter=function(t){return this.urlComponents.oDataQueryParams.$filter=t,this},e.prototype.search=function(t){return this.urlComponents.oDataQueryParams.$search=t,this},e.prototype.top=function(t){return this.urlComponents.oDataQueryParams.$top=t,this},e.prototype.skip=function(t){return this.urlComponents.oDataQueryParams.$skip=t,this},e.prototype.skipToken=function(t){return this.urlComponents.oDataQueryParams.$skipToken=t,this},e.prototype.count=function(t){return t===void 0&&(t=!0),this.urlComponents.oDataQueryParams.$count=t.toString(),this},e.prototype.query=function(t){return this.parseQueryParameter(t)},e.prototype.get=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n,o;return re.__generator(this,function(i){switch(i.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.GET},[4,this.send(r,n,t)];case 1:return o=i.sent(),[2,o]}})})},e.prototype.post=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o,i;return re.__generator(this,function(s){switch(s.label){case 0:return n=this.buildFullUrl(),o={method:mt.RequestMethod.POST,body:(0,Pr.serializeContent)(t)},i=t&&t.constructor&&t.constructor.name,i==="FormData"?o.headers={}:(this.setHeaderContentType(),o.headers=this._headers),[4,this.send(n,o,r)];case 1:return[2,s.sent()]}})})},e.prototype.create=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.post(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.put=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:mt.RequestMethod.PUT,body:(0,Pr.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.patch=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:mt.RequestMethod.PATCH,body:(0,Pr.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.update=function(t,r){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(n){switch(n.label){case 0:return[4,this.patch(t,r)];case 1:return[2,n.sent()]}})})},e.prototype.delete=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.DELETE},[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.del=function(t){return re.__awaiter(this,void 0,void 0,function(){return re.__generator(this,function(r){switch(r.label){case 0:return[4,this.delete(t)];case 1:return[2,r.sent()]}})})},e.prototype.getStream=function(t){return re.__awaiter(this,void 0,void 0,function(){var r,n;return re.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:mt.RequestMethod.GET},this.responseType(Wy.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return re.__awaiter(this,void 0,void 0,function(){var n,o;return re.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),o={method:mt.RequestMethod.PUT,headers:{"Content-Type":"application/octet-stream"},body:t},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e}();Xn.GraphRequest=Ky});var Mi=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.HTTPClient=void 0;var xp=(se(),oe(ae)),Jy=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(!t||!t.length){var n=new Error;throw n.name="InvalidMiddlewareChain",n.message="Please provide a default middleware chain or custom middleware chain",n}this.setMiddleware.apply(this,t)}return a(e,"HTTPClient"),e.prototype.setMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];t.length>1?this.parseMiddleWareArray(t):this.middleware=t[0]},e.prototype.parseMiddleWareArray=function(t){t.forEach(function(r,n){n<t.length-1&&r.setNext(t[n+1])}),this.middleware=t[0]},e.prototype.sendRequest=function(t){return xp.__awaiter(this,void 0,void 0,function(){var r;return xp.__generator(this,function(n){switch(n.label){case 0:if(typeof t.request=="string"&&t.options===void 0)throw r=new Error,r.name="InvalidRequestOptions",r.message="Unable to execute the middleware, Please provide valid options for a request",r;return[4,this.middleware.execute(t)];case 1:return n.sent(),[2,t]}})})},e}();Yn.HTTPClient=Jy});var bp=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.HTTPClientFactory=void 0;var Xy=(se(),oe(ae)),Pp=Mi(),Yy=gn(),Qy=yn(),ev=vr(),tv=yr(),rv=Tn(),nv=xn(),ov=Sn(),iv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),av=function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new Yy.AuthenticationHandler(t),n=new nv.RetryHandler(new tv.RetryHandlerOptions),o=new ov.TelemetryHandler,i=new Qy.HTTPMessageHandler;if(r.setNext(n),iv()){var s=new rv.RedirectHandler(new ev.RedirectHandlerOptions);n.setNext(s),s.setNext(o)}else n.setNext(o);return o.setNext(i),e.createWithMiddleware(r)},e.createWithMiddleware=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new(Pp.HTTPClient.bind.apply(Pp.HTTPClient,Xy.__spreadArray([void 0],t,!1)))},e}();Qn.HTTPClientFactory=av});var Tp=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.validatePolyFilling=void 0;var sv=a(function(){if(typeof Promise>"u"&&typeof fetch>"u"){var e=new Error("Library cannot function without Promise and fetch. So, please provide polyfill for them.");throw e.name="PolyFillNotAvailable",e}else if(typeof Promise>"u"){var e=new Error("Library cannot function without Promise. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}else if(typeof fetch>"u"){var e=new Error("Library cannot function without fetch. So, please provide polyfill for it.");throw e.name="PolyFillNotAvailable",e}return!0},"validatePolyFilling");eo.validatePolyFilling=sv});var Ap=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.Client=void 0;var uv=(se(),oe(ae)),Ep=vi(),cv=ki(),lv=Ni(),Ip=Mi(),pv=bp(),dv=Tp(),fv=function(){function e(t){this.config={baseUrl:Ep.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Ep.GRAPH_API_VERSION},(0,dv.validatePolyFilling)();for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this.config[r]=t[r]);var n;if(t.authProvider!==void 0&&t.middleware!==void 0){var o=new Error;throw o.name="AmbiguityInInitialization",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain not both",o}else if(t.authProvider!==void 0)n=pv.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Ip.HTTPClient.bind.apply(Ip.HTTPClient,uv.__spreadArray([void 0],[].concat(t.middleware),!1)));else{var o=new Error;throw o.name="InvalidMiddlewareChain",o.message="Unable to Create Client, Please provide either authentication provider for default middleware chain or custom middleware chain",o}this.httpClient=n}return a(e,"Client"),e.init=function(t){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=n==="authProvider"?new cv.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new lv.GraphRequest(this.httpClient,this.config,t)},e}();to.Client=fv});var $p=b(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.ResponseType=w.GraphRequest=w.GraphClientError=w.GraphError=w.CustomAuthenticationProvider=w.Client=w.PageIterator=w.Range=w.UploadResult=w.FileUpload=w.StreamUpload=w.getValidRangeSize=w.OneDriveLargeFileUploadTask=w.LargeFileUploadTask=w.ChaosHandler=w.ChaosStrategy=w.ChaosHandlerOptions=w.TelemetryHandlerOptions=w.FeatureUsageFlag=w.RedirectHandlerOptions=w.RetryHandlerOptions=w.AuthenticationHandlerOptions=w.MiddlewareFactory=w.TelemetryHandler=w.RedirectHandler=w.RetryHandler=w.HTTPMessageHandler=w.AuthenticationHandler=w.BatchResponseContent=w.BatchRequestContent=void 0;var mv=Bl();Object.defineProperty(w,"BatchRequestContent",{enumerable:!0,get:a(function(){return mv.BatchRequestContent},"get")});var gv=Vl();Object.defineProperty(w,"BatchResponseContent",{enumerable:!0,get:a(function(){return gv.BatchResponseContent},"get")});var hv=gn();Object.defineProperty(w,"AuthenticationHandler",{enumerable:!0,get:a(function(){return hv.AuthenticationHandler},"get")});var yv=yn();Object.defineProperty(w,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return yv.HTTPMessageHandler},"get")});var vv=xn();Object.defineProperty(w,"RetryHandler",{enumerable:!0,get:a(function(){return vv.RetryHandler},"get")});var _v=Tn();Object.defineProperty(w,"RedirectHandler",{enumerable:!0,get:a(function(){return _v.RedirectHandler},"get")});var xv=Sn();Object.defineProperty(w,"TelemetryHandler",{enumerable:!0,get:a(function(){return xv.TelemetryHandler},"get")});var Pv=op();Object.defineProperty(w,"MiddlewareFactory",{enumerable:!0,get:a(function(){return Pv.MiddlewareFactory},"get")});var bv=_i();Object.defineProperty(w,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return bv.AuthenticationHandlerOptions},"get")});var Tv=yr();Object.defineProperty(w,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return Tv.RetryHandlerOptions},"get")});var Ev=vr();Object.defineProperty(w,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return Ev.RedirectHandlerOptions},"get")});var Sp=Mt();Object.defineProperty(w,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return Sp.FeatureUsageFlag},"get")});Object.defineProperty(w,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return Sp.TelemetryHandlerOptions},"get")});var Iv=Ti();Object.defineProperty(w,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return Iv.ChaosHandlerOptions},"get")});var Av=On();Object.defineProperty(w,"ChaosStrategy",{enumerable:!0,get:a(function(){return Av.ChaosStrategy},"get")});var Sv=cp();Object.defineProperty(w,"ChaosHandler",{enumerable:!0,get:a(function(){return Sv.ChaosHandler},"get")});var $v=Oi();Object.defineProperty(w,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return $v.LargeFileUploadTask},"get")});var wv=fp();Object.defineProperty(w,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return wv.OneDriveLargeFileUploadTask},"get")});var Ov=Ri();Object.defineProperty(w,"getValidRangeSize",{enumerable:!0,get:a(function(){return Ov.getValidRangeSize},"get")});var zv=gp();Object.defineProperty(w,"StreamUpload",{enumerable:!0,get:a(function(){return zv.StreamUpload},"get")});var Rv=zi();Object.defineProperty(w,"FileUpload",{enumerable:!0,get:a(function(){return Rv.FileUpload},"get")});var kv=$i();Object.defineProperty(w,"UploadResult",{enumerable:!0,get:a(function(){return kv.UploadResult},"get")});var Dv=Si();Object.defineProperty(w,"Range",{enumerable:!0,get:a(function(){return Dv.Range},"get")});var Cv=hp();Object.defineProperty(w,"PageIterator",{enumerable:!0,get:a(function(){return Cv.PageIterator},"get")});var Nv=Ap();Object.defineProperty(w,"Client",{enumerable:!0,get:a(function(){return Nv.Client},"get")});var Mv=ki();Object.defineProperty(w,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return Mv.CustomAuthenticationProvider},"get")});var Uv=Di();Object.defineProperty(w,"GraphError",{enumerable:!0,get:a(function(){return Uv.GraphError},"get")});var Lv=qe();Object.defineProperty(w,"GraphClientError",{enumerable:!0,get:a(function(){return Lv.GraphClientError},"get")});var jv=Ni();Object.defineProperty(w,"GraphRequest",{enumerable:!0,get:a(function(){return jv.GraphRequest},"get")});var Fv=_r();Object.defineProperty(w,"ResponseType",{enumerable:!0,get:a(function(){return Fv.ResponseType},"get")})});var br=b((Ui,Li)=>{(function(e,t){typeof Ui=="object"&&typeof Li<"u"?Li.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Ui,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",s="hour",u="day",p="week",d="month",f="quarter",v="year",y="date",l="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(j){var A=["th","st","nd","rd"],I=j%100;return"["+j+(A[(I-20)%10]||A[I]||A[0])+"]"},"ordinal")},x=a(function(j,A,I){var O=String(j);return!O||O.length>=A?j:""+Array(A+1-O.length).join(I)+j},"m"),T={s:x,z:a(function(j){var A=-j.utcOffset(),I=Math.abs(A),O=Math.floor(I/60),S=I%60;return(A<=0?"+":"-")+x(O,2,"0")+":"+x(S,2,"0")},"z"),m:a(function j(A,I){if(A.date()<I.date())return-j(I,A);var O=12*(I.year()-A.year())+(I.month()-A.month()),S=A.clone().add(O,d),H=I-S<0,Z=A.clone().add(O+(H?-1:1),d);return+(-(O+(I-S)/(H?S-Z:Z-S))||0)},"t"),a:a(function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},"a"),p:a(function(j){return{M:d,y:v,w:p,d:u,D:y,h:s,m:i,s:o,ms:n,Q:f}[j]||String(j||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(j){return j===void 0},"u")},V="en",de={};de[V]=h;var xe=a(function(j){return j instanceof gt},"p"),De=a(function j(A,I,O){var S;if(!A)return V;if(typeof A=="string"){var H=A.toLowerCase();de[H]&&(S=H),I&&(de[H]=I,S=H);var Z=A.split("-");if(!S&&Z.length>1)return j(Z[0])}else{var te=A.name;de[te]=A,S=te}return!O&&S&&(V=S),S||!O&&V},"t"),ee=a(function(j,A){if(xe(j))return j.clone();var I=typeof A=="object"?A:{};return I.date=j,I.args=arguments,new gt(I)},"w"),W=T;W.l=De,W.i=xe,W.w=function(j,A){return ee(j,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var gt=function(){function j(I){this.$L=De(I.locale,null,!0),this.parse(I)}a(j,"M");var A=j.prototype;return A.parse=function(I){this.$d=function(O){var S=O.date,H=O.utc;if(S===null)return new Date(NaN);if(W.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var Z=S.match(m);if(Z){var te=Z[2]-1||0,fe=(Z[7]||"0").substring(0,3);return H?new Date(Date.UTC(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,fe)):new Date(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,fe)}}return new Date(S)}(I),this.$x=I.x||{},this.init()},A.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},A.$utils=function(){return W},A.isValid=function(){return this.$d.toString()!==l},A.isSame=function(I,O){var S=ee(I);return this.startOf(O)<=S&&S<=this.endOf(O)},A.isAfter=function(I,O){return ee(I)<this.startOf(O)},A.isBefore=function(I,O){return this.endOf(O)<ee(I)},A.$g=function(I,O,S){return W.u(I)?this[O]:this.set(S,I)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(I,O){var S=this,H=!!W.u(O)||O,Z=W.p(I),te=a(function(ut,be){var We=W.w(S.$u?Date.UTC(S.$y,be,ut):new Date(S.$y,be,ut),S);return H?We:We.endOf(u)},"l"),fe=a(function(ut,be){return W.w(S.toDate()[ut].apply(S.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(be)),S)},"$"),ye=this.$W,_e=this.$M,Se=this.$D,ht="set"+(this.$u?"UTC":"");switch(Z){case v:return H?te(1,0):te(31,11);case d:return H?te(1,_e):te(0,_e+1);case p:var st=this.$locale().weekStart||0,Vt=(ye<st?ye+7:ye)-st;return te(H?Se-Vt:Se+(6-Vt),_e);case u:case y:return fe(ht+"Hours",0);case s:return fe(ht+"Minutes",1);case i:return fe(ht+"Seconds",2);case o:return fe(ht+"Milliseconds",3);default:return this.clone()}},A.endOf=function(I){return this.startOf(I,!1)},A.$set=function(I,O){var S,H=W.p(I),Z="set"+(this.$u?"UTC":""),te=(S={},S[u]=Z+"Date",S[y]=Z+"Date",S[d]=Z+"Month",S[v]=Z+"FullYear",S[s]=Z+"Hours",S[i]=Z+"Minutes",S[o]=Z+"Seconds",S[n]=Z+"Milliseconds",S)[H],fe=H===u?this.$D+(O-this.$W):O;if(H===d||H===v){var ye=this.clone().set(y,1);ye.$d[te](fe),ye.init(),this.$d=ye.set(y,Math.min(this.$D,ye.daysInMonth())).$d}else te&&this.$d[te](fe);return this.init(),this},A.set=function(I,O){return this.clone().$set(I,O)},A.get=function(I){return this[W.p(I)]()},A.add=function(I,O){var S,H=this;I=Number(I);var Z=W.p(O),te=a(function(_e){var Se=ee(H);return W.w(Se.date(Se.date()+Math.round(_e*I)),H)},"y");if(Z===d)return this.set(d,this.$M+I);if(Z===v)return this.set(v,this.$y+I);if(Z===u)return te(1);if(Z===p)return te(7);var fe=(S={},S[i]=t,S[s]=r,S[o]=e,S)[Z]||1,ye=this.$d.getTime()+I*fe;return W.w(ye,this)},A.subtract=function(I,O){return this.add(-1*I,O)},A.format=function(I){var O=this,S=this.$locale();if(!this.isValid())return S.invalidDate||l;var H=I||"YYYY-MM-DDTHH:mm:ssZ",Z=W.z(this),te=this.$H,fe=this.$m,ye=this.$M,_e=S.weekdays,Se=S.months,ht=S.meridiem,st=a(function(be,We,Ht,Tr){return be&&(be[We]||be(O,H))||Ht[We].slice(0,Tr)},"h"),Vt=a(function(be){return W.s(te%12||12,be,"0")},"d"),ut=ht||function(be,We,Ht){var Tr=be<12?"AM":"PM";return Ht?Tr.toLowerCase():Tr};return H.replace(_,function(be,We){return We||function(Ht){switch(Ht){case"YY":return String(O.$y).slice(-2);case"YYYY":return W.s(O.$y,4,"0");case"M":return ye+1;case"MM":return W.s(ye+1,2,"0");case"MMM":return st(S.monthsShort,ye,Se,3);case"MMMM":return st(Se,ye);case"D":return O.$D;case"DD":return W.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return st(S.weekdaysMin,O.$W,_e,2);case"ddd":return st(S.weekdaysShort,O.$W,_e,3);case"dddd":return _e[O.$W];case"H":return String(te);case"HH":return W.s(te,2,"0");case"h":return Vt(1);case"hh":return Vt(2);case"a":return ut(te,fe,!0);case"A":return ut(te,fe,!1);case"m":return String(fe);case"mm":return W.s(fe,2,"0");case"s":return String(O.$s);case"ss":return W.s(O.$s,2,"0");case"SSS":return W.s(O.$ms,3,"0");case"Z":return Z}return null}(be)||Z.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(I,O,S){var H,Z=this,te=W.p(O),fe=ee(I),ye=(fe.utcOffset()-this.utcOffset())*t,_e=this-fe,Se=a(function(){return W.m(Z,fe)},"D");switch(te){case v:H=Se()/12;break;case d:H=Se();break;case f:H=Se()/3;break;case p:H=(_e-ye)/6048e5;break;case u:H=(_e-ye)/864e5;break;case s:H=_e/r;break;case i:H=_e/t;break;case o:H=_e/e;break;default:H=_e}return S?H:W.a(H)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return de[this.$L]},A.locale=function(I,O){if(!I)return this.$L;var S=this.clone(),H=De(I,O,!0);return H&&(S.$L=H),S},A.clone=function(){return W.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},j}(),at=gt.prototype;return ee.prototype=at,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach(function(j){at[j[1]]=function(A){return this.$g(A,j[0],j[1])}}),ee.extend=function(j,A){return j.$i||(j(A,gt,ee),j.$i=!0),ee},ee.locale=De,ee.isDayjs=xe,ee.unix=function(j){return ee(1e3*j)},ee.en=de[V],ee.Ls=de,ee.p={},ee})});var Wv={};io(Wv,{microsoftOutlook:()=>Gv});module.exports=oe(Wv);var Yp=Object.freeze({status:"aborted"});function z(e,t,r){function n(u,p){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:p,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,p);let d=s.prototype,f=Object.keys(d);for(let v=0;v<f.length;v++){let y=f[v];y in u||(u[y]=d[y].bind(u))}}a(n,"init");let o=r?.Parent??Object;class i extends o{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(u){var p;let d=r?.Parent?new i:this;n(d,u),(p=d._zod).deferred??(p.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a(u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(z,"$constructor");var Qp=Symbol("zod_brand"),Ce=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Er=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ao={};function Le(e){return e&&Object.assign(ao,e),ao}a(Le,"config");function uo(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}a(uo,"getEnumValues");function Zi(e,t){return typeof t=="bigint"?t.toString():t}a(Zi,"jsonStringifyReplacer");function Ar(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ar,"cached");function qi(e){return e==null}a(qi,"nullish");function Sr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Sr,"cleanRegex");var Hi=Symbol("evaluating");function me(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Hi)return n===void 0&&(n=Hi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(me,"defineLazy");var co="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(qt,"isObject");var ed=Ar(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gi(e){if(qt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(qt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Gi,"isPlainObject");var Wi=new Set(["string","number","symbol"]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(yt,"escapeRegex");function $r(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a($r,"clone");function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(ue,"normalizeParams");function Ki(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Ki,"optionalKeys");var td={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 vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}a(vt,"aborted");function Ke(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(Ke,"prefixIssues");function Ir(e){return typeof e=="string"?e:e?.message}a(Ir,"unwrapMessage");function Je(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Ir(e.inst?._zod.def?.error?.(e))??Ir(t?.error?.(e))??Ir(r.customError?.(e))??Ir(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(Je,"finalizeIssue");function Ji(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Ji,"getLengthableOrigin");function lo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(lo,"issue");var Xi=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zi,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),Yi=z("$ZodError",Xi),Gt=z("$ZodError",Xi,{Parent:Error});var nd=a(e=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Ce;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Je(p,i,Le())));throw co(u,o?.callee),u}return s.value},"_parse"),wr=nd(Gt),od=a(e=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(o?.Err??e)(s.issues.map(p=>Je(p,i,Le())));throw co(u,o?.callee),u}return s.value},"_parseAsync"),Or=od(Gt),id=a(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Ce;return i.issues.length?{success:!1,error:new(e??Yi)(i.issues.map(s=>Je(s,o,Le())))}:{success:!0,data:i.value}},"_safeParse"),Wt=id(Gt),ad=a(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Je(s,o,Le())))}:{success:!0,data:i.value}},"_safeParseAsync"),Kt=ad(Gt);var sd="(?:(?:\\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])))",ud=new RegExp(`^${sd}$`);var Qi=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ea=/^-?\d+n?$/;var po=/^-?\d+(?:\.\d+)?$/,ta=/^(?:true|false)$/i;var _t=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ra=z("$ZodCheckMinLength",(e,t)=>{var r;_t.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!qi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=Ji(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var fo=z("$ZodCheckStringFormat",(e,t)=>{var r,n;_t.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),na=z("$ZodCheckRegex",(e,t)=>{fo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var ia={major:4,minor:3,patch:6};var ce=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ia;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=a((s,u,p)=>{let d=vt(s),f;for(let v of u){if(v._zod.def.when){if(!v._zod.def.when(s))continue}else if(d)continue;let y=s.issues.length,l=v._zod.check(s);if(l instanceof Promise&&p?.async===!1)throw new Ce;if(f||l instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await l,s.issues.length!==y&&(d||(d=vt(s,y)))});else{if(s.issues.length===y)continue;d||(d=vt(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,p)=>{if(vt(s))return s.aborted=!0,s;let d=o(u,n,p);if(d instanceof Promise){if(p.async===!1)throw new Ce;return d.then(f=>e._zod.parse(f,p))}return e._zod.parse(d,p)},"handleCanaryResult");e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let d=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(f=>i(f,s,u)):i(d,s,u)}let p=e._zod.parse(s,u);if(p instanceof Promise){if(u.async===!1)throw new Ce;return p.then(d=>o(d,n,u))}return o(p,n,u)}}me(e,"~standard",()=>({validate:a(o=>{try{let i=Wt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Kt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kr=z("$ZodString",(e,t)=>{ce.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qi(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),mo=z("$ZodStringFormat",(e,t)=>{fo.init(e,t),kr.init(e,t)});var la=z("$ZodURL",(e,t)=>{mo.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var pa=z("$ZodNumber",(e,t)=>{ce.init(e,t),e._zod.pattern=e._zod.bag.pattern??po,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}});var go=z("$ZodBoolean",(e,t)=>{ce.init(e,t),e._zod.pattern=ta,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),da=z("$ZodBigInt",(e,t)=>{ce.init(e,t),e._zod.pattern=ea,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var fa=z("$ZodAny",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r}),ma=z("$ZodUnknown",(e,t)=>{ce.init(e,t),e._zod.parse=r=>r});var ga=z("$ZodVoid",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),ha=z("$ZodDate",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function aa(e,t,r){e.issues.length&&t.issues.push(...Ke(r,e.issues)),t.value[r]=e.value}a(aa,"handleArrayResult");var ya=z("$ZodArray",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let i=[];for(let s=0;s<o.length;s++){let u=o[s],p=t.element._zod.run({value:u,issues:[]},n);p instanceof Promise?i.push(p.then(d=>aa(d,r,s))):aa(p,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Rr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ke(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Rr,"handlePropertyResult");function cd(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ki(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(cd,"normalizeDef");function ld(e,t,r,n,o,i){let s=[],u=o.keySet,p=o.catchall._zod,d=p.def.type,f=p.optout==="optional";for(let v in t){if(u.has(v))continue;if(d==="never"){s.push(v);continue}let y=p.run({value:t[v],issues:[]},n);y instanceof Promise?e.push(y.then(l=>Rr(l,r,v,t,f))):Rr(y,r,v,t,f)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}a(ld,"handleCatchall");var va=z("$ZodObject",(e,t)=>{if(ce.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let p={...u};return Object.defineProperty(t,"shape",{value:p}),p},"get")})}let n=Ar(()=>cd(t));me(e._zod,"propValues",()=>{let u=t.shape,p={};for(let d in u){let f=u[d]._zod;if(f.values){p[d]??(p[d]=new Set);for(let v of f.values)p[d].add(v)}}return p});let o=qt,i=t.catchall,s;e._zod.parse=(u,p)=>{s??(s=n.value);let d=u.value;if(!o(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value={};let f=[],v=s.shape;for(let y of s.keys){let l=v[y],m=l._zod.optout==="optional",_=l._zod.run({value:d[y],issues:[]},p);_ instanceof Promise?f.push(_.then(h=>Rr(h,u,y,d,m))):Rr(_,u,y,d,m)}return i?ld(f,d,u,p,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function sa(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!vt(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Je(s,n,Le())))}),t)}a(sa,"handleUnionResults");var ho=z("$ZodUnion",(e,t)=>{ce.init(e,t),me(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),me(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),me(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),me(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Sr(i.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let s=!1,u=[];for(let p of t.options){let d=p._zod.run({value:o.value,issues:[]},i);if(d instanceof Promise)u.push(d),s=!0;else{if(d.issues.length===0)return d;u.push(d)}}return s?Promise.all(u).then(p=>sa(p,o,e,i)):sa(u,o,e,i)}});var _a=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ho.init(e,t);let r=e._zod.parse;me(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,p]of Object.entries(s)){o[u]||(o[u]=new Set);for(let d of p)o[u].add(d)}}return o});let n=Ar(()=>{let o=t.options,i=new Map;for(let s of o){let u=s._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let p of u){if(i.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);i.set(p,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!qt(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let u=n.value.get(s?.[t.discriminator]);return u?u._zod.run(o,i):t.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var xa=z("$ZodRecord",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Gi(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let u=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){u.add(typeof d=="number"?d.toString():d);let f=t.valueType._zod.run({value:o[d],issues:[]},n);f instanceof Promise?i.push(f.then(v=>{v.issues.length&&r.issues.push(...Ke(d,v.issues)),r.value[d]=v.value})):(f.issues.length&&r.issues.push(...Ke(d,f.issues)),r.value[d]=f.value)}let p;for(let d in o)u.has(d)||(p=p??[],p.push(d));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:p})}else{r.value={};for(let u of Reflect.ownKeys(o)){if(u==="__proto__")continue;let p=t.keyType._zod.run({value:u,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&po.test(u)&&p.issues.length){let v=t.keyType._zod.run({value:Number(u),issues:[]},n);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(p=v)}if(p.issues.length){t.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(v=>Je(v,n,Le())),input:u,path:[u],inst:e});continue}let f=t.valueType._zod.run({value:o[u],issues:[]},n);f instanceof Promise?i.push(f.then(v=>{v.issues.length&&r.issues.push(...Ke(u,v.issues)),r.value[p.value]=v.value})):(f.issues.length&&r.issues.push(...Ke(u,f.issues)),r.value[p.value]=f.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Pa=z("$ZodEnum",(e,t)=>{ce.init(e,t);let r=uo(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Wi.has(typeof o)).map(o=>typeof o=="string"?yt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),ba=z("$ZodLiteral",(e,t)=>{if(ce.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?yt(n):n?yt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Ta=z("$ZodTransform",(e,t)=>{ce.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Er(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Ce;return r.value=o,r}});function ua(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ua,"handleOptionalResult");var Ea=z("$ZodOptional",(e,t)=>{ce.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),me(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sr(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>ua(i,r.value)):ua(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Ia=z("$ZodNullable",(e,t)=>{ce.init(e,t),me(e._zod,"optin",()=>t.innerType._zod.optin),me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sr(r.source)}|null)$`):void 0}),me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Aa=z("$ZodPipe",(e,t)=>{ce.init(e,t),me(e._zod,"values",()=>t.in._zod.values),me(e._zod,"optin",()=>t.in._zod.optin),me(e._zod,"optout",()=>t.out._zod.optout),me(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(s=>zr(s,t.in,n)):zr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>zr(i,t.out,n)):zr(o,t.out,n)}});function zr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(zr,"handlePipeResult");var Sa=z("$ZodCustom",(e,t)=>{_t.init(e,t),ce.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>ca(i,r,n,e));ca(o,r,n,e)}});function ca(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(lo(o))}}a(ca,"handleRefineResult");var wa,md=Symbol("ZodOutput"),gd=Symbol("ZodInput"),yo=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Oa(){return new yo}a(Oa,"registry");(wa=globalThis).__zod_globalRegistry??(wa.__zod_globalRegistry=Oa());var vo=globalThis.__zod_globalRegistry;function za(e,t){return new e({type:"string",...ue(t)})}a(za,"_string");function Ra(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(Ra,"_coercedString");function ka(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(ka,"_url");function Da(e,t){return new e({type:"number",checks:[],...ue(t)})}a(Da,"_number");function Ca(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(Ca,"_coercedNumber");function Na(e,t){return new e({type:"boolean",...ue(t)})}a(Na,"_boolean");function Ma(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(Ma,"_coercedBoolean");function Ua(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(Ua,"_coercedBigint");function La(e){return new e({type:"any"})}a(La,"_any");function ja(e){return new e({type:"unknown"})}a(ja,"_unknown");function Fa(e,t){return new e({type:"void",...ue(t)})}a(Fa,"_void");function Ba(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(Ba,"_coercedDate");function Re(e,t){return new ra({check:"min_length",...ue(t),minimum:e})}a(Re,"_minLength");function Xe(e,t){return new na({check:"string_format",format:"regex",...ue(t),pattern:e})}a(Xe,"_regex");function Va(e,t,r){let n=ue(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(Va,"_custom");var ge=z("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ce.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Wt(e,r,n),e.parseAsync=async(r,n)=>Or(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Kt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$r(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Cr=z("ZodMiniString",(e,t)=>{kr.init(e,t),ge.init(e,t)});function c(e){return za(Cr,e)}a(c,"string");var Ha=z("ZodMiniStringFormat",(e,t)=>{mo.init(e,t),Cr.init(e,t)});var Id=z("ZodMiniURL",(e,t)=>{la.init(e,t),Ha.init(e,t)});function Za(e){return ka(Id,e)}a(Za,"url");var _o=z("ZodMiniNumber",(e,t)=>{pa.init(e,t),ge.init(e,t)});function Pe(e){return Da(_o,e)}a(Pe,"number");var xo=z("ZodMiniBoolean",(e,t)=>{go.init(e,t),ge.init(e,t)});function Q(e){return Na(xo,e)}a(Q,"boolean");var qa=z("ZodMiniBigInt",(e,t)=>{da.init(e,t),ge.init(e,t)});var Ad=z("ZodMiniAny",(e,t)=>{fa.init(e,t),ge.init(e,t)});function Xt(){return La(Ad)}a(Xt,"any");var Sd=z("ZodMiniUnknown",(e,t)=>{ma.init(e,t),ge.init(e,t)});function M(){return ja(Sd)}a(M,"unknown");var $d=z("ZodMiniVoid",(e,t)=>{ga.init(e,t),ge.init(e,t)});function Ga(e){return Fa($d,e)}a(Ga,"_void");var Wa=z("ZodMiniDate",(e,t)=>{ha.init(e,t),ge.init(e,t)});var wd=z("ZodMiniArray",(e,t)=>{ya.init(e,t),ge.init(e,t)});function F(e,t){return new wd({type:"array",element:e,...ue(t)})}a(F,"array");var Od=z("ZodMiniObject",(e,t)=>{va.init(e,t),ge.init(e,t),me(e,"shape",()=>t.shape)});function g(e,t){let r={type:"object",shape:e??{},...ue(t)};return new Od(r)}a(g,"object");var zd=z("ZodMiniUnion",(e,t)=>{ho.init(e,t),ge.init(e,t)});function B(e,t){return new zd({type:"union",options:e,...ue(t)})}a(B,"union");var Rd=z("ZodMiniDiscriminatedUnion",(e,t)=>{_a.init(e,t),ge.init(e,t)});function xt(e,t,r){return new Rd({type:"union",options:t,discriminator:e,...ue(r)})}a(xt,"discriminatedUnion");var kd=z("ZodMiniRecord",(e,t)=>{xa.init(e,t),ge.init(e,t)});function U(e,t,r){return new kd({type:"record",keyType:e,valueType:t,...ue(r)})}a(U,"record");var Dd=z("ZodMiniEnum",(e,t)=>{Pa.init(e,t),ge.init(e,t),e.options=Object.values(t.entries)});function G(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Dd({type:"enum",entries:r,...ue(t)})}a(G,"_enum");var Cd=z("ZodMiniLiteral",(e,t)=>{ba.init(e,t),ge.init(e,t)});function k(e,t){return new Cd({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a(k,"literal");var Nd=z("ZodMiniTransform",(e,t)=>{Ta.init(e,t),ge.init(e,t)});function Ye(e){return new Nd({type:"transform",transform:e})}a(Ye,"transform");var Md=z("ZodMiniOptional",(e,t)=>{Ea.init(e,t),ge.init(e,t)});function P(e){return new Md({type:"optional",innerType:e})}a(P,"optional");var Ud=z("ZodMiniNullable",(e,t)=>{Ia.init(e,t),ge.init(e,t)});function Yt(e){return new Ud({type:"nullable",innerType:e})}a(Yt,"nullable");var Ld=z("ZodMiniPipe",(e,t)=>{Aa.init(e,t),ge.init(e,t)});function Qe(e,t){return new Ld({type:"pipe",in:e,out:t})}a(Qe,"pipe");var jd=z("ZodMiniCustom",(e,t)=>{Sa.init(e,t),ge.init(e,t)});function Nr(e,t){return Va(jd,e??(()=>!0),t)}a(Nr,"custom");var Qt={};io(Qt,{bigint:()=>Gd,boolean:()=>qd,date:()=>Wd,number:()=>Zd,string:()=>Hd});function Hd(e){return Ra(Cr,e)}a(Hd,"string");function Zd(e){return Ca(_o,e)}a(Zd,"number");function qd(e){return Ma(xo,e)}a(qd,"boolean");function Gd(e){return Ua(qa,e)}a(Gd,"bigint");function Wd(e){return Ba(Wa,e)}a(Wd,"date");var bo=g({retryOnFailure:g({defaultValue:P(Q()),hide:P(Q())}),continueOnFailure:g({defaultValue:P(Q()),hide:P(Q())})}),Po=class{constructor(t,r,n,o,i,s,u,p,d,f,v){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=i;this.test=s;this.requireAuth=u;this.errorHandlingOptions=p;this.outputSchema=d;this.audience=f;this.aiMetadata=v}static{a(this,"IAction")}},ne=a(e=>new Po(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var Y=g({displayName:c(),description:P(c())}),q=a((e,t)=>g({type:k(t),required:Q(),defaultValue:P(Xt())}),"TPropertyValue");var Ie=g({...Y.shape,...q(c(),"SHORT_TEXT").shape}),je=g({...Y.shape,...q(c(),"LONG_TEXT").shape});var Ja=g({label:c(),value:M()}),Mr=g({disabled:P(Q()),placeholder:P(c()),options:F(Ja)});var Ae=g({...Y.shape,options:Mr,...q(M(),"STATIC_DROPDOWN").shape}),Fe=g({...Y.shape,options:Mr,...q(F(M()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var To=g({...Y.shape,...q(M(),"DROPDOWN").shape,refreshers:F(c())}),er=g({...Y.shape,...q(F(M()),"MULTI_SELECT_DROPDOWN").shape,refreshers:F(c())});var Be=g({...Y.shape,...q(Q(),"CHECKBOX").shape});var Ve=g({...Y.shape,...q(Pe(),"NUMBER").shape});var tr=g({...Y.shape,...q(M(),"FILE").shape});var rr=g({...Y.shape,...q(c(),"DATE_TIME").shape});var Xa=U(c(),B([Ie,je,Ae,er,Fe,Be,Ve,tr,rr])),nr=g({...Y.shape,properties:Xa,...q(F(M()),"ARRAY").shape});var or=g({...Y.shape,...q(B([U(c(),M())]),"JSON").shape});var Ya=B([Ie,Ae,or,nr,Fe]),Jd=U(c(),Ya),Eo=g({refreshers:F(c()),...Y.shape,...q(M(),"DYNAMIC").shape});var Ur=g({...Y.shape,...q(Ga(),"MARKDOWN").shape});var ir=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ir||{}),Pt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Pt||{}),bt=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(bt||{});var ar=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ar||{}),Io="both_client_credentials_and_authorization_code";var Ne=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ne||{}),sr=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(sr||{}),Xd=g({strategy:G(sr),paramName:P(c())}),ur=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ur||{});var Lr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lr||{}),Qa=g({status:P(Pe()),body:P(M()),headers:P(U(c(),c()))}),es=g({type:k("DELAY"),resumeDateTime:c(),requestIdToReply:P(c()),handlerId:P(c()),streamStepProgress:P(G(Lr))}),ts=g({type:k("WEBHOOK"),requestId:c(),requestIdToReply:P(c()),response:Qa,handlerId:P(c()),streamStepProgress:P(G(Lr))}),Yd=B([es,ts]);var Qd=g({body:M(),rawBody:P(M()),headers:U(c(),c()),queryParams:U(c(),c())});function he(e){return e==null}a(he,"isNil");function cr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(cr,"isEmpty");function He(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(He,"assertNotNullOrUndefined");var Ao=ze(require("crypto"),1);var ef=128,ct,Tt,tf=a(e=>{!ct||ct.length<e?(ct=Buffer.allocUnsafe(e*ef),Ao.default.randomFillSync(ct),Tt=0):Tt+e>ct.length&&(Ao.default.randomFillSync(ct),Tt=0),Tt+=e},"fillPool"),rf=a(e=>(tf(e|=0),ct.subarray(Tt-e,Tt)),"random"),nf=a((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let u=r(o),p=o;for(;p--;)if(s+=e[u[p]&n]||"",s.length===i)return s}}},"customRandom"),ns=a((e,t=21)=>nf(e,t,rf),"customAlphabet");var of="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",os=21,O$=c().check(Xe(new RegExp(`^[0-9a-zA-Z]{${os}}$`))),af=ns(of,os);var et=Qe(Ye(e=>e instanceof Date?e.toISOString():e),c()),$e={id:c(),created:et,updated:et},ie=a(e=>P(Yt(e)),"Nullable");function So(e){return P(Yt(G(e)))}a(So,"NullableEnum");var k$=Qe(Ye(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),P(Q())),jr=a(e=>Qe(Ye(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),P(F(e))),"OptionalArrayFromQuery");var N$=U(c(),M());var lr=(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))(lr||{});var W$=c().check(Xe(/^#[0-9A-Fa-f]{6}$/));var J$=g({filename:c(),data:M(),type:k("file"),mimetype:P(c())});var sf=ze(as());var nw=g({...$e,name:c(),permissions:F(c()),platformId:ie(c()),type:c(),userCount:P(Pe())});var ss=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ss||{}),$o=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($o||{}),wo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wo||{});var Oo=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Oo||{});var zo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zo||{});var uf=g({mode:G(ss),value:M()}),cf=g({auth:P(c()),fields:U(c(),uf)}),lf=g({pieceName:c(),pieceVersion:c(),actionName:c(),predefinedInput:P(cf)}),pf=g({type:k("PIECE"),toolName:c().check(Re(1)),pieceMetadata:lf}),df=g({type:k("none")}),ff=g({type:k("access_token"),accessToken:c()}),mf=g({type:k("api_key"),apiKey:c(),apiKeyHeader:c()}),gf=g({type:k("headers"),headers:U(c(),c())}),hf=xt("type",[df,ff,mf,gf]),us=g({type:k("FLOW"),toolName:c().check(Re(1)),externalFlowId:c(),flowDisplayName:P(c())}),cs=g({type:k("MCP"),toolName:c().check(Re(1)),serverUrl:Za(),protocol:G(wo),auth:hf}),ls=g({type:k("KNOWLEDGE_BASE"),toolName:c().check(Re(1)),sourceType:G($o),sourceId:c(),sourceName:c()}),yf=xt("type",[pf,us,cs,ls]),vf=g({displayName:c(),description:P(c()),type:G(Oo)}),ps=g({type:k("MARKDOWN"),markdown:c()}),Et={type:k("TOOL_CALL"),input:ie(U(c(),M())),output:P(M()),toolName:c(),status:G(zo),toolCallId:c(),startTime:c(),endTime:P(c())},Ow=g(Et),ds=xt("toolCallType",[g({...Et,toolCallType:k("PIECE"),pieceName:c(),pieceVersion:c(),actionName:c()}),g({...Et,toolCallType:k("FLOW"),displayName:c(),externalFlowId:c()}),g({...Et,toolCallType:k("MCP"),displayName:c(),serverUrl:c()}),g({...Et,toolCallType:k("KNOWLEDGE_BASE"),displayName:c(),sourceType:c()}),g({...Et,toolCallType:k("UNKNOWN"),displayName:c()})]),_f=B([ps,ds]);var Ro=(r=>(r.IMAGE="image",r.TEXT="text",r))(Ro||{}),Ze=g({apiKey:c()}),xf=Ze,Pf=g({apiKey:c(),apiKeyHash:c()}),bf=Ze,Tf=Ze,Ef=Ze,If=Ze,Af=Ze,Sf=Ze,$f=Ze,fs=g({accessKeyId:c().check(Re(1)),secretAccessKey:c().check(Re(1))}),wf=g({}),Of=g({}),zf=g({}),Rf=g({}),kf=g({}),Df=g({}),ms=g({modelId:c(),modelName:c(),modelType:G(Ro)}),gs=g({apiKeyHeader:c(),baseUrl:c(),models:F(ms),defaultHeaders:P(U(c(),c()))}),hs=g({accountId:c(),gatewayId:c(),models:F(ms),vertexProject:P(c()),vertexRegion:P(c())}),ys=g({resourceName:c(),apiVersion:Qe(Ye(e=>typeof e=="string"&&e.trim().length===0?void 0:e),P(c()))}),vs=g({region:c().check(Re(1))}),Cf=B([xf,Ef,If,Af,Sf,Tf,bf,Pf,fs,$f]),_s=B([gs,hs,ys,vs,wf,zf,Rf,kf,Of,Df]),Nf=g({id:c(),name:c(),type:G(Ro)}),Mf=g({id:c(),name:c(),provider:G(lr),config:_s,enabledForChat:Q()}),Uf=g({provider:G(lr),config:_s,auth:Cf,platformId:c()});var Dw={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Lf=g({base64Url:c(),fileName:c(),extension:P(c())}),jf=g({mimeType:c(),url:c(),fileName:P(c())}),ko=B([Lf,jf]);var Ff=B([g({type:k("file"),value:ko}),g({type:k("markdown"),value:c(),files:P(F(ko))})]),Bf=g({sessionId:c(),message:c(),files:P(F(c()))});var Ps=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ps||{}),bs=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(bs||{}),Do=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Do||{});var Vf=B([g({...$e,name:c(),externalId:c(),type:k("STATIC_DROPDOWN"),tableId:c(),projectId:c(),data:g({options:F(g({value:c()}))})}),g({...$e,name:c(),externalId:c(),type:B([k("TEXT"),k("NUMBER"),k("DATE")]),tableId:c(),projectId:c()})]),Hf=g({...$e,name:c(),folderId:ie(c()),projectId:c(),externalId:c(),status:So(bs),trigger:So(Ps)}),Zf=g({...$e,tableId:c(),projectId:c(),cells:U(c(),g({updated:c(),created:c(),value:M(),fieldName:c()}))}),qf=g({events:F(G(Do)),webhookUrl:c(),flowId:c()}),Gf=g({fields:F(g({id:c(),name:c()})),rows:F(U(c(),c())),name:c()}),Wf=g({projectId:c(),limit:P(Qt.number()),cursor:P(c()),name:P(c()),externalIds:jr(c()),folderId:P(c()),folderIds:jr(c())}),Kf=g({records:F(F(g({fieldId:c(),value:Es()}))),tableId:c()}),Jf=g({cells:P(F(g({fieldId:c(),value:Es()}))),tableId:c(),agentUpdate:P(Q())}),Ts=xt("operator",[lt("eq"),lt("neq"),lt("gt"),lt("gte"),lt("lt"),lt("lte"),lt("co"),xs("exists"),xs("not_exists")]),Xf=g({tableId:c(),limit:P(Qt.number()),cursor:P(c()),filters:jr(Ts)});function Es(){return Qe(Ye(e=>e==null?e:String(e)),Yt(c()))}a(Es,"coerceToString");function lt(e){return g({fieldId:c(),operator:k(e),value:c()})}a(lt,"valueFilter");function xs(e){return g({fieldId:c(),operator:k(e)})}a(xs,"existenceFilter");var Yf=g({status:P(Pe()),body:P(M()),headers:P(U(c(),c()))}),Qf=g({...$e,deleted:ie(et),ownerId:c(),displayName:c(),platformId:c(),externalId:ie(c())});var Is=g({name:c(),description:P(c()),type:c(),required:Q()}),em=g({pieceName:c(),triggerName:c(),input:g({toolName:c(),toolDescription:c(),inputSchema:F(Is),returnsResponse:Q()})});var As="^[0-9]+\\.[0-9]+\\.[0-9]+$",Qw=new RegExp(As),rm="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",eO=c().check(Xe(new RegExp(As))),tO=c().check(Xe(new RegExp(rm))),nm=g({packageType:k("ARCHIVE"),pieceType:G(Pt),pieceName:c(),pieceVersion:c(),archiveId:c(),platformId:c()}),Ss=g({packageType:k("REGISTRY"),pieceType:k("OFFICIAL"),pieceName:c(),pieceVersion:c()}),$s=g({packageType:k("REGISTRY"),pieceType:k("CUSTOM"),pieceName:c(),pieceVersion:c(),platformId:c()}),rO=B([Ss,$s]),nO=B([nm,Ss,$s]),ws=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ws||{}),om=g({type:G(ws),cronExpression:c(),timezone:c()}),oO=g({...$e,type:G(Ne),projectId:c(),flowId:c(),triggerName:c(),schedule:ie(om),flowVersionId:c(),pieceName:c(),pieceVersion:c(),deleted:ie(c()),simulate:Q()}),Os=(h=>(h.UNKNOWN="UNKNOWN",h.FLOW_RUN_LOG="FLOW_RUN_LOG",h.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",h.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",h.FLOW_STEP_FILE="FLOW_STEP_FILE",h.SAMPLE_DATA="SAMPLE_DATA",h.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",h.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",h.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",h.PROJECT_RELEASE="PROJECT_RELEASE",h.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",h.PLATFORM_ASSET="PLATFORM_ASSET",h.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",h.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",h.KNOWLEDGE_BASE="KNOWLEDGE_BASE",h.FLOW_BUNDLE="FLOW_BUNDLE",h))(Os||{}),zs=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(zs||{}),Rs=(r=>(r.S3="S3",r.DB="DB",r))(Rs||{}),iO=g({...$e,projectId:ie(c()),platformId:ie(c()),type:G(Os),compression:G(zs),data:P(M()),location:G(Rs),size:ie(Pe()),fileName:ie(c()),s3Key:ie(c()),metadata:ie(U(c(),c()))}),ks=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ks||{}),Ds=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ds||{}),aO=g({id:c(),email:c(),firstName:c(),status:G(Ds),externalId:ie(c()),platformId:ie(c()),platformRole:G(ks),lastName:c(),created:et,updated:et,lastActiveDate:ie(et),imageUrl:ie(c())});var No=g({...Y.shape,...q(U(c(),M()),"OBJECT").shape});var Ms=g({...Y.shape,...q(c(),"COLOR").shape});var Mo=B([Ie,je,Ur,Be,Ae,Fe,To,er,Eo,Ve,nr,No,or,rr,tr,Ms]),E={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Me=g({displayName:c(),description:P(c())});var Us=g({username:c(),password:c()}),Uo=g({...Me.shape,username:g({displayName:c(),description:P(c())}),password:g({displayName:c(),description:P(c())}),...q(Us,"BASIC_AUTH").shape});var um=U(c(),B([Ie,je,Ve,Be,Ae])),Lo=g({...Me.shape,props:um,...q(M(),"CUSTOM_AUTH").shape});var pt=g({...Me.shape,...q(g({auth:c()}),"SECRET_TEXT").shape});var cm=U(c(),B([Ie,je,pt,Ve,Be,Ae,Fe,Ur])),Ls=g({...Me.shape,props:cm,...q(M(),"OIDC").shape});var jo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(jo||{}),js=B([Ie,pt,Ae]),Fs=U(c(),js),lm=g({props:P(U(c(),js)),authUrl:c(),tokenUrl:c(),scope:F(c()),prompt:P(B([k("none"),k("consent"),k("login"),k("omit")])),pkce:P(Q()),pkceMethod:P(B([k("plain"),k("S256")])),authorizationMethod:P(G(jo)),grantType:P(B([G(ar),k(Io)])),extra:P(U(c(),c()))}),Bs=g({access_token:c(),props:P(Fs),data:U(c(),Xt())}),Fo=g({...Me.shape,...lm.shape,...q(Bs,"OAUTH2").shape});var It=B([Uo,Lo,Ls,Fo,pt]),pr="Connection",Bo={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||pr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||pr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||pr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||pr}},None(){}};var Uz={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 pm=g({...Y.shape,...q(M(),"CUSTOM").shape,code:c()});var dm=B([Mo,It]),Vo=U(c(),dm),oR=U(c(),Mo);var Vs=B([g({strategy:k("CRON"),cronExpression:c()}),g({strategy:k("NONE")})]),At=class{constructor(t,r,n,o,i,s,u,p,d,f,v,y,l,m,_,h,x,T,V){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=p;this.renewConfiguration=d;this.onRenew=f;this.onEnable=v;this.onDisable=y;this.onStart=l;this.run=m;this.test=_;this.sampleData=h;this.testStrategy=x;this.outputSchema=T;this.aiMetadata=V}static{a(this,"ITrigger")}},St=a(e=>{switch(e.type){case"WEBHOOK":return new At(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new At(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new At(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new At(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,he(e.sampleData)&&he(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Hs="2",Br="0.82.0";var Ho=class{constructor(t,r,n,o,i,s,u,p,d=Br,f,v=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=u;this.auth=p;this.minimumSupportedRelease=d;this.maximumSupportedRelease=f;this.description=v;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:Hs}),"getContextInfo");(!fm(d)||mm(d,Br))&&(this.minimumSupportedRelease=Br),i.forEach(y=>this._actions[y.name]=y),s.forEach(y=>this._triggers[y.name]=y)}static{a(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,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Zs=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ho(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function fm(e){return/^\d+\.\d+\.\d+$/.test(e)}a(fm,"isValidSimpleSemver");function mm(e,t){let[r,n,o]=e.split(".").map(Number),[i,s,u]=t.split(".").map(Number);return r!==i?r<i:n!==s?n<s:o<u}a(mm,"isSemverLessThan");var gm=P(U(c(),U(c(),c()))),qs=g({id:P(c()),name:c(),displayName:c(),logoUrl:c(),description:c(),authors:F(c()),platformId:P(c()),directoryPath:P(c()),auth:P(B([It,F(It)])),version:c(),categories:P(F(G(bt))),minimumSupportedRelease:P(c()),maximumSupportedRelease:P(c()),i18n:gm}),hm=G(["human","ai","both"]),Gs=g({description:P(c()),idempotent:P(Q())}),Ws=g({name:c(),displayName:c(),description:c(),props:Vo,requireAuth:Q(),errorHandlingOptions:P(bo),outputSchema:P(Nr()),audience:P(hm),aiMetadata:P(Gs)}),Ks=g({name:c(),displayName:c(),description:c(),props:Vo,errorHandlingOptions:P(bo),type:G(Ne),sampleData:M(),handshakeConfiguration:P(Nr()),renewConfiguration:P(Vs),testStrategy:G(ur),outputSchema:P(Nr()),aiMetadata:P(Gs)}),ym=g({...qs.shape,actions:U(c(),Ws),triggers:U(c(),Ks)}),vm=g({...qs.shape,actions:Pe(),triggers:Pe(),suggestedActions:P(F(Ks)),suggestedTriggers:P(F(Ws))}),Js=g({projectUsage:Pe(),tags:P(F(c())),pieceType:G(Pt),packageType:G(ir),platformId:P(c()),archiveId:P(c())}),ok=g({...ym.shape,...Js.shape}),ik=g({...vm.shape,...Js.shape}),ak=g({name:c(),version:c()});var _m=ze(require("path")),xm=ze(require("fs/promises"));var Vr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{a(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((i,s)=>{o.append(s,i)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Hr=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new Zo,r=new qo){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zo=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qo=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Zr=class extends Error{constructor(r,n){let o=n.status||500,i=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:i},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=i}static{a(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qr=class extends Vr{static{a(this,"FetchHttpClient")}constructor(t="",r=new Hr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[V,de]of Object.entries(s))o.append(V,de);let u=o.toString(),p=u?`${n}?${u}`:n,d=t.responseType??"json",f=t.followRedirects??!0,v=t.retries??0,{body:y,extraHeaders:l,isStream:m}=Pm(t.body,i),_=Tm({...i,...l}),h=await bm(async()=>{let V=new AbortController,de=t.timeout&&t.timeout>0?setTimeout(()=>V.abort(),t.timeout):void 0;try{let xe={method:t.method.toString(),headers:_,body:y,redirect:f?"follow":"manual",signal:V.signal};return m&&(xe.duplex="half"),r?.dispatcher!==void 0&&(xe.dispatcher=r.dispatcher),await fetch(p,xe)}finally{de!==void 0&&clearTimeout(de)}},v),x=f?300:400;if(h.status<200||h.status>=x){let V=await Xs(h,d),de=new Zr(t.body,{status:h.status,responseBody:V});throw console.error("[HttpClient#(sanitized error message)] Request failed:",de),de}let T=await Xs(h,d);return{status:h.status,headers:Em(h.headers),body:T}}};function Pm(e,t){return Am(e)?{body:void 0,extraHeaders:{},isStream:!1}:Im(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(Pm,"serializeBody");async function Xs(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(Xs,"parseResponseBody");async function bm(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ys(n);continue}return o}catch(o){if(r=o,n<t){await Ys(n);continue}throw o}throw r}a(bm,"sendWithRetries");function Ys(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(Ys,"backoff");function Tm(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}a(Tm,"normalizeHeaders");function Em(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(Em,"toHttpHeaders");function Im(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}a(Im,"isNodeFormData");function Am(e){return e==null}a(Am,"isNil");var Qs=new qr;var Go=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(Go||{});var fh=ze(require("fs")),il=ze(ol());var mh={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function gh(e){let t=e.split(";")[0].trim().toLowerCase();return mh[t]??""}a(gh,"contentTypeToExtension");var hh=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),yh=a((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function al({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:p="headers"}){return ne({audience:"human",name:i||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:E.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:d})=>({url:E.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
6
|
+
i.e ${yh(t,d)}/resource or /resource`,required:!0,defaultValue:d?t(d):"",...s?.url??{}})}),"props")}),method:E.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Go).map(d=>({label:d,value:d}))},...s?.method??{}}),headers:E.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:E.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:E.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:E.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:a(async({body_type:d})=>{if(!d)return{};let f=d,v={};switch(f){case"none":break;case"json":v.data=E.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":v.data=E.LongText({displayName:"Raw Body",required:!0});break;case"form_data":v.data=E.Array({displayName:"Form Data",required:!0,properties:{fieldName:E.ShortText({displayName:"Field Name",required:!0}),fieldType:E.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:E.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:E.File({displayName:"File Field Value",required:!1})}});break}return v},"props")}),response_is_binary:E.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:E.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:E.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:E.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...u},run:a(async d=>{let{method:f,url:v,headers:y,queryParams:l,body:m,body_type:_,failsafe:h,timeout:x,response_is_binary:T,followRedirects:V}=d.propsValue;He(f,"Method"),He(v,"URL");let de=he(r)?{}:await r(d.auth,d.propsValue),xe=v.url,De=xe.startsWith("http://")||xe.startsWith("https://")?xe:hh({baseUrl:t(d.auth),relativePath:xe}),ee={method:f,url:De,headers:{...y??{},...p==="headers"||!he(p)?de:{}},queryParams:{...p==="queryParams"?de:{},...l??{}},timeout:x?x*1e3:0,followRedirects:V};if(T&&(ee.responseType="arraybuffer"),m)if(_&&_!=="none"){let W=m.data;if(_==="form_data"){let gt=W,at=new il.default;for(let{fieldName:j,fieldType:A,textFieldValue:I,fileFieldValue:O}of gt)A==="text"&&!cr(I)?at.append(j,I):A==="file"&&!cr(O)&&at.append(j,O.data,{filename:O?.filename});ee.body=at,ee.headers={...ee.headers,...at.getHeaders()}}else ee.body=W}else _||(ee.body=m);try{let W=await Qs.sendRequest(ee);return await vh(d.files,W.body,W.status,W.headers,T)}catch(W){if(h)return W.errorMessage();throw W}},"run")})}a(al,"createCustomApiCallAction");var vh=a(async(e,t,r,n,o)=>{let i;if(o&&_h(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=gh(s??"")||"txt",p;t instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?p=t:p=Buffer.from(t),i=await e.write({fileName:`output.${u}`,data:p})}else i=t;return{status:r,headers:n,body:i}},"handleBinaryResponse"),_h=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ue={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:i,server:s}){switch(e.strategy){case 0:{let u=await t.get("lastPoll");if(he(u))throw new Error("lastPoll doesn't exist in the store.");let p=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:u,server:s}),d=p.reduce((f,v)=>Math.max(f,v.epochMilliSeconds),u);return await t.put("lastPoll",d),p.filter(f=>f.epochMilliSeconds>u).map(f=>f.data)}case 1:{let u=await t.get("lastItem"),p=await e.items({store:t,auth:r,propsValue:n,lastItemId:u,files:i,server:s}),d=p.findIndex(y=>y.id===u),f=[];he(u)||d==-1?f=p??[]:f=p?.slice(0,d)??[],he(o)||(f=f.slice(-o));let v=f?.[0]?.id;return he(v)||await t.put("lastItem",v),f.map(y=>y.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let s=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;he(s)?await t.delete("lastItem"):await t.put("lastItem",s);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:i}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:i});break}case 1:{s=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:i});break}}return xh(s.map(u=>u.data))}};function xh(e){return e.length<=5?e:e.slice(0,5)}a(xh,"getFirstFiveOrAll");var gr="login.microsoftonline.com",cl="login.microsoftonline.us",sl="Mail.ReadWrite Mail.Send Calendars.Read offline_access User.Read",Ph="https://graph.microsoft.com/.default",bh="https://graph.microsoft.us/.default",ul={[gr]:"https://graph.microsoft.com",[cl]:"https://graph.microsoft.us"},ll=E.StaticDropdown({displayName:"Cloud Environment",description:"Select your Microsoft cloud environment.",required:!0,defaultValue:gr,options:{disabled:!1,options:[{label:"Commercial (Global)",value:gr},{label:"US Government (GCC High)",value:cl}]}}),pl=E.StaticDropdown({displayName:"Access Mode",description:"Pick the option matching your Grant Type. Use a Delegated option with the Authorization Code grant (acts as the signed-in user). Use an App-only option with the Client Credentials grant (acts as the application \u2014 also set Tenant ID and Mailbox), choosing the one that matches your Cloud Environment.",required:!0,defaultValue:sl,options:{disabled:!1,options:[{label:"Delegated \u2014 Commercial (Global)",value:sl},{label:"App-only \u2014 Commercial (Global)",value:Ph},{label:"App-only \u2014 US Government (GCC High)",value:bh}]}});function dl(e){return e??gr}a(dl,"resolveCloudHost");function fl(e){return dl(e.props?.cloud)}a(fl,"getMicrosoftCloudFromAuth");function rn(e){let t=dl(e);return ul[t]??ul[gr]}a(rn,"getGraphBaseUrl");var wp=ze($p());function Bv(e){let t=fl(e);return wp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:rn(t)})}a(Bv,"createClient");function Vv(e){let t=e.props?.mailbox?.trim();return t?`/users/${encodeURIComponent(t)}`:"/me"}a(Vv,"mailboxPrefix");var $={createClient:Bv,mailboxPrefix:Vv};var Hv=`
|
|
7
|
+
This connection supports two access modes. Pick the matching **Grant Type** and **Access Mode** below.
|
|
8
|
+
|
|
9
|
+
**Delegated (Authorization Code)** \u2014 acts as the signed-in user. Keep **Access Mode** on the Delegated option, leave **Mailbox** blank, and keep **Tenant ID** as \`common\`. If you use your own Azure app, follow the [Azure app creation guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application), set the **Redirect URI** to {{redirectUrl}} and add these **Microsoft Graph (Delegated) permissions**:
|
|
10
|
+
- User.Read
|
|
11
|
+
- Mail.ReadWrite
|
|
12
|
+
- Mail.Send
|
|
13
|
+
- Calendars.Read
|
|
14
|
+
- offline_access
|
|
15
|
+
|
|
16
|
+
**App-only (Client Credentials)** \u2014 acts as the application, with no signed-in user. Choose the **Server-to-Server (Client Credentials)** authentication method when creating the connection. Then set **Access Mode** to the App-only option for your cloud, set **Tenant ID** to your Directory (tenant) ID, and set **Mailbox** to the target user's email/UPN or object ID. You must register your own Azure app (the shared app cannot grant app-only access to your tenant). Add these **Microsoft Graph (Application) permissions** and **grant admin consent**:
|
|
17
|
+
- Mail.ReadWrite
|
|
18
|
+
- Mail.Send
|
|
19
|
+
|
|
20
|
+
For app-only, Microsoft grants tenant-wide mailbox access by default \u2014 scope it to specific mailboxes with an [ApplicationAccessPolicy](https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access).
|
|
21
|
+
`,J=Bo.OAuth2({description:Hv,grantType:"both_client_credentials_and_authorization_code",props:{cloud:ll,accessMode:pl,tenant:E.ShortText({displayName:"Tenant ID",description:'Use "common" for the default delegated multi-tenant flow. For app-only (Client Credentials), set this to your Directory (tenant) ID.',required:!0,defaultValue:"common"}),mailbox:E.ShortText({displayName:"Mailbox (App-only)",description:"Email/UPN or user object ID of the mailbox to act on. Required for app-only (Client Credentials). Leave blank for delegated access (acts as the signed-in user).",required:!1})},authUrl:"https://{cloud}/{tenant}/oauth2/v2.0/authorize",tokenUrl:"https://{cloud}/{tenant}/oauth2/v2.0/token",required:!0,scope:["{accessMode}"],prompt:"omit",validate:a(async({auth:e})=>{try{let t=e;return await $.createClient(t).api(`${$.mailboxPrefix(t)}/mailFolders/inbox`).get(),{valid:!0}}catch(t){return{valid:!1,error:Zv(t)}}},"validate")});function Zv(e){if(typeof e=="object"&&e!==null){let t=[];if("statusCode"in e&&e.statusCode&&t.push(`HTTP ${String(e.statusCode)}`),"code"in e&&e.code&&t.push(String(e.code)),"message"in e&&e.message&&t.push(String(e.message)),"body"in e&&e.body){let r=e.body;t.push(typeof r=="string"?r.slice(0,800):JSON.stringify(r).slice(0,800))}if(t.length>0)return t.join(" | ")}return e instanceof Error&&e.message?e.message:"Unknown error while validating the connection."}a(Zv,"describeGraphError");var ot=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"messageIdDropdown"),Op=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders/drafts/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(s=>({label:`${s.subject||"No Subject"}`,value:s.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),"draftMessageIdDropdown"),it=a(e=>E.Dropdown({auth:J,displayName:e.displayName,description:e.description,required:e.required,refreshers:[],options:a(async({auth:t})=>{if(!t)return{placeholder:"Please connect your account first.",disabled:!0,options:[]};let r=t,n=$.createClient(r);try{return{disabled:!1,options:(await n.api(`${$.mailboxPrefix(r)}/mailFolders`).get()).value.map(s=>({label:s.displayName||s.id||"Unknown",value:s.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),"mailFolderIdDropdown");var zp=ne({auth:J,name:"addLabelToEmail",displayName:"Add Label to Email",description:"Adds a category (label) to an email message.",audience:"both",aiMetadata:{description:"Adds one or more Outlook categories (labels) to a specific message, merging them with any categories already present. Use this to tag or classify an email. Idempotent: re-adding the same categories leaves the message unchanged since duplicates are de-duplicated.",idempotent:!0},props:{messageId:ot({displayName:"Email",description:"Select the email message to add the label to.",required:!0}),categories:E.Array({displayName:"Categories",description:"Categories to add to the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),i=(await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[],s=[...new Set([...i,...r])];return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var Rp=ne({auth:J,name:"createDraftEmail",displayName:"Create Draft Email",description:"Creates a draft email message.",audience:"both",aiMetadata:{description:"Creates a new unsent draft email in the Outlook mailbox with recipients, subject, body, and optional attachments. Use this to stage a message for later review or sending (pair with Send Draft Email). Not idempotent: each call creates a separate draft.",idempotent:!1},props:{recipients:E.Array({displayName:"To Email(s)",required:!0}),ccRecipients:E.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:E.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:E.ShortText({displayName:"Subject",required:!0}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:E.LongText({displayName:"Body",required:!0}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(v=>({emailAddress:{address:v}})),ccRecipients:r.map(v=>({emailAddress:{address:v}})),bccRecipients:n.map(v=>({emailAddress:{address:v}})),attachments:o.map(v=>({"@odata.type":"#microsoft.graph.fileAttachment",name:v.fileName||v.file.filename,contentBytes:v.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages`).post(p)}});var kp=ne({auth:J,name:"downloadAttachment",displayName:"Download Attachment",description:"Download attachments from a specific email message.",audience:"both",aiMetadata:{description:"Fetches all file attachments from a specific Outlook message (by message ID) and writes them to storage for downstream steps. Use this after locating a message to retrieve its attached files. Requires a valid message ID; idempotent since it only reads.",idempotent:!0},props:{messageId:E.ShortText({displayName:"Message ID",description:"The ID of the email message containing the attachment.",required:!0})},async run(e){let{messageId:t}=e.propsValue,n=await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/attachments`).get(),o=[];for(let i of n.value)i.name&&i.contentBytes&&o.push({...i,file:await e.files.write({fileName:i.name||"test.png",data:Buffer.from(i.contentBytes,"base64")})});return o}});var ji=ze(br());var Dp=ne({auth:J,name:"findEmail",displayName:"Find Email",description:"Searches for emails using full-text search.",audience:"both",aiMetadata:{description:"Searches the Outlook mailbox for messages matching a full-text query (supports field syntax like from:, subject:, hasAttachments:), optionally scoped to one folder and capped by a max-results count. Use this to locate emails and obtain their message IDs for follow-up actions. Idempotent read-only lookup.",idempotent:!0},props:{searchQuery:E.ShortText({displayName:"Search Query",description:'Search terms to find emails (e.g., "from:john@example.com", "subject:urgent", "hasAttachments:true")',required:!0}),folderId:it({displayName:"Folder",description:"Search in a specific folder. Leave empty to search all folders.",required:!1}),top:E.Number({displayName:"Max Results",description:"Maximum number of results to return (1-1000).",required:!1,defaultValue:25})},async run(e){let{searchQuery:t,folderId:r,top:n}=e.propsValue,o=$.createClient(e.auth),i=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=`$search="${t}"`,u=n?`$top=${Math.min(Math.max(n,1),1e3)}`:"$top=25",p=["id","subject","from","toRecipients","receivedDateTime"].join(","),d=[s,u,p].filter(Boolean).join("&"),f=`${i}?${d}`,v={ConsistencyLevel:"eventual",Prefer:'outlook.body-content-type="text"'},y=await o.api(f).headers(v).get(),l=y.value,m=y["@odata.nextLink"];return t&&l.sort((_,h)=>(0,ji.default)(h.receivedDateTime).valueOf()-(0,ji.default)(_.receivedDateTime).valueOf()),{found:l.length>0,result:l,hasMore:!!m,nextPageUrl:m,totalCount:l.length}}});var Cp=ne({auth:J,name:"forwardEmail",displayName:"Forward Email",description:"Forwards an email message.",audience:"both",aiMetadata:{description:"Forwards an existing Outlook message (by message ID) to new recipients, preserving the original body and attachments and prepending an optional comment. Use this to pass an existing email along rather than composing a new one. Not idempotent: each call sends a new forwarded email.",idempotent:!1},props:{messageId:ot({displayName:"Email",description:"Select the email message to forward.",required:!0}),recipients:E.Array({displayName:"To Email(s)",required:!0}),comment:E.LongText({displayName:"Comment",description:"Optional comment to include with the forwarded message.",required:!1})},async run(e){let{messageId:t,comment:r}=e.propsValue,n=e.propsValue.recipients,o=$.createClient(e.auth),i=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get(),s={toRecipients:n.map(p=>({emailAddress:{address:p}})),body:{contentType:"html",content:(r??"")+"<br><br>"+i.body.content},attachments:i.attachments},u=await o.api(`${$.mailboxPrefix(e.auth)}/messages/${t}/forward`).post({message:s});return{success:!0,message:"Email forwarded successfully.",messageId:u.id,...u}}});var Np=ne({auth:J,name:"moveEmailToFolder",displayName:"Move Email to Folder",description:"Moves an email message to a specific folder.",audience:"both",aiMetadata:{description:"Moves a specific Outlook message into a chosen mail folder. Use this to organize, archive, or route an email after processing it. Note: the move assigns a new message ID, so re-running with the original ID will fail once moved.",idempotent:!1},props:{messageId:ot({displayName:"Email",description:"Select the email message to move.",required:!0}),destinationFolderId:it({displayName:"Destination Folder",description:"The folder to move the email to.",required:!0})},async run(e){let{messageId:t,destinationFolderId:r}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/move`).post({destinationId:r})}});var Mp=ne({auth:J,name:"removeLabelFromEmail",displayName:"Remove Label from Email",description:"Removes a category (label) from an email message.",audience:"both",aiMetadata:{description:"Removes one or more Outlook categories (labels) from a specific message, leaving any other categories intact. Use this to untag or reclassify an email. Idempotent: re-running with the same categories yields the same final label set.",idempotent:!0},props:{messageId:ot({displayName:"Email",description:"Select the email message to remove the label from.",required:!0}),categories:E.Array({displayName:"Categories to Remove",description:"Categories to remove from the email.",required:!0})},async run(e){let{messageId:t,categories:r}=e.propsValue,n=$.createClient(e.auth),s=((await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).get()).categories||[]).filter(p=>!r.includes(p));return await n.api(`${$.mailboxPrefix(e.auth)}/messages/${t}`).patch({categories:s})}});var Up=ne({auth:J,name:"reply-email",displayName:"Reply to Email",description:"Reply to an outlook email.",audience:"both",aiMetadata:{description:"Replies to an existing Outlook message (identified by message ID), supporting added CC/BCC recipients and attachments. Set the Create Draft flag to stage the reply without sending; otherwise it is sent immediately. Not idempotent when sending: each call creates and dispatches a new reply.",idempotent:!1},props:{messageId:E.Dropdown({auth:J,displayName:"Email",description:"Select the email message to reply to.",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};let t=$.createClient(e);try{return{disabled:!1,options:(await t.api(`${$.mailboxPrefix(e)}/messages?$top=50&$select=id,subject,from,receivedDateTime`).orderby("receivedDateTime desc").get()).value.map(o=>({label:`${o.subject||"No Subject"} - ${o.from?.emailAddress?.name||o.from?.emailAddress?.address||"Unknown Sender"}`,value:o.id||""}))}}catch{return{disabled:!0,options:[]}}},"options")}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),replyBody:E.LongText({displayName:"Reply Body",required:!0}),ccRecipients:E.Array({displayName:"CC Recipients",required:!1}),bccRecipients:E.Array({displayName:"BCC Recipients",required:!1}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}}),draft:E.Checkbox({displayName:"Create Draft",description:"If enabled, creates draft without sending.",required:!0,defaultValue:!1})},async run(e){let{replyBody:t,bodyFormat:r,messageId:n,draft:o}=e.propsValue,i=e.propsValue.ccRecipients,s=e.propsValue.bccRecipients,u=e.propsValue.attachments,p={body:{content:t,contentType:r},ccRecipients:i.map(f=>({emailAddress:{address:f}})),bccRecipients:s.map(f=>({emailAddress:{address:f}})),attachments:u.map(f=>({"@odata.type":"#microsoft.graph.fileAttachment",name:f.fileName||f.file.filename,contentBytes:f.file.base64}))},d=$.createClient(e.auth);try{let v=(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${n}/createReply`).post({message:p})).id;return o?{success:!0,message:"Draft created successfully.",draftId:v,draftLink:`https://outlook.office.com/mail/drafts/id/${v}`}:(await d.api(`${$.mailboxPrefix(e.auth)}/messages/${v}/send`).post({}),{success:!0,message:"Reply sent successfully.",draftId:v})}catch(f){console.error("Reply Email Error:",f);let v=f instanceof Error?f.message:"Unknown error";throw new Error(v)}}});var Lp=ne({auth:J,name:"sendDraftEmail",displayName:"Send Draft Email",description:"Sends a draft email message.",audience:"both",aiMetadata:{description:"Sends an existing draft email (identified by draft message ID) from the Outlook mailbox. Use this to dispatch a draft previously staged by Create Draft Email or a draft reply. Not idempotent: once sent the draft no longer exists, so re-running with the same ID will fail.",idempotent:!1},props:{messageId:Op({displayName:"Draft Email",description:"Select the draft email message to send.",required:!0})},async run(e){let{messageId:t}=e.propsValue;return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/messages/${t}/send`).post({}),{success:!0,message:"Draft sent successfully.",messageId:t}}});var jp=ne({auth:J,name:"send-email",displayName:"Send Email",description:"Sends an email using Microsoft Outlook.",audience:"both",aiMetadata:{description:"Composes and sends a new email from the authenticated Outlook mailbox to the given recipients, with optional CC/BCC and file attachments. Use this to send a fresh message (not a reply or forward). Not idempotent: each call dispatches a new email and saves a copy to Sent Items.",idempotent:!1},props:{recipients:E.Array({displayName:"To Email(s)",required:!0}),ccRecipients:E.Array({displayName:"CC Email(s)",required:!1,defaultValue:[]}),bccRecipients:E.Array({displayName:"BCC Email(s)",required:!1,defaultValue:[]}),subject:E.ShortText({displayName:"Subject",required:!0}),bodyFormat:E.StaticDropdown({displayName:"Body Format",required:!0,defaultValue:"text",options:{disabled:!1,options:[{label:"HTML",value:"html"},{label:"Text",value:"text"}]}}),body:E.LongText({displayName:"Body",required:!0}),attachments:E.Array({displayName:"Attachments",required:!1,defaultValue:[],properties:{file:E.File({displayName:"File",required:!0}),fileName:E.ShortText({displayName:"File Name",required:!1})}})},async run(e){let t=e.propsValue.recipients,r=e.propsValue.ccRecipients,n=e.propsValue.bccRecipients,o=e.propsValue.attachments,{subject:i,body:s,bodyFormat:u}=e.propsValue,p={subject:i,body:{content:s,contentType:u},toRecipients:t.map(v=>({emailAddress:{address:v}})),ccRecipients:r.map(v=>({emailAddress:{address:v}})),bccRecipients:n.map(v=>({emailAddress:{address:v}})),attachments:o.map(v=>({"@odata.type":"#microsoft.graph.fileAttachment",name:v.fileName||v.file.filename,contentBytes:v.file.base64}))};return await $.createClient(e.auth).api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:p,saveToSentItems:"true"})}});var ro=ze(br());async function Fp(e,t,r,n,o,i){let s=[];for(let u of r){if(i&&u.sender?.emailAddress?.address&&!u.sender.emailAddress.address.toLowerCase().includes(i.toLowerCase()))continue;let p=await e.api(`${t}/messages/${u.id}/attachments`).get();for(let d of p.value){let{contentBytes:f,...v}=d;if(!(o&&d.name&&!d.name.toLowerCase().includes(o.toLowerCase()))&&d.name&&f){let y=await n.write({fileName:d.name,data:Buffer.from(f,"base64")});s.push({file:y,messageId:u.id,messageSubject:u.subject,messageSender:u.sender,messageReceivedDateTime:u.receivedDateTime,parentFolderId:u.parentFolderId,...v})}}}return s}a(Fp,"enrichAttachments");var Bp=St({auth:J,name:"newAttachment",displayName:"New Attachment",description:"Triggers when a new email containing one or more attachments arrives.",aiMetadata:{description:"Fires once per attachment when a new email carrying one or more file attachments arrives, optionally scoped to a folder, sender, or attachment-name filter. Each fire represents a single attachment from a newly received message."},props:{folderId:it({displayName:"Folder",description:"Monitor attachments in a specific folder. Leave empty to monitor all folders.",required:!1}),sender:E.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),attachmentNameFilter:E.ShortText({displayName:"Attachment Name Filter",description:"Filter attachments by name (contains). Leave empty to include all attachments.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await e.store.put("lastPoll",Date.now())},async onDisable(e){},async test(e){let{folderId:t,attachmentNameFilter:r,sender:n}=e.propsValue,o=$.createClient(e.auth),i=t?`${$.mailboxPrefix(e.auth)}/mailFolders/${t}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,s=await o.api(`${i}?$filter=hasAttachments eq true`).top(10).get();return(await Fp(o,$.mailboxPrefix(e.auth),s.value,e.files,r,n)).map(d=>({epochMilliSeconds:(0,ro.default)(d.messageReceivedDateTime).valueOf(),data:d})).map(d=>d.data)},async run(e){let t=await e.store.get("lastPoll");if(he(t))throw new Error("lastPoll doesn't exist in the store.");let{folderId:r,attachmentNameFilter:n,sender:o}=e.propsValue,i=$.createClient(e.auth),s=r?`${$.mailboxPrefix(e.auth)}/mailFolders/${r}/messages`:`${$.mailboxPrefix(e.auth)}/messages`,u=await i.api(`${s}?$filter=receivedDateTime gt ${(0,ro.default)(t).toISOString()} and hasAttachments eq true`).orderby("receivedDateTime desc").get(),p=[];for(;u.value.length>0&&(p.push(...u.value),u["@odata.nextLink"]);)u=await i.api(u["@odata.nextLink"]).get();let f=(await Fp(i,$.mailboxPrefix(e.auth),p,e.files,n,o)).map(y=>({epochMilliSeconds:(0,ro.default)(y.messageReceivedDateTime).valueOf(),data:y})),v=f.reduce((y,l)=>Math.max(y,l.epochMilliSeconds),t);return await e.store.put("lastPoll",v),f.filter(y=>y.epochMilliSeconds>t).map(y=>y.data)}});var Fi=ze(br());var no={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=r.folderId,s=t===0?"$top=10":`$filter=createdDateTime gt ${(0,Fi.default)(t).toISOString()}`,u=await n.api(`${$.mailboxPrefix(e)}/mailFolders/${i}/messages?${s}`).orderby("createdDateTime desc").get();if(t===0)for(let p of u.value)o.push(p);else for(;u.value.length>0;){for(let p of u.value)o.push(p);if(u["@odata.nextLink"])u=await n.api(u["@odata.nextLink"]).get();else break}return o.map(p=>({epochMilliSeconds:(0,Fi.default)(p.createdDateTime).valueOf(),data:p}))},"items")},Vp=St({auth:J,name:"newEmailInFolder",displayName:"New Email in Folder",description:"Triggers when a new email is delivered into the specified folder.",aiMetadata:{description:"Fires when a new message appears in the chosen Outlook mail folder. Each fire represents one new email added to that folder."},props:{folderId:it({displayName:"Folder",description:"",required:!0})},sampleData:{},type:"POLLING",async onEnable(e){await Ue.onEnable(no,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Ue.onDisable(no,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Ue.test(no,e)},async run(e){return await Ue.poll(no,e)}});var Bi=ze(br());var oo={strategy:0,items:a(async({auth:e,lastFetchEpochMS:t,propsValue:r})=>{let n=$.createClient(e),o=[],i=t===0?"$top=10":`$filter=receivedDateTime gt ${(0,Bi.default)(t).toISOString()}`,s=await n.api(`${$.mailboxPrefix(e)}/mailFolders/inbox/messages?${i}`).orderby("receivedDateTime desc").get();if(t===0)for(let p of s.value)o.push(p);else for(;s.value.length>0;){for(let p of s.value)o.push(p);if(s["@odata.nextLink"])s=await n.api(s["@odata.nextLink"]).get();else break}let u=o;return r?.sender&&(u=u.filter(p=>{let d=p.from?.emailAddress?.address?.toLowerCase(),f=r.sender?.toLowerCase();return d===f})),r?.recipient&&(u=u.filter(p=>p.toRecipients?.some(f=>{let v=f.emailAddress?.address?.toLowerCase(),y=r.recipient?.toLowerCase();return v===y}))),u.map(p=>({epochMilliSeconds:(0,Bi.default)(p.receivedDateTime).valueOf(),data:p}))},"items")},Hp=St({auth:J,name:"newEmail",displayName:"New Email",description:"Triggers when a new email is received in the inbox.",aiMetadata:{description:"Fires when a new message arrives in the mailbox Inbox, optionally narrowed to a specific sender and/or recipient address. Each fire represents one newly received email."},props:{sender:E.ShortText({displayName:"From (Sender Email)",description:"Filter emails from a specific sender (optional). Leave empty to for all senders.",required:!1}),recipient:E.ShortText({displayName:"To (Recipient Email)",description:"Filter emails to a specific recipient (optional). Leave empty to for all recipients.",required:!1})},sampleData:{},type:"POLLING",async onEnable(e){await Ue.onEnable(oo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Ue.onDisable(oo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Ue.test(oo,e)},async run(e){return await Ue.poll(oo,e)}});var Zp=ne({auth:J,name:"request_approval_in_mail",displayName:"Request Approval in Email",description:"Send approval request email and then wait until the email is approved or disapproved",audience:"both",aiMetadata:{description:"Sends an email with a single link to a confirmation page where the recipient chooses Approve or Disapprove, then pauses the flow until they respond, resuming with the decision. Use this as a human-in-the-loop approval gate before proceeding. Not idempotent: each call sends a new email and creates a new pending waitpoint.",idempotent:!1},props:{recipients:E.ShortText({displayName:"To Email Address",description:"The email address of the recipient who will receive the approval request.",required:!0}),subject:E.ShortText({displayName:"Subject",description:"The subject of the approval request email.",required:!0}),body:E.LongText({displayName:"Body",description:"The main content of the email. You can include details about the approval request here in the html format or plain text.",required:!0})},async run(e){if(e.executionType==="BEGIN")try{let t=e.auth.access_token,r=e.propsValue.recipients,{subject:n,body:o}=e.propsValue;He(t,"token"),He(r,"recipients"),He(n,"subject"),He(o,"body");let i=await e.run.createWaitpoint({type:"WEBHOOK"}),s=`${i.resumeUrl}/confirm`,u=`
|
|
22
|
+
<div>
|
|
23
|
+
<p>${o}</p>
|
|
24
|
+
<br />
|
|
25
|
+
<p>
|
|
26
|
+
<a href="${s}" style="display: inline-block; padding: 10px 20px; background-color: #6e41e2; color: white; text-decoration: none; border-radius: 4px;">Review & Respond</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
`,p=$.createClient(e.auth),d={subject:n,body:{content:u,contentType:"html"},toRecipients:[{emailAddress:{address:r}}]},f=await p.api(`${$.mailboxPrefix(e.auth)}/sendMail`).post({message:d,saveToSentItems:!0});return e.run.waitForWaitpoint(i.id),{approved:!1}}catch(t){throw console.error("[RequestApprovalEmail] Error during BEGIN execution:",t),t}else return{approved:e.resumePayload.queryParams.action==="approve"}}});var Gv=Zs({displayName:"Microsoft Outlook",auth:J,minimumSupportedRelease:"0.87.0",logoUrl:"https://cdn.activepieces.com/pieces/microsoft-outlook.png",categories:["PRODUCTIVITY"],authors:["lucaslimasouza","kishanprmr","sanket-a11y"],actions:[jp,kp,Up,Rp,zp,Mp,Zp,Np,Lp,Cp,Dp,al({auth:J,baseUrl:a(e=>{let t=e.props?.cloud;return rn(t)+"/v1.0/"},"baseUrl"),authMapping:a(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[Hp,Vp,Bp]});0&&(module.exports={microsoftOutlook});
|
|
30
|
+
/*! Bundled license information:
|
|
31
|
+
|
|
32
|
+
mime-types/index.js:
|
|
33
|
+
(*!
|
|
34
|
+
* mime-types
|
|
35
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
36
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
37
|
+
* MIT Licensed
|
|
38
|
+
*)
|
|
39
|
+
*/
|