@activepieces/piece-microsoft-sharepoint 0.3.3 → 0.3.5
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 +26 -81
- 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/copy-item-within-site.d.ts +0 -9
- package/src/lib/actions/copy-item-within-site.d.ts.map +0 -1
- package/src/lib/actions/copy-item-within-site.js +0 -161
- package/src/lib/actions/copy-item-within-site.js.map +0 -1
- package/src/lib/actions/copy-item.d.ts +0 -11
- package/src/lib/actions/copy-item.d.ts.map +0 -1
- package/src/lib/actions/copy-item.js +0 -121
- package/src/lib/actions/copy-item.js.map +0 -1
- package/src/lib/actions/create-folder.d.ts +0 -7
- package/src/lib/actions/create-folder.d.ts.map +0 -1
- package/src/lib/actions/create-folder.js +0 -48
- package/src/lib/actions/create-folder.js.map +0 -1
- package/src/lib/actions/create-list-item.d.ts +0 -6
- package/src/lib/actions/create-list-item.d.ts.map +0 -1
- package/src/lib/actions/create-list-item.js +0 -47
- package/src/lib/actions/create-list-item.js.map +0 -1
- package/src/lib/actions/create-list.d.ts +0 -6
- package/src/lib/actions/create-list.d.ts.map +0 -1
- package/src/lib/actions/create-list.js +0 -45
- package/src/lib/actions/create-list.js.map +0 -1
- package/src/lib/actions/delete-list-item.d.ts +0 -6
- package/src/lib/actions/delete-list-item.d.ts.map +0 -1
- package/src/lib/actions/delete-list-item.js +0 -37
- package/src/lib/actions/delete-list-item.js.map +0 -1
- package/src/lib/actions/find-file.d.ts +0 -9
- package/src/lib/actions/find-file.d.ts.map +0 -1
- package/src/lib/actions/find-file.js +0 -140
- package/src/lib/actions/find-file.js.map +0 -1
- package/src/lib/actions/find-site.d.ts +0 -4
- package/src/lib/actions/find-site.d.ts.map +0 -1
- package/src/lib/actions/find-site.js +0 -56
- package/src/lib/actions/find-site.js.map +0 -1
- package/src/lib/actions/get-folder-contents.d.ts +0 -10
- package/src/lib/actions/get-folder-contents.d.ts.map +0 -1
- package/src/lib/actions/get-folder-contents.js +0 -115
- package/src/lib/actions/get-folder-contents.js.map +0 -1
- package/src/lib/actions/get-site-information.d.ts +0 -5
- package/src/lib/actions/get-site-information.d.ts.map +0 -1
- package/src/lib/actions/get-site-information.js +0 -42
- package/src/lib/actions/get-site-information.js.map +0 -1
- package/src/lib/actions/move-file.d.ts +0 -8
- package/src/lib/actions/move-file.d.ts.map +0 -1
- package/src/lib/actions/move-file.js +0 -161
- package/src/lib/actions/move-file.js.map +0 -1
- package/src/lib/actions/publish-page.d.ts +0 -5
- package/src/lib/actions/publish-page.d.ts.map +0 -1
- package/src/lib/actions/publish-page.js +0 -56
- package/src/lib/actions/publish-page.js.map +0 -1
- package/src/lib/actions/search-list-item.d.ts +0 -6
- package/src/lib/actions/search-list-item.d.ts.map +0 -1
- package/src/lib/actions/search-list-item.js +0 -44
- package/src/lib/actions/search-list-item.js.map +0 -1
- package/src/lib/actions/update-list-item.d.ts +0 -7
- package/src/lib/actions/update-list-item.d.ts.map +0 -1
- package/src/lib/actions/update-list-item.js +0 -46
- package/src/lib/actions/update-list-item.js.map +0 -1
- package/src/lib/actions/upload-file.d.ts +0 -8
- package/src/lib/actions/upload-file.d.ts.map +0 -1
- package/src/lib/actions/upload-file.js +0 -52
- package/src/lib/actions/upload-file.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -37
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -15
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -416
- package/src/lib/common/index.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/triggers/new-file-in-folder.d.ts +0 -19
- package/src/lib/triggers/new-file-in-folder.d.ts.map +0 -1
- package/src/lib/triggers/new-file-in-folder.js +0 -167
- package/src/lib/triggers/new-file-in-folder.js.map +0 -1
- package/src/lib/triggers/new-file-in-subfolders.d.ts +0 -19
- package/src/lib/triggers/new-file-in-subfolders.d.ts.map +0 -1
- package/src/lib/triggers/new-file-in-subfolders.js +0 -163
- package/src/lib/triggers/new-file-in-subfolders.js.map +0 -1
- package/src/lib/triggers/new-list-item.d.ts +0 -15
- package/src/lib/triggers/new-list-item.d.ts.map +0 -1
- package/src/lib/triggers/new-list-item.js +0 -99
- package/src/lib/triggers/new-list-item.js.map +0 -1
- package/src/lib/triggers/new-list.d.ts +0 -11
- package/src/lib/triggers/new-list.d.ts.map +0 -1
- package/src/lib/triggers/new-list.js +0 -93
- package/src/lib/triggers/new-list.js.map +0 -1
- package/src/lib/triggers/new-or-updated-file.d.ts +0 -19
- package/src/lib/triggers/new-or-updated-file.d.ts.map +0 -1
- package/src/lib/triggers/new-or-updated-file.js +0 -159
- package/src/lib/triggers/new-or-updated-file.js.map +0 -1
- package/src/lib/triggers/new-or-updated-folder.d.ts +0 -19
- package/src/lib/triggers/new-or-updated-folder.d.ts.map +0 -1
- package/src/lib/triggers/new-or-updated-folder.js +0 -159
- package/src/lib/triggers/new-or-updated-folder.js.map +0 -1
- package/src/lib/triggers/new-or-updated-list.d.ts +0 -11
- package/src/lib/triggers/new-or-updated-list.d.ts.map +0 -1
- package/src/lib/triggers/new-or-updated-list.js +0 -107
- package/src/lib/triggers/new-or-updated-list.js.map +0 -1
- package/src/lib/triggers/updated-list-item.d.ts +0 -15
- package/src/lib/triggers/updated-list-item.d.ts.map +0 -1
- package/src/lib/triggers/updated-list-item.js +0 -117
- package/src/lib/triggers/updated-list-item.js.map +0 -1
package/src/index.js
CHANGED
|
@@ -1,81 +1,26 @@
|
|
|
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
|
-
const copy_item_1 = require("./lib/actions/copy-item");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const new_list_1 = require("./lib/triggers/new-list");
|
|
28
|
-
const new_list_item_1 = require("./lib/triggers/new-list-item");
|
|
29
|
-
const new_or_updated_file_1 = require("./lib/triggers/new-or-updated-file");
|
|
30
|
-
const new_or_updated_folder_1 = require("./lib/triggers/new-or-updated-folder");
|
|
31
|
-
const new_or_updated_list_1 = require("./lib/triggers/new-or-updated-list");
|
|
32
|
-
const updated_list_item_1 = require("./lib/triggers/updated-list-item");
|
|
33
|
-
exports.microsoftSharePoint = (0, pieces_framework_1.createPiece)({
|
|
34
|
-
displayName: 'Microsoft SharePoint',
|
|
35
|
-
auth: auth_1.microsoftSharePointAuth,
|
|
36
|
-
minimumSupportedRelease: '0.78.0',
|
|
37
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/microsoft-sharepoint.png',
|
|
38
|
-
categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
39
|
-
authors: ['kishanprmr', 'pranith124', 'onyedikachi-david'],
|
|
40
|
-
actions: [
|
|
41
|
-
create_folder_1.createFolderAction,
|
|
42
|
-
create_list_1.createListAction,
|
|
43
|
-
create_list_item_1.createListItemAction,
|
|
44
|
-
update_list_item_1.updateListItemAction,
|
|
45
|
-
delete_list_item_1.deleteListItemAction,
|
|
46
|
-
search_list_item_1.findListItemAction,
|
|
47
|
-
upload_file_1.uploadFile,
|
|
48
|
-
publish_page_1.publishPageAction,
|
|
49
|
-
copy_item_1.copyItemAction,
|
|
50
|
-
copy_item_within_site_1.copyItemWithinSiteAction,
|
|
51
|
-
move_file_1.moveFileAction,
|
|
52
|
-
find_file_1.findFileAction,
|
|
53
|
-
get_folder_contents_1.getFolderContentsAction,
|
|
54
|
-
get_site_information_1.getSiteInformationAction,
|
|
55
|
-
find_site_1.findSiteAction,
|
|
56
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
57
|
-
auth: auth_1.microsoftSharePointAuth,
|
|
58
|
-
baseUrl: (auth) => {
|
|
59
|
-
var _a;
|
|
60
|
-
const cloud = (_a = auth.props) === null || _a === void 0 ? void 0 : _a['cloud'];
|
|
61
|
-
return (0, microsoft_cloud_1.getGraphBaseUrl)(cloud) + '/v1.0';
|
|
62
|
-
},
|
|
63
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
return ({
|
|
65
|
-
Authorization: `Bearer ${auth.access_token}`,
|
|
66
|
-
});
|
|
67
|
-
}),
|
|
68
|
-
}),
|
|
69
|
-
],
|
|
70
|
-
triggers: [
|
|
71
|
-
new_file_in_folder_1.newFileInFolderTrigger,
|
|
72
|
-
new_file_in_subfolders_1.newFileInSubfoldersTrigger,
|
|
73
|
-
new_or_updated_file_1.newOrUpdatedFileTrigger,
|
|
74
|
-
new_or_updated_folder_1.newOrUpdatedFolderTrigger,
|
|
75
|
-
new_list_item_1.newListItemTrigger,
|
|
76
|
-
updated_list_item_1.updatedListItemTrigger,
|
|
77
|
-
new_list_1.newListTrigger,
|
|
78
|
-
new_or_updated_list_1.newOrUpdatedListTrigger,
|
|
79
|
-
],
|
|
80
|
-
});
|
|
81
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var Ad=Object.create;var qt=Object.defineProperty;var wd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var Od=Object.getPrototypeOf,zd=Object.prototype.hasOwnProperty;var a=(e,t)=>qt(e,"name",{value:t,configurable:!0});var Rd=(e,t)=>()=>(e&&(t=e(e=0)),t);var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Po=(e,t)=>{for(var r in t)qt(e,r,{get:t[r],enumerable:!0})},na=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $d(t))!zd.call(e,o)&&o!==r&&qt(e,o,{get:()=>t[o],enumerable:!(n=wd(t,o))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?Ad(Od(e)):{},na(t||!e||!e.__esModule?qt(r,"default",{value:e,enumerable:!0}):r,e)),ue=e=>na(qt({},"__esModule",{value:!0}),e);var Ps=b((_s,Kr)=>{(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 c(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let _=0,g=-1,P=(p.match(u.zoneIndex)||[])[0],I,Z;for(P&&(P=P.substring(1),p=p.replace(/%.+$/,""));(g=p.indexOf(":",g+1))>=0;)_++;if(p.substr(0,2)==="::"&&_--,p.substr(-2,2)==="::"&&_--,_>m)return null;for(Z=m-_,I=":";Z--;)I+="0:";return p=p.replace("::",I),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=function(){let ge=p.split(":"),Ee=[];for(let Le=0;Le<ge.length;Le++)Ee.push(parseInt(ge[Le],16));return Ee}(),{parts:m,zoneId:P}}a(c,"expandIPv6");function d(p,m,_,g){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let P=0,I;for(;g>0;){if(I=_-g,I<0&&(I=0),p[P]>>I!==m[P]>>I)return!1;g-=_,P+=1}return!0}a(d,"matchCIDR");function f(p){if(o.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}a(f,"parseIntAuto");function v(p,m){for(;p.length<m;)p=`0${p}`;return p}a(v,"padPart");let y={};y.IPv4=function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,g;for(_=0;_<m.length;_++)if(g=m[_],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return a(p,"IPv4"),p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]],as112:[[new p([192,175,48,0]),24],[new p([192,31,196,0]),24]],amt:[[new p([192,52,193,0]),24]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,_){let g;if(_===void 0&&(g=m,m=g[0],_=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,m.octets,8,_)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},P,I,Z;for(P=3;P>=0;P-=1)if(I=this.octets[P],I in g){if(Z=g[I],_&&Z!==0)return null;Z!==8&&(_=!0),m+=Z}else return null;return 32-m},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),y.IPv4.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),_=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),P=[],I=0;for(;I<4;)P.push(parseInt(_[I],10)|parseInt(g[I],10)^255),I++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(p){return this.parser(p)!==null},y.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(p){try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(p){return!!(y.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(p){let m=p.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(p)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(p){let m,_,g,P,I;try{for(m=this.parseCIDR(p),g=m[0].toByteArray(),I=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),P=[],_=0;_<4;)P.push(parseInt(g[_],10)&parseInt(I[_],10)),_++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(p){let m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){let _=parseInt(m[2]);if(_>=0&&_<=32){let g=[this.parse(m[1]),_];return Object.defineProperty(g,"toString",{value:a(function(){return this.join("/")},"value")}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(p){let m,_,g;if(m=p.match(r.fourOctet))return function(){let P=m.slice(1,6),I=[];for(let Z=0;Z<P.length;Z++)_=P[Z],I.push(f(_));return I}();if(m=p.match(r.longValue)){if(g=f(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){let P=[],I;for(I=0;I<=24;I+=8)P.push(g>>I&255);return P}().reverse()}else return(m=p.match(r.twoOctet))?function(){let P=m.slice(1,4),I=[];if(g=f(P[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return I.push(f(P[0])),I.push(g>>16&255),I.push(g>>8&255),I.push(g&255),I}():(m=p.match(r.threeOctet))?function(){let P=m.slice(1,5),I=[];if(g=f(P[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return I.push(f(P[0])),I.push(f(P[1])),I.push(g>>8&255),I.push(g&255),I}():null},y.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],_=0,g=Math.floor(p/8);for(;_<g;)m[_]=255,_++;return g<4&&(m[g]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},y.IPv6=function(){function p(m,_){let g,P;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(P=this.parts[g],!(0<=P&&P<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");_&&(this.zoneId=_)}return a(p,"IPv6"),p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],discard:[new p([256,0,0,0,0,0,0,0]),64],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[[new p([8193,4,274,0,0,0,0,0]),48],[new p([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new p([8193,48,0,0,0,0,0,0]),28],reserved:[[new p([8193,0,0,0,0,0,0,0]),23],[new p([8193,3512,0,0,0,0,0,0]),32]]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,_){let g;if(_===void 0&&(g=m,m=g[0],_=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,m.parts,16,_)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,_=!1,g={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},P,I;for(let Z=7;Z>=0;Z-=1)if(P=this.parts[Z],P in g){if(I=g[P],_&&I!==0)return null;I!==16&&(_=!0),m+=I}else return null;return 128-m},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m,_=[],g=this.parts;for(let P=0;P<g.length;P++)m=g[P],_.push(m>>8),_.push(m&255);return _},p.prototype.toFixedLengthString=function(){let m=function(){let g=[];for(let P=0;P<this.parts.length;P++)g.push(v(this.parts[P].toString(16),4));return g}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},p.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],g=m[1];return new y.IPv4([_>>8,_&255,g>>8,g&255])},p.prototype.toNormalizedString=function(){let m=function(){let g=[];for(let P=0;P<this.parts.length;P++)g.push(this.parts[P].toString(16));return g}.call(this).join(":"),_="";return this.zoneId&&(_=`%${this.zoneId}`),m+_},p.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,_=this.toNormalizedString(),g=0,P=-1,I;for(;I=m.exec(_);)I[0].length>P&&(g=I.index,P=I[0].length);return P<0?_:`${_.substring(0,g)}::${_.substring(g+P)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),y.IPv6.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),_=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),P=[],I=0;for(;I<16;)P.push(parseInt(_[I],10)|parseInt(g[I],10)^255),I++;return new this(P)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},y.IPv6.isIPv6=function(p){return this.parser(p)!==null},y.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(p){let m,_,g,P,I;try{for(m=this.parseCIDR(p),g=m[0].toByteArray(),I=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),P=[],_=0;_<16;)P.push(parseInt(g[_],10)&parseInt(I[_],10)),_++;return new this(P)}catch(Z){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${Z})`)}},y.IPv6.parse=function(p){let m=this.parser(p);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(p){let m,_,g;if((_=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(_[2]),m>=0&&m<=128))return g=[this.parse(_[1]),m],Object.defineProperty(g,"toString",{value:a(function(){return this.join("/")},"value")}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(p){let m,_,g,P,I,Z;if(g=p.match(u.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(u.native.test(p))return c(p,8);if((g=p.match(u.transitional))&&(Z=g[6]||"",m=g[1],g[1].endsWith("::")||(m=m.slice(0,-1)),m=c(m+Z,6),m.parts)){for(I=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],_=0;_<I.length;_++)if(P=I[_],!(0<=P&&P<=255))return null;return m.parts.push(I[0]<<8|I[1]),m.parts.push(I[2]<<8|I[3]),{parts:m.parts,zoneId:m.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>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,g=Math.floor(p/8);for(;_<g;)m[_]=255,_++;return g<16&&(m[g]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},y.fromByteArray=function(p){let m=p.length;if(m===4)return new y.IPv4(p);if(m===16)return new y.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(p){return y.IPv6.isValid(p)||y.IPv4.isValid(p)},y.isValidCIDR=function(p){return y.IPv6.isValidCIDR(p)||y.IPv4.isValidCIDR(p)},y.parse=function(p){if(y.IPv6.isValid(p))return y.IPv6.parse(p);if(y.IPv4.isValid(p))return y.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(p){try{return y.IPv6.parseCIDR(p)}catch{try{return y.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(p){let m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},y.subnetMatch=function(p,m,_){let g,P,I,Z;_==null&&(_="unicast");for(P in m)if(Object.prototype.hasOwnProperty.call(m,P)){for(I=m[P],I[0]&&!(I[0]instanceof Array)&&(I=[I]),g=0;g<I.length;g++)if(Z=I[g],p.kind()===Z[0].kind()&&p.match.apply(p,Z))return P}return _},typeof Kr<"u"&&Kr.exports?Kr.exports=y:e.ipaddr=y})(_s)});var yu=b((oC,gu)=>{var hu=require("stream").Stream,uh=require("util");gu.exports=Me;function Me(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(Me,"DelayedStream");uh.inherits(Me,hu);Me.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(Me.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});Me.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Me.prototype.resume=function(){this._released||this.release(),this.source.resume()};Me.prototype.pause=function(){this.source.pause()};Me.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};Me.prototype.pipe=function(){var e=hu.prototype.pipe.apply(this,arguments);return this.resume(),e};Me.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)};Me.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 xu=b((aC,Pu)=>{var ch=require("util"),_u=require("stream").Stream,vu=yu();Pu.exports=he;function he(){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(he,"CombinedStream");ch.inherits(he,_u);he.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};he.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};he.prototype.append=function(e){var t=he.isStreamLike(e);if(t){if(!(e instanceof vu)){var r=vu.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};he.prototype.pipe=function(e,t){return _u.prototype.pipe.call(this,e,t),this.resume(),e};he.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}};he.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=he.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};he.prototype._pipeNext=function(e){this._currentStream=e;var t=he.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()};he.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};he.prototype.write=function(e){this.emit("data",e)};he.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};he.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")};he.prototype.end=function(){this._reset(),this.emit("end")};he.prototype.destroy=function(){this._reset(),this.emit("close")};he.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};he.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};he.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)};he.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Tu=b((uC,bu)=>{"use strict";bu.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 Su=b($e=>{"use strict";var tn=Tu(),lh=require("path").extname,Iu=/^\s*([^;\s]*)(?:;|\s|$)/,ph=/^text\//i;$e.charset=Eu;$e.charsets={lookup:Eu};$e.contentType=dh;$e.extension=fh;$e.extensions=Object.create(null);$e.lookup=mh;$e.types=Object.create(null);hh($e.extensions,$e.types);function Eu(e){if(!e||typeof e!="string")return!1;var t=Iu.exec(e),r=t&&tn[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ph.test(t[1])?"UTF-8":!1}a(Eu,"charset");function dh(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?$e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=$e.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(dh,"contentType");function fh(e){if(!e||typeof e!="string")return!1;var t=Iu.exec(e),r=t&&$e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(fh,"extension");function mh(e){if(!e||typeof e!="string")return!1;var t=lh("x."+e).toLowerCase().substr(1);return t&&$e.types[t]||!1}a(mh,"lookup");function hh(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(tn).forEach(a(function(o){var i=tn[o],s=i.extensions;if(!(!s||!s.length)){e[o]=s;for(var u=0;u<s.length;u++){var c=s[u];if(t[c]){var d=r.indexOf(tn[t[c]].source),f=r.indexOf(i.source);if(t[c]!=="application/octet-stream"&&(d>f||d===f&&t[c].substr(0,12)==="application/"))continue}t[c]=o}}},"forEachMimeType"))}a(hh,"populateMaps")});var wu=b((pC,Au)=>{Au.exports=gh;function gh(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(gh,"defer")});var si=b((fC,Ou)=>{var $u=wu();Ou.exports=yh;function yh(e){var t=!1;return $u(function(){t=!0}),a(function(n,o){t?e(n,o):$u(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(yh,"async")});var ui=b((hC,zu)=>{zu.exports=vh;function vh(e){Object.keys(e.jobs).forEach(_h.bind(e)),e.jobs={}}a(vh,"abort");function _h(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(_h,"clean")});var ci=b((yC,ku)=>{var Ru=si(),Ph=ui();ku.exports=xh;function xh(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=bh(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?Ph(r):r.results[o]=s,n(i,r.results))})}a(xh,"iterate");function bh(e,t,r,n){var o;return e.length==2?o=e(r,Ru(n)):o=e(r,t,Ru(n)),o}a(bh,"runJob")});var li=b((_C,Du)=>{Du.exports=Th;function Th(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(Th,"state")});var pi=b((xC,Cu)=>{var Ih=ui(),Eh=si();Cu.exports=Sh;function Sh(e){Object.keys(this.jobs).length&&(this.index=this.size,Ih(this),Eh(e)(null,this.results))}a(Sh,"terminator")});var Uu=b((TC,Nu)=>{var Ah=ci(),wh=li(),$h=pi();Nu.exports=Oh;function Oh(e,t,r){for(var n=wh(e);n.index<(n.keyedList||e).length;)Ah(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 $h.bind(n,r)}a(Oh,"parallel")});var di=b((EC,rn)=>{var Mu=ci(),zh=li(),Rh=pi();rn.exports=kh;rn.exports.ascending=Lu;rn.exports.descending=Dh;function kh(e,t,r,n){var o=zh(e,r);return Mu(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Mu(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),Rh.bind(o,n)}a(kh,"serialOrdered");function Lu(e,t){return e<t?-1:e>t?1:0}a(Lu,"ascending");function Dh(e,t){return-1*Lu(e,t)}a(Dh,"descending")});var Fu=b((AC,ju)=>{var Ch=di();ju.exports=Nh;function Nh(e,t,r){return Ch(e,t,null,r)}a(Nh,"serial")});var Bu=b(($C,Vu)=>{Vu.exports={parallel:Uu(),serial:Fu(),serialOrdered:di()}});var fi=b((OC,Hu)=>{"use strict";Hu.exports=Object});var qu=b((zC,Zu)=>{"use strict";Zu.exports=Error});var Wu=b((RC,Gu)=>{"use strict";Gu.exports=EvalError});var Ju=b((kC,Ku)=>{"use strict";Ku.exports=RangeError});var Yu=b((DC,Xu)=>{"use strict";Xu.exports=ReferenceError});var ec=b((CC,Qu)=>{"use strict";Qu.exports=SyntaxError});var nn=b((NC,tc)=>{"use strict";tc.exports=TypeError});var nc=b((UC,rc)=>{"use strict";rc.exports=URIError});var ic=b((MC,oc)=>{"use strict";oc.exports=Math.abs});var sc=b((LC,ac)=>{"use strict";ac.exports=Math.floor});var cc=b((jC,uc)=>{"use strict";uc.exports=Math.max});var pc=b((FC,lc)=>{"use strict";lc.exports=Math.min});var fc=b((VC,dc)=>{"use strict";dc.exports=Math.pow});var hc=b((BC,mc)=>{"use strict";mc.exports=Math.round});var yc=b((HC,gc)=>{"use strict";gc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var _c=b((qC,vc)=>{"use strict";var Uh=yc();vc.exports=a(function(t){return Uh(t)||t===0?t:t<0?-1:1},"sign")});var xc=b((WC,Pc)=>{"use strict";Pc.exports=Object.getOwnPropertyDescriptor});var mi=b((KC,bc)=>{"use strict";var on=xc();if(on)try{on([],"length")}catch{on=null}bc.exports=on});var Ic=b((JC,Tc)=>{"use strict";var an=Object.defineProperty||!1;if(an)try{an({},"a",{value:1})}catch{an=!1}Tc.exports=an});var hi=b((XC,Ec)=>{"use strict";Ec.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 wc=b((QC,Ac)=>{"use strict";var Sc=typeof Symbol<"u"&&Symbol,Mh=hi();Ac.exports=a(function(){return typeof Sc!="function"||typeof Symbol!="function"||typeof Sc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Mh()},"hasNativeSymbols")});var gi=b((tN,$c)=>{"use strict";$c.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var yi=b((rN,Oc)=>{"use strict";var Lh=fi();Oc.exports=Lh.getPrototypeOf||null});var kc=b((nN,Rc)=>{"use strict";var jh="Function.prototype.bind called on incompatible ",Fh=Object.prototype.toString,Vh=Math.max,Bh="[object Function]",zc=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"),Hh=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"),Zh=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");Rc.exports=a(function(t){var r=this;if(typeof r!="function"||Fh.apply(r)!==Bh)throw new TypeError(jh+r);for(var n=Hh(arguments,1),o,i=a(function(){if(this instanceof o){var f=r.apply(this,zc(n,arguments));return Object(f)===f?f:this}return r.apply(t,zc(n,arguments))},"binder"),s=Vh(0,r.length-n.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(o=Function("binder","return function ("+Zh(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 wt=b((iN,Dc)=>{"use strict";var qh=kc();Dc.exports=Function.prototype.bind||qh});var sn=b((aN,Cc)=>{"use strict";Cc.exports=Function.prototype.call});var vi=b((sN,Nc)=>{"use strict";Nc.exports=Function.prototype.apply});var Mc=b((uN,Uc)=>{"use strict";Uc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var jc=b((cN,Lc)=>{"use strict";var Gh=wt(),Wh=vi(),Kh=sn(),Jh=Mc();Lc.exports=Jh||Gh.call(Kh,Wh)});var Vc=b((lN,Fc)=>{"use strict";var Xh=wt(),Yh=nn(),Qh=sn(),eg=jc();Fc.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new Yh("a function is required");return eg(Xh,Qh,t)},"callBindBasic")});var Wc=b((dN,Gc)=>{"use strict";var tg=Vc(),Bc=mi(),Zc;try{Zc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var _i=!!Zc&&Bc&&Bc(Object.prototype,"__proto__"),qc=Object,Hc=qc.getPrototypeOf;Gc.exports=_i&&typeof _i.get=="function"?tg([_i.get]):typeof Hc=="function"?a(function(t){return Hc(t==null?t:qc(t))},"getDunder"):!1});var Qc=b((mN,Yc)=>{"use strict";var Kc=gi(),Jc=yi(),Xc=Wc();Yc.exports=Kc?a(function(t){return Kc(t)},"getProto"):Jc?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Jc(t)},"getProto"):Xc?a(function(t){return Xc(t)},"getProto"):null});var Pi=b((gN,el)=>{"use strict";var rg=Function.prototype.call,ng=Object.prototype.hasOwnProperty,og=wt();el.exports=og.call(rg,ng)});var sl=b((yN,al)=>{"use strict";var X,ig=fi(),ag=qu(),sg=Wu(),ug=Ju(),cg=Yu(),Rt=ec(),zt=nn(),lg=nc(),pg=ic(),dg=sc(),fg=cc(),mg=pc(),hg=fc(),gg=hc(),yg=_c(),ol=Function,xi=a(function(e){try{return ol('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),fr=mi(),vg=Ic(),bi=a(function(){throw new zt},"throwTypeError"),_g=fr?function(){try{return arguments.callee,bi}catch{try{return fr(arguments,"callee").get}catch{return bi}}}():bi,$t=wc()(),xe=Qc(),Pg=yi(),xg=gi(),il=vi(),mr=sn(),Ot={},bg=typeof Uint8Array>"u"||!xe?X:xe(Uint8Array),ft={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?X:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?X:ArrayBuffer,"%ArrayIteratorPrototype%":$t&&xe?xe([][Symbol.iterator]()):X,"%AsyncFromSyncIteratorPrototype%":X,"%AsyncFunction%":Ot,"%AsyncGenerator%":Ot,"%AsyncGeneratorFunction%":Ot,"%AsyncIteratorPrototype%":Ot,"%Atomics%":typeof Atomics>"u"?X:Atomics,"%BigInt%":typeof BigInt>"u"?X:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?X:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?X:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?X:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ag,"%eval%":eval,"%EvalError%":sg,"%Float16Array%":typeof Float16Array>"u"?X:Float16Array,"%Float32Array%":typeof Float32Array>"u"?X:Float32Array,"%Float64Array%":typeof Float64Array>"u"?X:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?X:FinalizationRegistry,"%Function%":ol,"%GeneratorFunction%":Ot,"%Int8Array%":typeof Int8Array>"u"?X:Int8Array,"%Int16Array%":typeof Int16Array>"u"?X:Int16Array,"%Int32Array%":typeof Int32Array>"u"?X:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$t&&xe?xe(xe([][Symbol.iterator]())):X,"%JSON%":typeof JSON=="object"?JSON:X,"%Map%":typeof Map>"u"?X:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$t||!xe?X:xe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ig,"%Object.getOwnPropertyDescriptor%":fr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?X:Promise,"%Proxy%":typeof Proxy>"u"?X:Proxy,"%RangeError%":ug,"%ReferenceError%":cg,"%Reflect%":typeof Reflect>"u"?X:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?X:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$t||!xe?X:xe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?X:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$t&&xe?xe(""[Symbol.iterator]()):X,"%Symbol%":$t?Symbol:X,"%SyntaxError%":Rt,"%ThrowTypeError%":_g,"%TypedArray%":bg,"%TypeError%":zt,"%Uint8Array%":typeof Uint8Array>"u"?X:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?X:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?X:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?X:Uint32Array,"%URIError%":lg,"%WeakMap%":typeof WeakMap>"u"?X:WeakMap,"%WeakRef%":typeof WeakRef>"u"?X:WeakRef,"%WeakSet%":typeof WeakSet>"u"?X:WeakSet,"%Function.prototype.call%":mr,"%Function.prototype.apply%":il,"%Object.defineProperty%":vg,"%Object.getPrototypeOf%":Pg,"%Math.abs%":pg,"%Math.floor%":dg,"%Math.max%":fg,"%Math.min%":mg,"%Math.pow%":hg,"%Math.round%":gg,"%Math.sign%":yg,"%Reflect.getPrototypeOf%":xg};if(xe)try{null.error}catch(e){tl=xe(xe(e)),ft["%Error.prototype%"]=tl}var tl,Tg=a(function e(t){var r;if(t==="%AsyncFunction%")r=xi("async function () {}");else if(t==="%GeneratorFunction%")r=xi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=xi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&xe&&(r=xe(o.prototype))}return ft[t]=r,r},"doEval"),rl={__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"]},hr=wt(),un=Pi(),Ig=hr.call(mr,Array.prototype.concat),Eg=hr.call(il,Array.prototype.splice),nl=hr.call(mr,String.prototype.replace),cn=hr.call(mr,String.prototype.slice),Sg=hr.call(mr,RegExp.prototype.exec),Ag=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wg=/\\(\\)?/g,$g=a(function(t){var r=cn(t,0,1),n=cn(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 nl(t,Ag,function(i,s,u,c){o[o.length]=u?nl(c,wg,"$1"):s||i}),o},"stringToPath"),Og=a(function(t,r){var n=t,o;if(un(rl,n)&&(o=rl[n],n="%"+o[0]+"%"),un(ft,n)){var i=ft[n];if(i===Ot&&(i=Tg(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");al.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(Sg(/^%?[^%]*%?$/,t)===null)throw new Rt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=$g(t),o=n.length>0?n[0]:"",i=Og("%"+o+"%",r),s=i.name,u=i.value,c=!1,d=i.alias;d&&(o=d[0],Eg(n,Ig([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],p=cn(y,0,1),m=cn(y,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new Rt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(c=!0),o+="."+y,s="%"+o+"%",un(ft,s))u=ft[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(fr&&f+1>=n.length){var _=fr(u,y);v=!!_,v&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[y]}else v=un(u,y),u=u[y];v&&!c&&(ft[s]=u)}}return u},"GetIntrinsic")});var cl=b((_N,ul)=>{"use strict";var zg=hi();ul.exports=a(function(){return zg()&&!!Symbol.toStringTag},"hasToStringTagShams")});var dl=b((xN,pl)=>{"use strict";var Rg=sl(),ll=Rg("%Object.defineProperty%",!0),kg=cl()(),Dg=Pi(),Cg=nn(),ln=kg?Symbol.toStringTag:null;pl.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 Cg("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ln&&(n||!Dg(t,ln))&&(ll?ll(t,ln,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[ln]=r)},"setToStringTag")});var ml=b((TN,fl)=>{"use strict";var Ng=Function.prototype.call,Ug=Object.prototype.hasOwnProperty,Mg=wt();fl.exports=Mg.call(Ng,Ug)});var gl=b((IN,hl)=>{"use strict";hl.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var _l=b((EN,vl)=>{"use strict";var Si=xu(),Lg=require("util"),Ti=require("path"),jg=require("http"),Fg=require("https"),Vg=require("url").parse,Bg=require("fs"),Hg=require("stream").Stream,Zg=require("crypto"),Ii=Su(),qg=Bu(),Gg=dl(),ot=ml(),Ei=gl();function yl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(yl,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Si.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(Q,"FormData");Lg.inherits(Q,Si);Q.LINE_BREAK=`\r
|
|
2
|
+
`;Q.DEFAULT_CONTENT_TYPE="application/octet-stream";Q.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Si.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)};Q.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)+Q.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ot(t,"httpVersion"))&&!(t instanceof Hg))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){ot(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Bg.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ot(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ot(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Q.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="'+yl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Ei(s,r.header);var u;for(var c in s)if(ot(s,c)){if(u=s[c],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=c+": "+u.join("; ")+Q.LINE_BREAK)}return"--"+this.getBoundary()+Q.LINE_BREAK+i+Q.LINE_BREAK};Q.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Ti.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Ti.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ot(e,"httpVersion")&&(r=Ti.basename(e.client._httpMessage.path||"")),r)return'filename="'+yl(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Ii.lookup(e.name)),!r&&e&&e.path&&(r=Ii.lookup(e.path)),!r&&e&&e.readable&&ot(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Ii.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Q.DEFAULT_CONTENT_TYPE),r};Q.prototype._multiPartFooter=function(){return function(e){var t=Q.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Q.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Q.LINE_BREAK};Q.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ot(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Q.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Q.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Q.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(Q.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Q.prototype._generateBoundary=function(){this._boundary="--------------------------"+Zg.randomBytes(12).toString("hex")};Q.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};Q.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Q.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}qg.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};Q.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Vg(e),n=Ei({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Ei(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Fg.request(n):r=jg.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,c=a(function(d,f){return r.removeListener("error",c),r.removeListener("response",u),t.call(this,d,f)},"callback");u=c.bind(this,null),r.on("error",c),r.on("response",u)}}.bind(this)),r};Q.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Q.prototype.toString=function(){return"[object FormData]"};Gg(Q.prototype,"FormData");vl.exports=Q});var le={};Po(le,{__addDisposableResource:()=>Kl,__assign:()=>pn,__asyncDelegator:()=>Fl,__asyncGenerator:()=>jl,__asyncValues:()=>Vl,__await:()=>kt,__awaiter:()=>Dl,__classPrivateFieldGet:()=>ql,__classPrivateFieldIn:()=>Wl,__classPrivateFieldSet:()=>Gl,__createBinding:()=>fn,__decorate:()=>Al,__disposeResources:()=>Jl,__esDecorate:()=>$l,__exportStar:()=>Nl,__extends:()=>El,__generator:()=>Cl,__importDefault:()=>Zl,__importStar:()=>Hl,__makeTemplateObject:()=>Bl,__metadata:()=>kl,__param:()=>wl,__propKey:()=>zl,__read:()=>$i,__rest:()=>Sl,__rewriteRelativeImportExtension:()=>Xl,__runInitializers:()=>Ol,__setFunctionName:()=>Rl,__spread:()=>Ul,__spreadArray:()=>Ll,__spreadArrays:()=>Ml,__values:()=>dn,default:()=>ay});function El(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ai(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Sl(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 Al(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 wl(e,t){return function(r,n){t(r,n,e)}}function $l(e,t,r,n,o,i){function s(P){if(P!==void 0&&typeof P!="function")throw new TypeError("Function expected");return P}a(s,"accept");for(var u=n.kind,c=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,p=r.length-1;p>=0;p--){var m={};for(var _ in n)m[_]=_==="access"?{}:n[_];for(var _ in n.access)m.access[_]=n.access[_];m.addInitializer=function(P){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(P||null))};var g=(0,r[p])(u==="accessor"?{get:f.get,set:f.set}:f[c],m);if(u==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(v=s(g.get))&&(f.get=v),(v=s(g.set))&&(f.set=v),(v=s(g.init))&&o.unshift(v)}else(v=s(g))&&(u==="field"?o.unshift(v):f[c]=v)}d&&Object.defineProperty(d,n.name,f),y=!0}function Ol(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 zl(e){return typeof e=="symbol"?e:"".concat(e)}function Rl(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 kl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Dl(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 c(f){try{d(n.throw(f))}catch(v){s(v)}}a(c,"rejected");function d(f){f.done?i(f.value):o(f.value).then(u,c)}a(d,"step"),d((n=n.apply(e,t||[])).next())})}function Cl(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 c([d,f])}}function c(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 Nl(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&fn(t,e,r)}function dn(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 $i(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 Ul(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat($i(arguments[t]));return e}function Ml(){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 Ll(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 jl(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(p){return function(m){return Promise.resolve(m).then(p,v)}}function u(p,m){n[p]&&(o[p]=function(_){return new Promise(function(g,P){i.push([p,_,g,P])>1||c(p,_)})},m&&(o[p]=m(o[p])))}function c(p,m){try{d(n[p](m))}catch(_){y(i[0][3],_)}}function d(p){p.value instanceof kt?Promise.resolve(p.value.v).then(f,v):y(i[0][2],p)}function f(p){c("next",p)}function v(p){c("throw",p)}function y(p,m){p(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Fl(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 Vl(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 dn=="function"?dn(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,c){s=e[i](s),o(u,c,s.done,s.value)})}}function o(i,s,u,c){Promise.resolve(c).then(function(d){i({value:d,done:u})},s)}}function Bl(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Hl(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=wi(e),n=0;n<r.length;n++)r[n]!=="default"&&fn(t,e,r[n]);return oy(t,e),t}function Zl(e){return e&&e.__esModule?e:{default:e}}function ql(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 Gl(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 Wl(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 Kl(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 Jl(e){function t(i){e.error=e.hasError?new iy(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 Xl(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 Ai,pn,fn,oy,wi,iy,ay,pe=Rd(()=>{Ai=a(function(e,t){return Ai=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])},Ai(e,t)},"extendStatics");a(El,"__extends");pn=a(function(){return pn=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"),pn.apply(this,arguments)},"__assign");a(Sl,"__rest");a(Al,"__decorate");a(wl,"__param");a($l,"__esDecorate");a(Ol,"__runInitializers");a(zl,"__propKey");a(Rl,"__setFunctionName");a(kl,"__metadata");a(Dl,"__awaiter");a(Cl,"__generator");fn=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(Nl,"__exportStar");a(dn,"__values");a($i,"__read");a(Ul,"__spread");a(Ml,"__spreadArrays");a(Ll,"__spreadArray");a(kt,"__await");a(jl,"__asyncGenerator");a(Fl,"__asyncDelegator");a(Vl,"__asyncValues");a(Bl,"__makeTemplateObject");oy=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},wi=a(function(e){return wi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},wi(e)},"ownKeys");a(Hl,"__importStar");a(Zl,"__importDefault");a(ql,"__classPrivateFieldGet");a(Gl,"__classPrivateFieldSet");a(Wl,"__classPrivateFieldIn");a(Kl,"__addDisposableResource");iy=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(Jl,"__disposeResources");a(Xl,"__rewriteRelativeImportExtension");ay={__extends:El,__assign:pn,__rest:Sl,__decorate:Al,__param:wl,__esDecorate:$l,__runInitializers:Ol,__propKey:zl,__setFunctionName:Rl,__metadata:kl,__awaiter:Dl,__generator:Cl,__createBinding:fn,__exportStar:Nl,__values:dn,__read:$i,__spread:Ul,__spreadArrays:Ml,__spreadArray:Ll,__await:kt,__asyncGenerator:jl,__asyncDelegator:Fl,__asyncValues:Vl,__makeTemplateObject:Bl,__importStar:Hl,__importDefault:Zl,__classPrivateFieldGet:ql,__classPrivateFieldSet:Gl,__classPrivateFieldIn:Wl,__addDisposableResource:Kl,__disposeResources:Jl,__rewriteRelativeImportExtension:Xl}});var yr=b(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.RequestMethod=void 0;var Yl;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(Yl||(mn.RequestMethod=Yl={}))});var Ql=b(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.BatchRequestContent=void 0;var Dt=(pe(),ue(le)),Oi=yr(),sy=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(),c=u.next();!c.done;){var d=c.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;c=u.next()}return!0},"isParallel"),n=a(function(s){var u=s.entries(),c=u.next(),d=c.value[1];if(d.dependsOn!==void 0&&d.dependsOn.length>0)return!1;var f=c;for(c=u.next();!c.done;){var v=c.value[1];if(v.dependsOn===void 0||v.dependsOn.length!==1||v.dependsOn[0]!==f.value[1].id)return!1;f=c,c=u.next()}return!0},"isSerial"),o=a(function(s){var u=s.entries(),c=u.next(),d=c.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(c=u.next();!c.done;){var y=c.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;c=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,c){o[c]=u}),Object.keys(o).length&&(r.headers=o),t.method===Oi.RequestMethod.PATCH||t.method===Oi.RequestMethod.POST||t.method===Oi.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,c,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,p=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=p.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:c=f.sent(),n=c.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(c){switch(c.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;c.label=1;case 1:return o.done?[3,3]:(i=o.value[1],[4,e.getRequestData(i.request)]);case 2:if(s=c.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 c=s.value[0];if(u.value[1].dependsOn===void 0&&(u.value[1].dependsOn=[]),u.value[1].dependsOn.indexOf(c)!==-1){var n=new Error("Dependency ".concat(c," is already added for the request ").concat(t));throw n.name="Duplicate Dependency",n}u.value[1].dependsOn.push(c)}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}();hn.BatchRequestContent=sy});var ep=b(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.BatchResponseContent=void 0;var uy=(pe(),ue(le)),cy=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 uy.__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}();gn.BatchResponseContent=cy});var zi=b(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.GRAPH_URLS=it.GRAPH_BASE_URL=it.GRAPH_API_VERSION=void 0;it.GRAPH_API_VERSION="v1.0";it.GRAPH_BASE_URL="https://graph.microsoft.com/";it.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 We=b(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.GraphClientError=void 0;var ly=(pe(),ue(le)),py=function(e){ly.__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);yn.GraphClientError=py});var vn=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.isCustomHost=Ce.isGraphURL=Ce.serializeContent=Ce.urlJoin=Ce.oDataQueryNames=void 0;var dy=zi(),fy=We();Ce.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var my=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");Ce.urlJoin=my;var hy=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");Ce.serializeContent=hy;var gy=a(function(e){return tp(e)},"isGraphURL");Ce.isGraphURL=gy;var yy=a(function(e,t){return t.forEach(function(r){return vy(r)}),tp(e,t)},"isCustomHost");Ce.isCustomHost=yy;var tp=a(function(e,t){if(t===void 0&&(t=dy.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"),vy=a(function(e){if(e.indexOf("/")!==-1)throw new fy.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 at=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.MiddlewareControl=void 0;var _y=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}();_n.MiddlewareControl=_y});var Ct=b(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.cloneRequestWithNewUrl=Ne.appendRequestHeader=Ne.setRequestHeader=Ne.getRequestHeader=Ne.generateUUID=void 0;var rp=(pe(),ue(le)),Py=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");Ne.generateUUID=Py;var xy=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");Ne.getRequestHeader=xy;var by=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 c=t.headers[s];if(c[0]===r){c[1]=n;break}}s===u&&t.headers.push([r,n])}else Object.assign(t.headers,(i={},i[r]=n,i))},"setRequestHeader");Ne.setRequestHeader=by;var Ty=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");Ne.appendRequestHeader=Ty;var Iy=a(function(e,t){return rp.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,c,d,f,v,y,p,m;return rp.__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,c=t.mode,d=t.credentials,f=t.cache,v=t.redirect,y=t.integrity,p=t.keepalive,m=t.signal,[2,new Request(e,{method:o,headers:i,body:r,referrer:s,referrerPolicy:u,mode:c,credentials:d,cache:f,redirect:v,integrity:y,keepalive:p,signal:m})]}})})},"cloneRequestWithNewUrl");Ne.cloneRequestWithNewUrl=Iy});var Ri=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.AuthenticationHandlerOptions=void 0;var Ey=function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e}();Pn.AuthenticationHandlerOptions=Ey});var Ut=b(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.TelemetryHandlerOptions=Nt.FeatureUsageFlag=void 0;var np=at(),ki;(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"})(ki||(Nt.FeatureUsageFlag=ki={}));var Sy=function(){function e(){this.featureUsage=ki.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof np.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new np.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=Sy});var bn=b(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.AuthenticationHandler=void 0;var op=(pe(),ue(le)),ip=vn(),Ay=at(),wy=Ct(),$y=Ri(),ap=Ut(),Oy=function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return op.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return op.__generator(this,function(c){switch(c.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,ip.isGraphURL)(r)||t.customHosts&&(0,ip.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof Ay.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions($y.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=c.sent(),u="Bearer ".concat(s),(0,wy.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),ap.TelemetryHandlerOptions.updateFeatureUsageFlag(t,ap.FeatureUsageFlag.AUTHENTICATION_HANDLER_ENABLED),[3,3];case 2:t.options.headers&&delete t.options.headers[e.AUTHORIZATION_HEADER],c.label=3;case 3:return[4,this.nextMiddleware.execute(t)];case 4:return[2,c.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.AUTHORIZATION_HEADER="Authorization",e}();xn.AuthenticationHandler=Oy});var In=b(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.HTTPMessageHandler=void 0;var sp=(pe(),ue(le)),zy=function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return sp.__awaiter(this,void 0,void 0,function(){var r;return sp.__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}();Tn.HTTPMessageHandler=zy});var vr=b(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.RetryHandlerOptions=void 0;var Ry=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}();En.RetryHandlerOptions=Ry});var An=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.RetryHandler=void 0;var Mt=(pe(),ue(le)),Di=yr(),ky=at(),up=Ct(),cp=vr(),lp=Ut(),Dy=function(){function e(t){t===void 0&&(t=new cp.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===Di.RequestMethod.PUT||n===Di.RequestMethod.PATCH||n===Di.RequestMethod.POST;if(o){var i=(0,up.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 Mt.__awaiter(this,void 0,void 0,function(){var r;return Mt.__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 ky.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new cp.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return Mt.__awaiter(this,void 0,void 0,function(){var o;return Mt.__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,up.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 Mt.__awaiter(this,void 0,void 0,function(){var r,n;return Mt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),lp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,lp.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}();Sn.RetryHandler=Dy});var _r=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.RedirectHandlerOptions=void 0;var Cy=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}();wn.RedirectHandlerOptions=Cy});var On=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.RedirectHandler=void 0;var Lt=(pe(),ue(le)),Ny=yr(),Uy=at(),My=Ct(),Ci=_r(),pp=Ut(),Ly=function(){function e(t){t===void 0&&(t=new Ci.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,My.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 Uy.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Ci.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Ci.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=Ny.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,pp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,pp.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}();$n.RedirectHandler=Ly});var dp=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.PACKAGE_VERSION=void 0;zn.PACKAGE_VERSION="3.0.7"});var Dn=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.TelemetryHandler=void 0;var fp=(pe(),ue(le)),mp=vn(),jy=dp(),Fy=at(),Rn=Ct(),Vy=Ut(),By=function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return fp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return fp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,mp.isGraphURL)(r)||t.customHosts&&(0,mp.isCustomHost)(r,t.customHosts)?(n=(0,Rn.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,Rn.generateUUID)(),(0,Rn.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(jy.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof Fy.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(Vy.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,Rn.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}();kn.TelemetryHandler=By});var hp=b(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.MiddlewareFactory=void 0;var Hy=bn(),Zy=In(),qy=_r(),Gy=vr(),Wy=On(),Ky=An(),Jy=Dn(),Xy=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 Hy.AuthenticationHandler(t),o=new Ky.RetryHandler(new Gy.RetryHandlerOptions),i=new Jy.TelemetryHandler,s=new Zy.HTTPMessageHandler;if(r.push(n),r.push(o),Xy()){var u=new Wy.RedirectHandler(new qy.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e}();Cn.MiddlewareFactory=Yy});var Un=b(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.ChaosStrategy=void 0;var gp;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(gp||(Nn.ChaosStrategy=gp={}))});var Ni=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ChaosHandlerOptions=void 0;var Qy=Un(),ev=function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=Qy.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}();Mn.ChaosHandlerOptions=ev});var yp=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 Pp=b(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.ChaosHandler=void 0;var Ln=(pe(),ue(le)),tv=at(),rv=Ct(),vp=yp(),Ui=Ni(),_p=Un(),nv=function(){function e(t,r){t===void 0&&(t=new Ui.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=vp.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,rv.generateUUID)(),i=new Date,s=this.createResponseHeaders(t,o,i.toString()),u=this.createResponseBody(t,o,i.toString()),c={url:n,status:t.statusCode,statusText:t.statusMessage,headers:s};r.response=new Response(typeof u=="string"?u:JSON.stringify(u),c)},e.prototype.sendRequest=function(t,r){return Ln.__awaiter(this,void 0,void 0,function(){return Ln.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===_p.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=vp.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===_p.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 c=new RegExp(u+"$");c.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 tv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Ui.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Ui.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Ln.__awaiter(this,void 0,void 0,function(){var r;return Ln.__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}();jn.ChaosHandler=nv});var Pr=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.ResponseType=void 0;var xp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(xp||(Fn.ResponseType=xp={}))});var Li=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.GraphResponseHandler=Ft.DocumentType=void 0;var Vn=(pe(),ue(le)),mt=Pr(),Mi;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Mi||(Ft.DocumentType=Mi={}));var Bn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Bn||(Bn={}));var Hn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Hn||(Hn={}));var ov=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(c){o(c)}})}):Promise.resolve(t.body)},e.convertResponse=function(t,r){return Vn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Vn.__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 mt.ResponseType.ARRAYBUFFER:return[3,1];case mt.ResponseType.BLOB:return[3,3];case mt.ResponseType.DOCUMENT:return[3,5];case mt.ResponseType.JSON:return[3,7];case mt.ResponseType.STREAM:return[3,9];case mt.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,Mi.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(Hn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Hn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Bn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Bn.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 Vn.__awaiter(this,void 0,void 0,function(){var o;return Vn.__generator(this,function(i){switch(i.label){case 0:return r!==mt.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=ov});var ji=b(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.Range=void 0;var iv=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}();Zn.Range=iv});var Fi=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.UploadResult=void 0;var av=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}();qn.UploadResult=av});var Bi=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.LargeFileUploadTask=void 0;var Oe=(pe(),ue(le)),Vi=We(),sv=Li(),bp=Pr(),Gn=ji(),uv=Fi(),cv=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 Vi.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 Gn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),Oe.__awaiter(this,void 0,void 0,function(){var i,s;return Oe.__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 Gn.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 Gn.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 Gn.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 Vi.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 Oe.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,s,u;return Oe.__generator(this,function(c){switch(c.label){case 0:t=this.options&&this.options.uploadEventHandlers,c.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=c.sent(),[4,this.uploadSliceGetRawResponse(o,r,this.file.size)];case 3:if(i=c.sent(),!i)throw new Vi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,sv.GraphResponseHandler.getResponse(i)];case 4:return s=c.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,uv.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 Oe.__awaiter(this,void 0,void 0,function(){return Oe.__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 Oe.__awaiter(this,void 0,void 0,function(){return Oe.__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(bp.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return Oe.__awaiter(this,void 0,void 0,function(){var t;return Oe.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(bp.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return Oe.__awaiter(this,void 0,void 0,function(){var t;return Oe.__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 Oe.__awaiter(this,void 0,void 0,function(){return Oe.__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}();Wn.LargeFileUploadTask=cv});var Hi=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.FileUpload=void 0;var lv=We(),pv=function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new lv.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}();Kn.FileUpload=pv});var Zi=b(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.getValidRangeSize=void 0;var dv=5*1024*1024,fv=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),mv=a(function(e){e===void 0&&(e=dv);var t=60*1024*1024;return e>t&&(e=t),fv(e)},"getValidRangeSize");Jn.getValidRangeSize=mv});var Ip=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.OneDriveLargeFileUploadTask=void 0;var Ke=(pe(),ue(le)),Tp=We(),hv=Hi(),gv=Bi(),yv=Zi(),vv=function(e){Ke.__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 Ke.__awaiter(this,void 0,void 0,function(){var i,s,u;return Ke.__generator(this,function(c){if(!r||!n||!o)throw new Tp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new hv.FileUpload(s.content,i,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return Ke.__awaiter(this,void 0,void 0,function(){var i,s,u,c;return Ke.__generator(this,function(d){switch(d.label){case 0:if(!r||!n||!o)throw new Tp.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(),c=(0,yv.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:c,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return Ke.__awaiter(this,void 0,void 0,function(){var i;return Ke.__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"),Ke.__awaiter(this,void 0,void 0,function(){var o;return Ke.__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}(gv.LargeFileUploadTask);Xn.OneDriveLargeFileUploadTask=vv});var Sp=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.StreamUpload=void 0;var Ep=(pe(),ue(le)),xr=We(),_v=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 Ep.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c;return Ep.__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 c=Buffer.concat(n),this.previousSlice={fileSlice:c,range:t},[2,c]}})})},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 c;u<t&&(c=r.content.read(s))!==null;)u+=c.length,i.push(c),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}();Yn.StreamUpload=_v});var Ap=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.PageIterator=void 0;var Vt=(pe(),ue(le)),Pv=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 Vt.__awaiter(this,void 0,void 0,function(){var t,r;return Vt.__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 Vt.__awaiter(this,void 0,void 0,function(){var t;return Vt.__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 Vt.__awaiter(this,void 0,void 0,function(){return Vt.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e}();Qn.PageIterator=Pv});var qi=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.CustomAuthenticationProvider=void 0;var eo=(pe(),ue(le)),wp=We(),xv=function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return eo.__awaiter(this,void 0,void 0,function(){var t=this;return eo.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return eo.__awaiter(t,void 0,void 0,function(){var u,c;return eo.__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 wp.GraphClientError(u)),[4,wp.GraphClientError.setGraphClientError(i)];case 2:c=d.sent(),o(c),d.label=3;case 3:return[2]}})})})})]})})},e}();to.CustomAuthenticationProvider=xv});var Gi=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.GraphError=void 0;var bv=(pe(),ue(le)),Tv=function(e){bv.__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);ro.GraphError=Tv});var Op=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.GraphErrorHandler=void 0;var $p=(pe(),ue(le)),Wi=Gi(),Iv=function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Wi.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 Wi.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),$p.__awaiter(this,void 0,void 0,function(){var i;return $p.__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 Wi.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e}();no.GraphErrorHandler=Iv});var Ki=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.GraphRequest=void 0;var ae=(pe(),ue(le)),Ev=We(),Sv=Op(),br=vn(),Av=Li(),wv=at(),ht=yr(),$v=Pr(),Ov=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 c=i.indexOf("?");if(c===-1)o.urlComponents.path=i;else{o.urlComponents.path=i.substr(0,c);for(var d=i.substring(c+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,br.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(br.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=ae.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=ae.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=ae.__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 ae.__awaiter(this,void 0,void 0,function(){var i,s,u,c,d,f,v,y;return ae.__generator(this,function(p){switch(p.label){case 0:s=new wv.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,p.label=1;case 1:return p.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return c=p.sent(),i=c.response,[4,Av.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=p.sent(),[2,d];case 4:if(f=p.sent(),f instanceof Ev.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,Sv.GraphErrorHandler.getError(f,v,n,i)];case 5:throw y=p.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 ae.__awaiter(this,void 0,void 0,function(){var r,n,o;return ae.__generator(this,function(i){switch(i.label){case 0:return r=this.buildFullUrl(),n={method:ht.RequestMethod.GET},[4,this.send(r,n,t)];case 1:return o=i.sent(),[2,o]}})})},e.prototype.post=function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n,o,i;return ae.__generator(this,function(s){switch(s.label){case 0:return n=this.buildFullUrl(),o={method:ht.RequestMethod.POST,body:(0,br.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 ae.__awaiter(this,void 0,void 0,function(){return ae.__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 ae.__awaiter(this,void 0,void 0,function(){var n,o;return ae.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:ht.RequestMethod.PUT,body:(0,br.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.patch=function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n,o;return ae.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),this.setHeaderContentType(),o={method:ht.RequestMethod.PATCH,body:(0,br.serializeContent)(t)},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e.prototype.update=function(t,r){return ae.__awaiter(this,void 0,void 0,function(){return ae.__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 ae.__awaiter(this,void 0,void 0,function(){var r,n;return ae.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:ht.RequestMethod.DELETE},[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.del=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__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 ae.__awaiter(this,void 0,void 0,function(){var r,n;return ae.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:ht.RequestMethod.GET},this.responseType($v.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n,o;return ae.__generator(this,function(i){switch(i.label){case 0:return n=this.buildFullUrl(),o={method:ht.RequestMethod.PUT,headers:{"Content-Type":"application/octet-stream"},body:t},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e}();oo.GraphRequest=Ov});var Ji=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.HTTPClient=void 0;var zp=(pe(),ue(le)),zv=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 zp.__awaiter(this,void 0,void 0,function(){var r;return zp.__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}();io.HTTPClient=zv});var kp=b(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.HTTPClientFactory=void 0;var Rv=(pe(),ue(le)),Rp=Ji(),kv=bn(),Dv=In(),Cv=_r(),Nv=vr(),Uv=On(),Mv=An(),Lv=Dn(),jv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Fv=function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new kv.AuthenticationHandler(t),n=new Mv.RetryHandler(new Nv.RetryHandlerOptions),o=new Lv.TelemetryHandler,i=new Dv.HTTPMessageHandler;if(r.setNext(n),jv()){var s=new Uv.RedirectHandler(new Cv.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(Rp.HTTPClient.bind.apply(Rp.HTTPClient,Rv.__spreadArray([void 0],t,!1)))},e}();ao.HTTPClientFactory=Fv});var Dp=b(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.validatePolyFilling=void 0;var Vv=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");so.validatePolyFilling=Vv});var Up=b(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.Client=void 0;var Bv=(pe(),ue(le)),Cp=zi(),Hv=qi(),Zv=Ki(),Np=Ji(),qv=kp(),Gv=Dp(),Wv=function(){function e(t){this.config={baseUrl:Cp.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Cp.GRAPH_API_VERSION},(0,Gv.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=qv.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Np.HTTPClient.bind.apply(Np.HTTPClient,Bv.__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 Hv.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new Zv.GraphRequest(this.httpClient,this.config,t)},e}();uo.Client=Wv});var se=b(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ResponseType=z.GraphRequest=z.GraphClientError=z.GraphError=z.CustomAuthenticationProvider=z.Client=z.PageIterator=z.Range=z.UploadResult=z.FileUpload=z.StreamUpload=z.getValidRangeSize=z.OneDriveLargeFileUploadTask=z.LargeFileUploadTask=z.ChaosHandler=z.ChaosStrategy=z.ChaosHandlerOptions=z.TelemetryHandlerOptions=z.FeatureUsageFlag=z.RedirectHandlerOptions=z.RetryHandlerOptions=z.AuthenticationHandlerOptions=z.MiddlewareFactory=z.TelemetryHandler=z.RedirectHandler=z.RetryHandler=z.HTTPMessageHandler=z.AuthenticationHandler=z.BatchResponseContent=z.BatchRequestContent=void 0;var Kv=Ql();Object.defineProperty(z,"BatchRequestContent",{enumerable:!0,get:a(function(){return Kv.BatchRequestContent},"get")});var Jv=ep();Object.defineProperty(z,"BatchResponseContent",{enumerable:!0,get:a(function(){return Jv.BatchResponseContent},"get")});var Xv=bn();Object.defineProperty(z,"AuthenticationHandler",{enumerable:!0,get:a(function(){return Xv.AuthenticationHandler},"get")});var Yv=In();Object.defineProperty(z,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return Yv.HTTPMessageHandler},"get")});var Qv=An();Object.defineProperty(z,"RetryHandler",{enumerable:!0,get:a(function(){return Qv.RetryHandler},"get")});var e_=On();Object.defineProperty(z,"RedirectHandler",{enumerable:!0,get:a(function(){return e_.RedirectHandler},"get")});var t_=Dn();Object.defineProperty(z,"TelemetryHandler",{enumerable:!0,get:a(function(){return t_.TelemetryHandler},"get")});var r_=hp();Object.defineProperty(z,"MiddlewareFactory",{enumerable:!0,get:a(function(){return r_.MiddlewareFactory},"get")});var n_=Ri();Object.defineProperty(z,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return n_.AuthenticationHandlerOptions},"get")});var o_=vr();Object.defineProperty(z,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return o_.RetryHandlerOptions},"get")});var i_=_r();Object.defineProperty(z,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return i_.RedirectHandlerOptions},"get")});var Mp=Ut();Object.defineProperty(z,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return Mp.FeatureUsageFlag},"get")});Object.defineProperty(z,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return Mp.TelemetryHandlerOptions},"get")});var a_=Ni();Object.defineProperty(z,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return a_.ChaosHandlerOptions},"get")});var s_=Un();Object.defineProperty(z,"ChaosStrategy",{enumerable:!0,get:a(function(){return s_.ChaosStrategy},"get")});var u_=Pp();Object.defineProperty(z,"ChaosHandler",{enumerable:!0,get:a(function(){return u_.ChaosHandler},"get")});var c_=Bi();Object.defineProperty(z,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return c_.LargeFileUploadTask},"get")});var l_=Ip();Object.defineProperty(z,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return l_.OneDriveLargeFileUploadTask},"get")});var p_=Zi();Object.defineProperty(z,"getValidRangeSize",{enumerable:!0,get:a(function(){return p_.getValidRangeSize},"get")});var d_=Sp();Object.defineProperty(z,"StreamUpload",{enumerable:!0,get:a(function(){return d_.StreamUpload},"get")});var f_=Hi();Object.defineProperty(z,"FileUpload",{enumerable:!0,get:a(function(){return f_.FileUpload},"get")});var m_=Fi();Object.defineProperty(z,"UploadResult",{enumerable:!0,get:a(function(){return m_.UploadResult},"get")});var h_=ji();Object.defineProperty(z,"Range",{enumerable:!0,get:a(function(){return h_.Range},"get")});var g_=Ap();Object.defineProperty(z,"PageIterator",{enumerable:!0,get:a(function(){return g_.PageIterator},"get")});var y_=Up();Object.defineProperty(z,"Client",{enumerable:!0,get:a(function(){return y_.Client},"get")});var v_=qi();Object.defineProperty(z,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return v_.CustomAuthenticationProvider},"get")});var __=Gi();Object.defineProperty(z,"GraphError",{enumerable:!0,get:a(function(){return __.GraphError},"get")});var P_=We();Object.defineProperty(z,"GraphClientError",{enumerable:!0,get:a(function(){return P_.GraphClientError},"get")});var x_=Ki();Object.defineProperty(z,"GraphRequest",{enumerable:!0,get:a(function(){return x_.GraphRequest},"get")});var b_=Pr();Object.defineProperty(z,"ResponseType",{enumerable:!0,get:a(function(){return b_.ResponseType},"get")})});var Bt=b((Qi,ea)=>{(function(e,t){typeof Qi=="object"&&typeof ea<"u"?ea.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Qi,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",s="hour",u="day",c="week",d="month",f="quarter",v="year",y="date",p="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,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(V){var w=["th","st","nd","rd"],E=V%100;return"["+V+(w[(E-20)%10]||w[E]||w[0])+"]"},"ordinal")},P=a(function(V,w,E){var R=String(V);return!R||R.length>=w?V:""+Array(w+1-R.length).join(E)+V},"m"),I={s:P,z:a(function(V){var w=-V.utcOffset(),E=Math.abs(w),R=Math.floor(E/60),O=E%60;return(w<=0?"+":"-")+P(R,2,"0")+":"+P(O,2,"0")},"z"),m:a(function V(w,E){if(w.date()<E.date())return-V(E,w);var R=12*(E.year()-w.year())+(E.month()-w.month()),O=w.clone().add(R,d),q=E-O<0,G=w.clone().add(R+(q?-1:1),d);return+(-(R+(E-O)/(q?O-G:G-O))||0)},"t"),a:a(function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},"a"),p:a(function(V){return{M:d,y:v,w:c,d:u,D:y,h:s,m:i,s:o,ms:n,Q:f}[V]||String(V||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(V){return V===void 0},"u")},Z="en",ge={};ge[Z]=g;var Ee=a(function(V){return V instanceof gt},"p"),Le=a(function V(w,E,R){var O;if(!w)return Z;if(typeof w=="string"){var q=w.toLowerCase();ge[q]&&(O=q),E&&(ge[q]=E,O=q);var G=w.split("-");if(!O&&G.length>1)return V(G[0])}else{var oe=w.name;ge[oe]=w,O=oe}return!R&&O&&(Z=O),O||!R&&Z},"t"),ne=a(function(V,w){if(Ee(V))return V.clone();var E=typeof w=="object"?w:{};return E.date=V,E.args=arguments,new gt(E)},"w"),J=I;J.l=Le,J.i=Ee,J.w=function(V,w){return ne(V,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var gt=function(){function V(E){this.$L=Le(E.locale,null,!0),this.parse(E)}a(V,"M");var w=V.prototype;return w.parse=function(E){this.$d=function(R){var O=R.date,q=R.utc;if(O===null)return new Date(NaN);if(J.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var G=O.match(m);if(G){var oe=G[2]-1||0,ye=(G[7]||"0").substring(0,3);return q?new Date(Date.UTC(G[1],oe,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ye)):new Date(G[1],oe,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ye)}}return new Date(O)}(E),this.$x=E.x||{},this.init()},w.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},w.$utils=function(){return J},w.isValid=function(){return this.$d.toString()!==p},w.isSame=function(E,R){var O=ne(E);return this.startOf(R)<=O&&O<=this.endOf(R)},w.isAfter=function(E,R){return ne(E)<this.startOf(R)},w.isBefore=function(E,R){return this.endOf(R)<ne(E)},w.$g=function(E,R,O){return J.u(E)?this[R]:this.set(O,E)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(E,R){var O=this,q=!!J.u(R)||R,G=J.p(E),oe=a(function(ct,we){var Xe=J.w(O.$u?Date.UTC(O.$y,we,ct):new Date(O.$y,we,ct),O);return q?Xe:Xe.endOf(u)},"l"),ye=a(function(ct,we){return J.w(O.toDate()[ct].apply(O.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(we)),O)},"$"),Pe=this.$W,Te=this.$M,ke=this.$D,yt="set"+(this.$u?"UTC":"");switch(G){case v:return q?oe(1,0):oe(31,11);case d:return q?oe(1,Te):oe(0,Te+1);case c:var ut=this.$locale().weekStart||0,Ht=(Pe<ut?Pe+7:Pe)-ut;return oe(q?ke-Ht:ke+(6-Ht),Te);case u:case y:return ye(yt+"Hours",0);case s:return ye(yt+"Minutes",1);case i:return ye(yt+"Seconds",2);case o:return ye(yt+"Milliseconds",3);default:return this.clone()}},w.endOf=function(E){return this.startOf(E,!1)},w.$set=function(E,R){var O,q=J.p(E),G="set"+(this.$u?"UTC":""),oe=(O={},O[u]=G+"Date",O[y]=G+"Date",O[d]=G+"Month",O[v]=G+"FullYear",O[s]=G+"Hours",O[i]=G+"Minutes",O[o]=G+"Seconds",O[n]=G+"Milliseconds",O)[q],ye=q===u?this.$D+(R-this.$W):R;if(q===d||q===v){var Pe=this.clone().set(y,1);Pe.$d[oe](ye),Pe.init(),this.$d=Pe.set(y,Math.min(this.$D,Pe.daysInMonth())).$d}else oe&&this.$d[oe](ye);return this.init(),this},w.set=function(E,R){return this.clone().$set(E,R)},w.get=function(E){return this[J.p(E)]()},w.add=function(E,R){var O,q=this;E=Number(E);var G=J.p(R),oe=a(function(Te){var ke=ne(q);return J.w(ke.date(ke.date()+Math.round(Te*E)),q)},"y");if(G===d)return this.set(d,this.$M+E);if(G===v)return this.set(v,this.$y+E);if(G===u)return oe(1);if(G===c)return oe(7);var ye=(O={},O[i]=t,O[s]=r,O[o]=e,O)[G]||1,Pe=this.$d.getTime()+E*ye;return J.w(Pe,this)},w.subtract=function(E,R){return this.add(-1*E,R)},w.format=function(E){var R=this,O=this.$locale();if(!this.isValid())return O.invalidDate||p;var q=E||"YYYY-MM-DDTHH:mm:ssZ",G=J.z(this),oe=this.$H,ye=this.$m,Pe=this.$M,Te=O.weekdays,ke=O.months,yt=O.meridiem,ut=a(function(we,Xe,Zt,Or){return we&&(we[Xe]||we(R,q))||Zt[Xe].slice(0,Or)},"h"),Ht=a(function(we){return J.s(oe%12||12,we,"0")},"d"),ct=yt||function(we,Xe,Zt){var Or=we<12?"AM":"PM";return Zt?Or.toLowerCase():Or};return q.replace(_,function(we,Xe){return Xe||function(Zt){switch(Zt){case"YY":return String(R.$y).slice(-2);case"YYYY":return J.s(R.$y,4,"0");case"M":return Pe+1;case"MM":return J.s(Pe+1,2,"0");case"MMM":return ut(O.monthsShort,Pe,ke,3);case"MMMM":return ut(ke,Pe);case"D":return R.$D;case"DD":return J.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return ut(O.weekdaysMin,R.$W,Te,2);case"ddd":return ut(O.weekdaysShort,R.$W,Te,3);case"dddd":return Te[R.$W];case"H":return String(oe);case"HH":return J.s(oe,2,"0");case"h":return Ht(1);case"hh":return Ht(2);case"a":return ct(oe,ye,!0);case"A":return ct(oe,ye,!1);case"m":return String(ye);case"mm":return J.s(ye,2,"0");case"s":return String(R.$s);case"ss":return J.s(R.$s,2,"0");case"SSS":return J.s(R.$ms,3,"0");case"Z":return G}return null}(we)||G.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(E,R,O){var q,G=this,oe=J.p(R),ye=ne(E),Pe=(ye.utcOffset()-this.utcOffset())*t,Te=this-ye,ke=a(function(){return J.m(G,ye)},"D");switch(oe){case v:q=ke()/12;break;case d:q=ke();break;case f:q=ke()/3;break;case c:q=(Te-Pe)/6048e5;break;case u:q=(Te-Pe)/864e5;break;case s:q=Te/r;break;case i:q=Te/t;break;case o:q=Te/e;break;default:q=Te}return O?q:J.a(q)},w.daysInMonth=function(){return this.endOf(d).$D},w.$locale=function(){return ge[this.$L]},w.locale=function(E,R){if(!E)return this.$L;var O=this.clone(),q=Le(E,R,!0);return q&&(O.$L=q),O},w.clone=function(){return J.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},V}(),st=gt.prototype;return ne.prototype=st,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach(function(V){st[V[1]]=function(w){return this.$g(w,V[0],V[1])}}),ne.extend=function(V,w){return V.$i||(V(w,gt,ne),V.$i=!0),ne},ne.locale=Le,ne.isDayjs=Ee,ne.unix=function(V){return ne(1e3*V)},ne.en=ge[Z],ne.Ls=ge,ne.p={},ne})});var w_={};Po(w_,{microsoftSharePoint:()=>A_});module.exports=ue(w_);var kd=Object.freeze({status:"aborted"});function k(e,t,r){function n(u,c){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,c);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 c;let d=r?.Parent?new i:this;n(d,u),(c=d._zod).deferred??(c.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(k,"$constructor");var Dd=Symbol("zod_brand"),je=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zr=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},xo={};function Ve(e){return e&&Object.assign(xo,e),xo}a(Ve,"config");function To(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(To,"getEnumValues");function ia(e,t){return typeof t=="bigint"?t.toString():t}a(ia,"jsonStringifyReplacer");function kr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(kr,"cached");function aa(e){return e==null}a(aa,"nullish");function Dr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Dr,"cleanRegex");var oa=Symbol("evaluating");function ve(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==oa)return n===void 0&&(n=oa,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(ve,"defineLazy");var Io="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Gt,"isObject");var Cd=kr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function sa(e){if(Gt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Gt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(sa,"isPlainObject");var ua=new Set(["string","number","symbol"]);function vt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(vt,"escapeRegex");function Cr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Cr,"clone");function de(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(de,"normalizeParams");function ca(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(ca,"optionalKeys");var Nd={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 _t(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(_t,"aborted");function Ye(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(Ye,"prefixIssues");function Rr(e){return typeof e=="string"?e:e?.message}a(Rr,"unwrapMessage");function Qe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Rr(e.inst?._zod.def?.error?.(e))??Rr(t?.error?.(e))??Rr(r.customError?.(e))??Rr(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(Qe,"finalizeIssue");function la(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(la,"getLengthableOrigin");function Eo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(Eo,"issue");var pa=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,ia,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),da=k("$ZodError",pa),Wt=k("$ZodError",pa,{Parent:Error});var Md=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 je;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(c=>Qe(c,i,Ve())));throw Io(u,o?.callee),u}return s.value},"_parse"),Nr=Md(Wt),Ld=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(c=>Qe(c,i,Ve())));throw Io(u,o?.callee),u}return s.value},"_parseAsync"),Ur=Ld(Wt),jd=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 je;return i.issues.length?{success:!1,error:new(e??da)(i.issues.map(s=>Qe(s,o,Ve())))}:{success:!0,data:i.value}},"_safeParse"),Kt=jd(Wt),Fd=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=>Qe(s,o,Ve())))}:{success:!0,data:i.value}},"_safeParseAsync"),Jt=Fd(Wt);var Vd="(?:(?:\\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])))",Bd=new RegExp(`^${Vd}$`);var fa=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ma=/^-?\d+n?$/;var So=/^-?\d+(?:\.\d+)?$/,ha=/^(?:true|false)$/i;var Pt=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ga=k("$ZodCheckMinLength",(e,t)=>{var r;Pt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!aa(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=la(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Ao=k("$ZodCheckStringFormat",(e,t)=>{var r,n;Pt.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=()=>{})}),ya=k("$ZodCheckRegex",(e,t)=>{Ao.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 _a={major:4,minor:3,patch:6};var fe=k("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_a;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,c)=>{let d=_t(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,p=v._zod.check(s);if(p instanceof Promise&&c?.async===!1)throw new je;if(f||p instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await p,s.issues.length!==y&&(d||(d=_t(s,y)))});else{if(s.issues.length===y)continue;d||(d=_t(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,c)=>{if(_t(s))return s.aborted=!0,s;let d=o(u,n,c);if(d instanceof Promise){if(c.async===!1)throw new je;return d.then(f=>e._zod.parse(f,c))}return e._zod.parse(d,c)},"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 c=e._zod.parse(s,u);if(c instanceof Promise){if(u.async===!1)throw new je;return c.then(d=>o(d,n,u))}return o(c,n,u)}}ve(e,"~standard",()=>({validate:a(o=>{try{let i=Kt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Jt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),jr=k("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fa(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}}),wo=k("$ZodStringFormat",(e,t)=>{Ao.init(e,t),jr.init(e,t)});var Ia=k("$ZodURL",(e,t)=>{wo.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 Ea=k("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??So,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 $o=k("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=ha,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}}),Sa=k("$ZodBigInt",(e,t)=>{fe.init(e,t),e._zod.pattern=ma,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 Aa=k("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r}),wa=k("$ZodUnknown",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r});var $a=k("$ZodVoid",(e,t)=>{fe.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}}),Oa=k("$ZodDate",(e,t)=>{fe.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 Pa(e,t,r){e.issues.length&&t.issues.push(...Ye(r,e.issues)),t.value[r]=e.value}a(Pa,"handleArrayResult");var za=k("$ZodArray",(e,t)=>{fe.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],c=t.element._zod.run({value:u,issues:[]},n);c instanceof Promise?i.push(c.then(d=>Pa(d,r,s))):Pa(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Lr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ye(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Lr,"handlePropertyResult");function Hd(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=ca(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(Hd,"normalizeDef");function Zd(e,t,r,n,o,i){let s=[],u=o.keySet,c=o.catchall._zod,d=c.def.type,f=c.optout==="optional";for(let v in t){if(u.has(v))continue;if(d==="never"){s.push(v);continue}let y=c.run({value:t[v],issues:[]},n);y instanceof Promise?e.push(y.then(p=>Lr(p,r,v,t,f))):Lr(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(Zd,"handleCatchall");var Ra=k("$ZodObject",(e,t)=>{if(fe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let c={...u};return Object.defineProperty(t,"shape",{value:c}),c},"get")})}let n=kr(()=>Hd(t));ve(e._zod,"propValues",()=>{let u=t.shape,c={};for(let d in u){let f=u[d]._zod;if(f.values){c[d]??(c[d]=new Set);for(let v of f.values)c[d].add(v)}}return c});let o=Gt,i=t.catchall,s;e._zod.parse=(u,c)=>{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 p=v[y],m=p._zod.optout==="optional",_=p._zod.run({value:d[y],issues:[]},c);_ instanceof Promise?f.push(_.then(g=>Lr(g,u,y,d,m))):Lr(_,u,y,d,m)}return i?Zd(f,d,u,c,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function xa(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=>!_t(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=>Qe(s,n,Ve())))}),t)}a(xa,"handleUnionResults");var Oo=k("$ZodUnion",(e,t)=>{fe.init(e,t),ve(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ve(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ve(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ve(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=>Dr(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 c of t.options){let d=c._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(c=>xa(c,o,e,i)):xa(u,o,e,i)}});var ka=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Oo.init(e,t);let r=e._zod.parse;ve(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,c]of Object.entries(s)){o[u]||(o[u]=new Set);for(let d of c)o[u].add(d)}}return o});let n=kr(()=>{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 c of u){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Gt(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 Da=k("$ZodRecord",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!sa(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(...Ye(d,v.issues)),r.value[d]=v.value})):(f.issues.length&&r.issues.push(...Ye(d,f.issues)),r.value[d]=f.value)}let c;for(let d in o)u.has(d)||(c=c??[],c.push(d));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{r.value={};for(let u of Reflect.ownKeys(o)){if(u==="__proto__")continue;let c=t.keyType._zod.run({value:u,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&So.test(u)&&c.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&&(c=v)}if(c.issues.length){t.mode==="loose"?r.value[u]=o[u]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(v=>Qe(v,n,Ve())),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(...Ye(u,v.issues)),r.value[c.value]=v.value})):(f.issues.length&&r.issues.push(...Ye(u,f.issues)),r.value[c.value]=f.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Ca=k("$ZodEnum",(e,t)=>{fe.init(e,t);let r=To(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ua.has(typeof o)).map(o=>typeof o=="string"?vt(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}}),Na=k("$ZodLiteral",(e,t)=>{if(fe.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"?vt(n):n?vt(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 Ua=k("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zr(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 je;return r.value=o,r}});function ba(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ba,"handleOptionalResult");var Ma=k("$ZodOptional",(e,t)=>{fe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Dr(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=>ba(i,r.value)):ba(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var La=k("$ZodNullable",(e,t)=>{fe.init(e,t),ve(e._zod,"optin",()=>t.innerType._zod.optin),ve(e._zod,"optout",()=>t.innerType._zod.optout),ve(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Dr(r.source)}|null)$`):void 0}),ve(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 ja=k("$ZodPipe",(e,t)=>{fe.init(e,t),ve(e._zod,"values",()=>t.in._zod.values),ve(e._zod,"optin",()=>t.in._zod.optin),ve(e._zod,"optout",()=>t.out._zod.optout),ve(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=>Mr(s,t.in,n)):Mr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Mr(i,t.out,n)):Mr(o,t.out,n)}});function Mr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(Mr,"handlePipeResult");var Fa=k("$ZodCustom",(e,t)=>{Pt.init(e,t),fe.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=>Ta(i,r,n,e));Ta(o,r,n,e)}});function Ta(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(Eo(o))}}a(Ta,"handleRefineResult");var Ba,Kd=Symbol("ZodOutput"),Jd=Symbol("ZodInput"),zo=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 Ha(){return new zo}a(Ha,"registry");(Ba=globalThis).__zod_globalRegistry??(Ba.__zod_globalRegistry=Ha());var Ro=globalThis.__zod_globalRegistry;function Za(e,t){return new e({type:"string",...de(t)})}a(Za,"_string");function qa(e,t){return new e({type:"string",coerce:!0,...de(t)})}a(qa,"_coercedString");function Ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...de(t)})}a(Ga,"_url");function Wa(e,t){return new e({type:"number",checks:[],...de(t)})}a(Wa,"_number");function Ka(e,t){return new e({type:"number",coerce:!0,checks:[],...de(t)})}a(Ka,"_coercedNumber");function Ja(e,t){return new e({type:"boolean",...de(t)})}a(Ja,"_boolean");function Xa(e,t){return new e({type:"boolean",coerce:!0,...de(t)})}a(Xa,"_coercedBoolean");function Ya(e,t){return new e({type:"bigint",coerce:!0,...de(t)})}a(Ya,"_coercedBigint");function Qa(e){return new e({type:"any"})}a(Qa,"_any");function es(e){return new e({type:"unknown"})}a(es,"_unknown");function ts(e,t){return new e({type:"void",...de(t)})}a(ts,"_void");function rs(e,t){return new e({type:"date",coerce:!0,...de(t)})}a(rs,"_coercedDate");function Ue(e,t){return new ga({check:"min_length",...de(t),minimum:e})}a(Ue,"_minLength");function et(e,t){return new ya({check:"string_format",format:"regex",...de(t),pattern:e})}a(et,"_regex");function ns(e,t,r){let n=de(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(ns,"_custom");var _e=k("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");fe.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Nr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Kt(e,r,n),e.parseAsync=async(r,n)=>Ur(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Jt(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)=>Cr(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Vr=k("ZodMiniString",(e,t)=>{jr.init(e,t),_e.init(e,t)});function l(e){return Za(Vr,e)}a(l,"string");var os=k("ZodMiniStringFormat",(e,t)=>{wo.init(e,t),Vr.init(e,t)});var sf=k("ZodMiniURL",(e,t)=>{Ia.init(e,t),os.init(e,t)});function is(e){return Ga(sf,e)}a(is,"url");var ko=k("ZodMiniNumber",(e,t)=>{Ea.init(e,t),_e.init(e,t)});function Se(e){return Wa(ko,e)}a(Se,"number");var Do=k("ZodMiniBoolean",(e,t)=>{$o.init(e,t),_e.init(e,t)});function re(e){return Ja(Do,e)}a(re,"boolean");var as=k("ZodMiniBigInt",(e,t)=>{Sa.init(e,t),_e.init(e,t)});var uf=k("ZodMiniAny",(e,t)=>{Aa.init(e,t),_e.init(e,t)});function Yt(){return Qa(uf)}a(Yt,"any");var cf=k("ZodMiniUnknown",(e,t)=>{wa.init(e,t),_e.init(e,t)});function L(){return es(cf)}a(L,"unknown");var lf=k("ZodMiniVoid",(e,t)=>{$a.init(e,t),_e.init(e,t)});function ss(e){return ts(lf,e)}a(ss,"_void");var us=k("ZodMiniDate",(e,t)=>{Oa.init(e,t),_e.init(e,t)});var pf=k("ZodMiniArray",(e,t)=>{za.init(e,t),_e.init(e,t)});function B(e,t){return new pf({type:"array",element:e,...de(t)})}a(B,"array");var df=k("ZodMiniObject",(e,t)=>{Ra.init(e,t),_e.init(e,t),ve(e,"shape",()=>t.shape)});function h(e,t){let r={type:"object",shape:e??{},...de(t)};return new df(r)}a(h,"object");var ff=k("ZodMiniUnion",(e,t)=>{Oo.init(e,t),_e.init(e,t)});function H(e,t){return new ff({type:"union",options:e,...de(t)})}a(H,"union");var mf=k("ZodMiniDiscriminatedUnion",(e,t)=>{ka.init(e,t),_e.init(e,t)});function xt(e,t,r){return new mf({type:"union",options:t,discriminator:e,...de(r)})}a(xt,"discriminatedUnion");var hf=k("ZodMiniRecord",(e,t)=>{Da.init(e,t),_e.init(e,t)});function j(e,t,r){return new hf({type:"record",keyType:e,valueType:t,...de(r)})}a(j,"record");var gf=k("ZodMiniEnum",(e,t)=>{Ca.init(e,t),_e.init(e,t),e.options=Object.values(t.entries)});function K(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new gf({type:"enum",entries:r,...de(t)})}a(K,"_enum");var yf=k("ZodMiniLiteral",(e,t)=>{Na.init(e,t),_e.init(e,t)});function C(e,t){return new yf({type:"literal",values:Array.isArray(e)?e:[e],...de(t)})}a(C,"literal");var vf=k("ZodMiniTransform",(e,t)=>{Ua.init(e,t),_e.init(e,t)});function tt(e){return new vf({type:"transform",transform:e})}a(tt,"transform");var _f=k("ZodMiniOptional",(e,t)=>{Ma.init(e,t),_e.init(e,t)});function x(e){return new _f({type:"optional",innerType:e})}a(x,"optional");var Pf=k("ZodMiniNullable",(e,t)=>{La.init(e,t),_e.init(e,t)});function Qt(e){return new Pf({type:"nullable",innerType:e})}a(Qt,"nullable");var xf=k("ZodMiniPipe",(e,t)=>{ja.init(e,t),_e.init(e,t)});function rt(e,t){return new xf({type:"pipe",in:e,out:t})}a(rt,"pipe");var bf=k("ZodMiniCustom",(e,t)=>{Fa.init(e,t),_e.init(e,t)});function Br(e,t){return ns(bf,e??(()=>!0),t)}a(Br,"custom");var er={};Po(er,{bigint:()=>$f,boolean:()=>wf,date:()=>Of,number:()=>Af,string:()=>Sf});function Sf(e){return qa(Vr,e)}a(Sf,"string");function Af(e){return Ka(ko,e)}a(Af,"number");function wf(e){return Xa(Do,e)}a(wf,"boolean");function $f(e){return Ya(as,e)}a($f,"bigint");function Of(e){return rs(us,e)}a(Of,"date");var No=h({retryOnFailure:h({defaultValue:x(re()),hide:x(re())}),continueOnFailure:h({defaultValue:x(re()),hide:x(re())})}),Co=class{constructor(t,r,n,o,i,s,u,c,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=c;this.outputSchema=d;this.audience=f;this.aiMetadata=v}static{a(this,"IAction")}},ee=a(e=>new Co(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 te=h({displayName:l(),description:x(l())}),W=a((e,t)=>h({type:C(t),required:re(),defaultValue:x(Yt())}),"TPropertyValue");var ze=h({...te.shape,...W(l(),"SHORT_TEXT").shape}),Be=h({...te.shape,...W(l(),"LONG_TEXT").shape});var ls=h({label:l(),value:L()}),Hr=h({disabled:x(re()),placeholder:x(l()),options:B(ls)});var Re=h({...te.shape,options:Hr,...W(L(),"STATIC_DROPDOWN").shape}),He=h({...te.shape,options:Hr,...W(B(L()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Uo=h({...te.shape,...W(L(),"DROPDOWN").shape,refreshers:B(l())}),tr=h({...te.shape,...W(B(L()),"MULTI_SELECT_DROPDOWN").shape,refreshers:B(l())});var Ze=h({...te.shape,...W(re(),"CHECKBOX").shape});var qe=h({...te.shape,...W(Se(),"NUMBER").shape});var rr=h({...te.shape,...W(L(),"FILE").shape});var nr=h({...te.shape,...W(l(),"DATE_TIME").shape});var ps=j(l(),H([ze,Be,Re,tr,He,Ze,qe,rr,nr])),or=h({...te.shape,properties:ps,...W(B(L()),"ARRAY").shape});var ir=h({...te.shape,...W(H([j(l(),L())]),"JSON").shape});var ds=H([ze,Re,ir,or,He]),Rf=j(l(),ds),Mo=h({refreshers:B(l()),...te.shape,...W(L(),"DYNAMIC").shape});var Zr=h({...te.shape,...W(ss(),"MARKDOWN").shape});var ar=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ar||{}),bt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(bt||{}),Tt=(P=>(P.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",P.COMMUNICATION="COMMUNICATION",P.COMMERCE="COMMERCE",P.CORE="CORE",P.UNIVERSAL_AI="UNIVERSAL_AI",P.FLOW_CONTROL="FLOW_CONTROL",P.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",P.ACCOUNTING="ACCOUNTING",P.PRODUCTIVITY="PRODUCTIVITY",P.CONTENT_AND_FILES="CONTENT_AND_FILES",P.DEVELOPER_TOOLS="DEVELOPER_TOOLS",P.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",P.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",P.HUMAN_RESOURCES="HUMAN_RESOURCES",P.PAYMENT_PROCESSING="PAYMENT_PROCESSING",P.MARKETING="MARKETING",P.SALES_AND_CRM="SALES_AND_CRM",P))(Tt||{});var sr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(sr||{}),Lo="both_client_credentials_and_authorization_code";var Ae=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ae||{}),ur=(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))(ur||{}),kf=h({strategy:K(ur),paramName:x(l())}),cr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(cr||{});var qr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(qr||{}),fs=h({status:x(Se()),body:x(L()),headers:x(j(l(),l()))}),ms=h({type:C("DELAY"),resumeDateTime:l(),requestIdToReply:x(l()),handlerId:x(l()),streamStepProgress:x(K(qr))}),hs=h({type:C("WEBHOOK"),requestId:l(),requestIdToReply:x(l()),response:fs,handlerId:x(l()),streamStepProgress:x(K(qr))}),Df=H([ms,hs]);var Cf=h({body:L(),rawBody:x(L()),headers:j(l(),l()),queryParams:j(l(),l())});function be(e){return e==null}a(be,"isNil");function lr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(lr,"isEmpty");function Gr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(Gr,"assertNotNullOrUndefined");var jo=Y(require("crypto"),1);var Nf=128,lt,It,Uf=a(e=>{!lt||lt.length<e?(lt=Buffer.allocUnsafe(e*Nf),jo.default.randomFillSync(lt),It=0):It+e>lt.length&&(jo.default.randomFillSync(lt),It=0),It+=e},"fillPool"),Mf=a(e=>(Uf(e|=0),lt.subarray(It-e,It)),"random"),Lf=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),c=o;for(;c--;)if(s+=e[u[c]&n]||"",s.length===i)return s}}},"customRandom"),ys=a((e,t=21)=>Lf(e,t,Mf),"customAlphabet");var jf="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vs=21,l$=l().check(et(new RegExp(`^[0-9a-zA-Z]{${vs}}$`))),Ff=ys(jf,vs);var nt=rt(tt(e=>e instanceof Date?e.toISOString():e),l()),De={id:l(),created:nt,updated:nt},ce=a(e=>x(Qt(e)),"Nullable");function Fo(e){return x(Qt(K(e)))}a(Fo,"NullableEnum");var f$=rt(tt(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),x(re())),Wr=a(e=>rt(tt(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),x(B(e))),"OptionalArrayFromQuery");var g$=j(l(),L());var pr=(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))(pr||{});var w$=l().check(et(/^#[0-9A-Fa-f]{6}$/));var O$=h({filename:l(),data:L(),type:C("file"),mimetype:x(l())});var Vf=Y(Ps());var U$=h({...De,name:l(),permissions:B(l()),platformId:ce(l()),type:l(),userCount:x(Se())});var xs=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(xs||{}),Vo=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Vo||{}),Bo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Bo||{});var Ho=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ho||{});var Zo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Zo||{});var Bf=h({mode:K(xs),value:L()}),Hf=h({auth:x(l()),fields:j(l(),Bf)}),Zf=h({pieceName:l(),pieceVersion:l(),actionName:l(),predefinedInput:x(Hf)}),qf=h({type:C("PIECE"),toolName:l().check(Ue(1)),pieceMetadata:Zf}),Gf=h({type:C("none")}),Wf=h({type:C("access_token"),accessToken:l()}),Kf=h({type:C("api_key"),apiKey:l(),apiKeyHeader:l()}),Jf=h({type:C("headers"),headers:j(l(),l())}),Xf=xt("type",[Gf,Wf,Kf,Jf]),bs=h({type:C("FLOW"),toolName:l().check(Ue(1)),externalFlowId:l(),flowDisplayName:x(l())}),Ts=h({type:C("MCP"),toolName:l().check(Ue(1)),serverUrl:is(),protocol:K(Bo),auth:Xf}),Is=h({type:C("KNOWLEDGE_BASE"),toolName:l().check(Ue(1)),sourceType:K(Vo),sourceId:l(),sourceName:l()}),Yf=xt("type",[qf,bs,Ts,Is]),Qf=h({displayName:l(),description:x(l()),type:K(Ho)}),Es=h({type:C("MARKDOWN"),markdown:l()}),Et={type:C("TOOL_CALL"),input:ce(j(l(),L())),output:x(L()),toolName:l(),status:K(Zo),toolCallId:l(),startTime:l(),endTime:x(l())},lO=h(Et),Ss=xt("toolCallType",[h({...Et,toolCallType:C("PIECE"),pieceName:l(),pieceVersion:l(),actionName:l()}),h({...Et,toolCallType:C("FLOW"),displayName:l(),externalFlowId:l()}),h({...Et,toolCallType:C("MCP"),displayName:l(),serverUrl:l()}),h({...Et,toolCallType:C("KNOWLEDGE_BASE"),displayName:l(),sourceType:l()}),h({...Et,toolCallType:C("UNKNOWN"),displayName:l()})]),em=H([Es,Ss]);var qo=(r=>(r.IMAGE="image",r.TEXT="text",r))(qo||{}),Ge=h({apiKey:l()}),tm=Ge,rm=h({apiKey:l(),apiKeyHash:l()}),nm=Ge,om=Ge,im=Ge,am=Ge,sm=Ge,um=Ge,cm=Ge,As=h({accessKeyId:l().check(Ue(1)),secretAccessKey:l().check(Ue(1))}),lm=h({}),pm=h({}),dm=h({}),fm=h({}),mm=h({}),hm=h({}),ws=h({modelId:l(),modelName:l(),modelType:K(qo)}),$s=h({apiKeyHeader:l(),baseUrl:l(),models:B(ws),defaultHeaders:x(j(l(),l()))}),Os=h({accountId:l(),gatewayId:l(),models:B(ws),vertexProject:x(l()),vertexRegion:x(l())}),zs=h({resourceName:l(),apiVersion:rt(tt(e=>typeof e=="string"&&e.trim().length===0?void 0:e),x(l()))}),Rs=h({region:l().check(Ue(1))}),gm=H([tm,im,am,sm,um,om,nm,rm,As,cm]),ks=H([$s,Os,zs,Rs,lm,dm,fm,mm,pm,hm]),ym=h({id:l(),name:l(),type:K(qo)}),vm=h({id:l(),name:l(),provider:K(pr),config:ks,enabledForChat:re()}),_m=h({provider:K(pr),config:ks,auth:gm,platformId:l()});var mO={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Pm=h({base64Url:l(),fileName:l(),extension:x(l())}),xm=h({mimeType:l(),url:l(),fileName:x(l())}),Go=H([Pm,xm]);var bm=H([h({type:C("file"),value:Go}),h({type:C("markdown"),value:l(),files:x(B(Go))})]),Tm=h({sessionId:l(),message:l(),files:x(B(l()))});var Cs=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Cs||{}),Ns=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ns||{}),Wo=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Wo||{});var Im=H([h({...De,name:l(),externalId:l(),type:C("STATIC_DROPDOWN"),tableId:l(),projectId:l(),data:h({options:B(h({value:l()}))})}),h({...De,name:l(),externalId:l(),type:H([C("TEXT"),C("NUMBER"),C("DATE")]),tableId:l(),projectId:l()})]),Em=h({...De,name:l(),folderId:ce(l()),projectId:l(),externalId:l(),status:Fo(Ns),trigger:Fo(Cs)}),Sm=h({...De,tableId:l(),projectId:l(),cells:j(l(),h({updated:l(),created:l(),value:L(),fieldName:l()}))}),Am=h({events:B(K(Wo)),webhookUrl:l(),flowId:l()}),wm=h({fields:B(h({id:l(),name:l()})),rows:B(j(l(),l())),name:l()}),$m=h({projectId:l(),limit:x(er.number()),cursor:x(l()),name:x(l()),externalIds:Wr(l()),folderId:x(l()),folderIds:Wr(l())}),Om=h({records:B(B(h({fieldId:l(),value:Ms()}))),tableId:l()}),zm=h({cells:x(B(h({fieldId:l(),value:Ms()}))),tableId:l(),agentUpdate:x(re())}),Us=xt("operator",[pt("eq"),pt("neq"),pt("gt"),pt("gte"),pt("lt"),pt("lte"),pt("co"),Ds("exists"),Ds("not_exists")]),Rm=h({tableId:l(),limit:x(er.number()),cursor:x(l()),filters:Wr(Us)});function Ms(){return rt(tt(e=>e==null?e:String(e)),Qt(l()))}a(Ms,"coerceToString");function pt(e){return h({fieldId:l(),operator:C(e),value:l()})}a(pt,"valueFilter");function Ds(e){return h({fieldId:l(),operator:C(e)})}a(Ds,"existenceFilter");var km=h({status:x(Se()),body:x(L()),headers:x(j(l(),l()))}),Dm=h({...De,deleted:ce(nt),ownerId:l(),displayName:l(),platformId:l(),externalId:ce(l())});var Ls=h({name:l(),description:x(l()),type:l(),required:re()}),Cm=h({pieceName:l(),triggerName:l(),input:h({toolName:l(),toolDescription:l(),inputSchema:B(Ls),returnsResponse:re()})});var js="^[0-9]+\\.[0-9]+\\.[0-9]+$",kO=new RegExp(js),Um="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",DO=l().check(et(new RegExp(js))),CO=l().check(et(new RegExp(Um))),Mm=h({packageType:C("ARCHIVE"),pieceType:K(bt),pieceName:l(),pieceVersion:l(),archiveId:l(),platformId:l()}),Fs=h({packageType:C("REGISTRY"),pieceType:C("OFFICIAL"),pieceName:l(),pieceVersion:l()}),Vs=h({packageType:C("REGISTRY"),pieceType:C("CUSTOM"),pieceName:l(),pieceVersion:l(),platformId:l()}),NO=H([Fs,Vs]),UO=H([Mm,Fs,Vs]),Bs=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(Bs||{}),Lm=h({type:K(Bs),cronExpression:l(),timezone:l()}),MO=h({...De,type:K(Ae),projectId:l(),flowId:l(),triggerName:l(),schedule:ce(Lm),flowVersionId:l(),pieceName:l(),pieceVersion:l(),deleted:ce(l()),simulate:re()}),Hs=(g=>(g.UNKNOWN="UNKNOWN",g.FLOW_RUN_LOG="FLOW_RUN_LOG",g.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",g.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",g.FLOW_STEP_FILE="FLOW_STEP_FILE",g.SAMPLE_DATA="SAMPLE_DATA",g.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",g.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",g.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",g.PROJECT_RELEASE="PROJECT_RELEASE",g.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",g.PLATFORM_ASSET="PLATFORM_ASSET",g.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",g.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",g.KNOWLEDGE_BASE="KNOWLEDGE_BASE",g.FLOW_BUNDLE="FLOW_BUNDLE",g))(Hs||{}),Zs=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Zs||{}),qs=(r=>(r.S3="S3",r.DB="DB",r))(qs||{}),LO=h({...De,projectId:ce(l()),platformId:ce(l()),type:K(Hs),compression:K(Zs),data:x(L()),location:K(qs),size:ce(Se()),fileName:ce(l()),s3Key:ce(l()),metadata:ce(j(l(),l()))}),Gs=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Gs||{}),Ws=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ws||{}),jO=h({id:l(),email:l(),firstName:l(),status:K(Ws),externalId:ce(l()),platformId:ce(l()),platformRole:K(Gs),lastName:l(),created:nt,updated:nt,lastActiveDate:ce(nt),imageUrl:ce(l())});var Ko=h({...te.shape,...W(j(l(),L()),"OBJECT").shape});var Ys=h({...te.shape,...W(l(),"COLOR").shape});var Jo=H([ze,Be,Zr,Ze,Re,He,Uo,tr,Mo,qe,or,Ko,ir,nr,rr,Ys]),T={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 Fe=h({displayName:l(),description:x(l())});var Qs=h({username:l(),password:l()}),Xo=h({...Fe.shape,username:h({displayName:l(),description:x(l())}),password:h({displayName:l(),description:x(l())}),...W(Qs,"BASIC_AUTH").shape});var Bm=j(l(),H([ze,Be,qe,Ze,Re])),Yo=h({...Fe.shape,props:Bm,...W(L(),"CUSTOM_AUTH").shape});var dt=h({...Fe.shape,...W(h({auth:l()}),"SECRET_TEXT").shape});var Hm=j(l(),H([ze,Be,dt,qe,Ze,Re,He,Zr])),eu=h({...Fe.shape,props:Hm,...W(L(),"OIDC").shape});var Qo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Qo||{}),tu=H([ze,dt,Re]),ru=j(l(),tu),Zm=h({props:x(j(l(),tu)),authUrl:l(),tokenUrl:l(),scope:B(l()),prompt:x(H([C("none"),C("consent"),C("login"),C("omit")])),pkce:x(re()),pkceMethod:x(H([C("plain"),C("S256")])),authorizationMethod:x(K(Qo)),grantType:x(H([K(sr),C(Lo)])),extra:x(j(l(),l()))}),nu=h({access_token:l(),props:x(ru),data:j(l(),Yt())}),ei=h({...Fe.shape,...Zm.shape,...W(nu,"OAUTH2").shape});var St=H([Xo,Yo,eu,ei,dt]),dr="Connection",ti={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||dr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||dr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||dr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||dr}},None(){}};var vR={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 qm=h({...te.shape,...W(L(),"CUSTOM").shape,code:l()});var Gm=H([Jo,St]),ri=j(l(),Gm),MR=j(l(),Jo);var ou=H([h({strategy:C("CRON"),cronExpression:l()}),h({strategy:C("NONE")})]),At=class{constructor(t,r,n,o,i,s,u,c,d,f,v,y,p,m,_,g,P,I,Z){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=c;this.renewConfiguration=d;this.onRenew=f;this.onEnable=v;this.onDisable=y;this.onStart=p;this.run=m;this.test=_;this.sampleData=g;this.testStrategy=P;this.outputSchema=I;this.aiMetadata=Z}static{a(this,"ITrigger")}},Ie=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,be(e.sampleData)&&be(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var iu="2",Jr="0.82.0";var ni=class{constructor(t,r,n,o,i,s,u,c,d=Jr,f,v=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=u;this.auth=c;this.minimumSupportedRelease=d;this.maximumSupportedRelease=f;this.description=v;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:iu}),"getContextInfo");(!Wm(d)||Km(d,Jr))&&(this.minimumSupportedRelease=Jr),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}},au=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 ni(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Wm(e){return/^\d+\.\d+\.\d+$/.test(e)}a(Wm,"isValidSimpleSemver");function Km(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(Km,"isSemverLessThan");var Jm=x(j(l(),j(l(),l()))),su=h({id:x(l()),name:l(),displayName:l(),logoUrl:l(),description:l(),authors:B(l()),platformId:x(l()),directoryPath:x(l()),auth:x(H([St,B(St)])),version:l(),categories:x(B(K(Tt))),minimumSupportedRelease:x(l()),maximumSupportedRelease:x(l()),i18n:Jm}),Xm=K(["human","ai","both"]),uu=h({description:x(l()),idempotent:x(re())}),cu=h({name:l(),displayName:l(),description:l(),props:ri,requireAuth:re(),errorHandlingOptions:x(No),outputSchema:x(Br()),audience:x(Xm),aiMetadata:x(uu)}),lu=h({name:l(),displayName:l(),description:l(),props:ri,errorHandlingOptions:x(No),type:K(Ae),sampleData:L(),handshakeConfiguration:x(Br()),renewConfiguration:x(ou),testStrategy:K(cr),outputSchema:x(Br()),aiMetadata:x(uu)}),Ym=h({...su.shape,actions:j(l(),cu),triggers:j(l(),lu)}),Qm=h({...su.shape,actions:Se(),triggers:Se(),suggestedActions:x(B(lu)),suggestedTriggers:x(B(cu))}),pu=h({projectUsage:Se(),tags:x(B(l())),pieceType:K(bt),packageType:K(ar),platformId:x(l()),archiveId:x(l())}),Mk=h({...Ym.shape,...pu.shape}),Lk=h({...Qm.shape,...pu.shape}),jk=h({name:l(),version:l()});var eh=Y(require("path")),th=Y(require("fs/promises"));var Xr=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 Yr=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new oi,r=new ii){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},oi=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},ii=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 Qr=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 en=class extends Xr{static{a(this,"FetchHttpClient")}constructor(t="",r=new Yr){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[Z,ge]of Object.entries(s))o.append(Z,ge);let u=o.toString(),c=u?`${n}?${u}`:n,d=t.responseType??"json",f=t.followRedirects??!0,v=t.retries??0,{body:y,extraHeaders:p,isStream:m}=rh(t.body,i),_=oh({...i,...p}),g=await nh(async()=>{let Z=new AbortController,ge=t.timeout&&t.timeout>0?setTimeout(()=>Z.abort(),t.timeout):void 0;try{let Ee={method:t.method.toString(),headers:_,body:y,redirect:f?"follow":"manual",signal:Z.signal};return m&&(Ee.duplex="half"),r?.dispatcher!==void 0&&(Ee.dispatcher=r.dispatcher),await fetch(c,Ee)}finally{ge!==void 0&&clearTimeout(ge)}},v),P=f?300:400;if(g.status<200||g.status>=P){let Z=await du(g,d),ge=new Qr(t.body,{status:g.status,responseBody:Z});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ge),ge}let I=await du(g,d);return{status:g.status,headers:ih(g.headers),body:I}}};function rh(e,t){return sh(e)?{body:void 0,extraHeaders:{},isStream:!1}:ah(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(rh,"serializeBody");async function du(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(du,"parseResponseBody");async function nh(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await fu(n);continue}return o}catch(o){if(r=o,n<t){await fu(n);continue}throw o}throw r}a(nh,"sendWithRetries");function fu(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(fu,"backoff");function oh(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(oh,"normalizeHeaders");function ih(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(ih,"toHttpHeaders");function ah(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}a(ah,"isNodeFormData");function sh(e){return e==null}a(sh,"isNil");var mu=new en;var ai=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(ai||{});var Wg=Y(require("fs")),Pl=Y(_l());var Kg={"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 Jg(e){let t=e.split(";")[0].trim().toLowerCase();return Kg[t]??""}a(Jg,"contentTypeToExtension");var Xg=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Yg=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 xl({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:c="headers"}){return ee({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:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:d})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
6
|
+
i.e ${Yg(t,d)}/resource or /resource`,required:!0,defaultValue:d?t(d):"",...s?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ai).map(d=>({label:d,value:d}))},...s?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:T.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:T.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=T.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":v.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":v.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return v},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...u},run:a(async d=>{let{method:f,url:v,headers:y,queryParams:p,body:m,body_type:_,failsafe:g,timeout:P,response_is_binary:I,followRedirects:Z}=d.propsValue;Gr(f,"Method"),Gr(v,"URL");let ge=be(r)?{}:await r(d.auth,d.propsValue),Ee=v.url,Le=Ee.startsWith("http://")||Ee.startsWith("https://")?Ee:Xg({baseUrl:t(d.auth),relativePath:Ee}),ne={method:f,url:Le,headers:{...y??{},...c==="headers"||!be(c)?ge:{}},queryParams:{...c==="queryParams"?ge:{},...p??{}},timeout:P?P*1e3:0,followRedirects:Z};if(I&&(ne.responseType="arraybuffer"),m)if(_&&_!=="none"){let J=m.data;if(_==="form_data"){let gt=J,st=new Pl.default;for(let{fieldName:V,fieldType:w,textFieldValue:E,fileFieldValue:R}of gt)w==="text"&&!lr(E)?st.append(V,E):w==="file"&&!lr(R)&&st.append(V,R.data,{filename:R?.filename});ne.body=st,ne.headers={...ne.headers,...st.getHeaders()}}else ne.body=J}else _||(ne.body=m);try{let J=await mu.sendRequest(ne);return await Qg(d.files,J.body,J.status,J.headers,I)}catch(J){if(g)return J.errorMessage();throw J}},"run")})}a(xl,"createCustomApiCallAction");var Qg=a(async(e,t,r,n,o)=>{let i;if(o&&ey(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=Jg(s??"")||"txt",c;t instanceof ArrayBuffer?c=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?c=t:c=Buffer.from(t),i=await e.write({fileName:`output.${u}`,data:c})}else i=t;return{status:r,headers:n,body:i}},"handleBinaryResponse"),ey=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ie={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(be(u))throw new Error("lastPoll doesn't exist in the store.");let c=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:u,server:s}),d=c.reduce((f,v)=>Math.max(f,v.epochMilliSeconds),u);return await t.put("lastPoll",d),c.filter(f=>f.epochMilliSeconds>u).map(f=>f.data)}case 1:{let u=await t.get("lastItem"),c=await e.items({store:t,auth:r,propsValue:n,lastItemId:u,files:i,server:s}),d=c.findIndex(y=>y.id===u),f=[];be(u)||d==-1?f=c??[]:f=c?.slice(0,d)??[],be(o)||(f=f.slice(-o));let v=f?.[0]?.id;return be(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;be(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 ty(s.map(u=>u.data))}};function ty(e){return e.length<=5?e:e.slice(0,5)}a(ty,"getFirstFiveOrAll");var gr="login.microsoftonline.com",Tl="login.microsoftonline.us",bl={[gr]:"https://graph.microsoft.com",[Tl]:"https://graph.microsoft.us"},Il=T.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:Tl}]}});function ry(e){return e??gr}a(ry,"resolveCloudHost");function S(e){let t=ry(e);return bl[t]??bl[gr]}a(S,"getGraphBaseUrl");var ny=`
|
|
7
|
+
If you'd like to use your own custom Azure app instead of the default app, follow the [Azure app creation guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application),
|
|
8
|
+
set the **Redirect URI** to {{redirectUrl}} and add the following **Microsoft Graph (Delegated) permissions** under **API permissions**:
|
|
9
|
+
- Sites.Read.All
|
|
10
|
+
- Sites.ReadWrite.All
|
|
11
|
+
- Sites.Manage.All
|
|
12
|
+
- Files.ReadWrite.All
|
|
13
|
+
- openid
|
|
14
|
+
- email
|
|
15
|
+
- profile
|
|
16
|
+
- offline_access`,$=ti.OAuth2({description:ny,props:{cloud:Il},authUrl:"https://{cloud}/common/oauth2/v2.0/authorize",tokenUrl:"https://{cloud}/common/oauth2/v2.0/token",required:!0,scope:["openid","email","profile","offline_access","Sites.Read.All","Sites.ReadWrite.All","Sites.Manage.All","Files.ReadWrite.All"],prompt:"omit"});var Je=Y(se());var Lp=a(e=>T.Dropdown({auth:$,displayName:e.displayName,required:!0,refreshers:e.refreshers,options:a(async({auth:t,...r})=>{let n=r[e.refreshers[0]];if(!t||!n)return{disabled:!0,placeholder:"Please select a site first.",options:[]};let o=t,i=o.props?.cloud,s=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(o.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=await s.api(`/sites/${n}/drives`).select("id,name").get();for(;c.value.length>0;){for(let d of c.value)u.push({label:d.name,value:d.id});if(c["@odata.nextLink"])c=await s.api(c["@odata.nextLink"]).get();else break}return{disabled:!1,options:u}},"options")}),"createDriveDropdown"),A={siteId:T.Dropdown({auth:$,displayName:"Site",required:!0,refreshers:[],options:a(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Please connect your account first.",options:[]};let t=e,r=t.props?.cloud,n=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(t.access_token),"getAccessToken")},baseUrl:S(r)}),o=[],i=await n.api("/sites?search=*&$select=displayName,id,name").get();for(;i.value.length>0;){for(let s of i.value)o.push({label:s.displayName,value:s.id});if(i["@odata.nextLink"])i=await n.api(i["@odata.nextLink"]).get();else break}return{disabled:!1,options:o}},"options")}),driveId:Lp({displayName:"Drive",refreshers:["siteId"]}),createDriveDropdown:Lp,itemId:T.Dropdown({auth:$,displayName:"Source File or Folder",required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Please select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[],u=await i.api(`/sites/${t}/drives/${r}/root/children?$select=id,name,folder,file`).get();for(;u.value.length>0;){for(let c of u.value){let d=c.folder?"[Folder] ":"[File] ";s.push({label:d+c.name,value:c.id})}if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),destinationFolderId:T.Dropdown({auth:$,displayName:"Destination Folder",description:"The folder to copy the item into. Defaults to the root of the drive.",required:!1,refreshers:["destination_site_id","destination_drive_id"],options:a(async({auth:e,...t})=>{let r=t.destination_site_id,n=t.destination_drive_id;if(!e||!r||!n)return{disabled:!0,placeholder:"Select a destination site and drive first.",options:[]};let o=e,i=o.props?.cloud,s=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(o.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=await s.api(`/sites/${r}/drives/${n}/root/children?$filter=folder ne null&$select=id,name`).get();for(;c.value.length>0;){for(let d of c.value)u.push({label:d.name,value:d.id});if(c["@odata.nextLink"])c=await s.api(c["@odata.nextLink"]).get();else break}return{disabled:!1,options:u}},"options")}),listId:T.Dropdown({auth:$,displayName:"List",required:!0,refreshers:["siteId"],options:a(async({auth:e,siteId:t})=>{if(!e||!t)return{disabled:!0,placeholder:"Please select a site first.",options:[]};let r=e,n=r.props?.cloud,o=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(r.access_token),"getAccessToken")},baseUrl:S(n)}),i=[],s=await o.api(`/sites/${t}/lists`).select("displayName,id").get();for(;s.value.length>0;){for(let u of s.value)i.push({label:u.displayName,value:u.id});if(s["@odata.nextLink"])s=await o.api(s["@odata.nextLink"]).get();else break}return{disabled:!1,options:i}},"options")}),listColumns:T.DynamicProperties({auth:$,displayName:"List Columns",refreshers:["siteId","listId"],required:!0,props:a(async({auth:e,siteId:t,listId:r})=>{if(!e||!t||!r)return{};let n={},o=e,i=o.props?.cloud,s=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(o.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=await s.api(`/sites/${t}/lists/${r}/columns`).get();for(;c.value.length>0;){for(let d of c.value)d.readOnly||u.push(d);if(c["@odata.nextLink"])c=await s.api(c["@odata.nextLink"]).get();else break}for(let d of u){let f={displayName:d.displayName,description:d.description??"",required:!1};d.boolean?n[d.name]=T.Checkbox(f):d.text?n[d.name]=T.LongText(f):d.dateTime?n[d.name]=T.DateTime(f):d.choice?d.choice.displayAs==="checkBoxes"?n[d.name]=T.StaticMultiSelectDropdown({...f,options:{disabled:!1,options:d.choice?.choices?d.choice.choices.map(v=>({label:v,value:v})):[]}}):n[d.name]=T.StaticDropdown({...f,options:{disabled:!1,options:d.choice?.choices?d.choice.choices.map(v=>({label:v,value:v})):[]}}):d.number?n[d.name]=T.Number(f):d.currency&&(n[d.name]=T.Number(f))}return n},"props")}),listItemId:T.Dropdown({auth:$,displayName:"List Item",required:!0,refreshers:["siteId","listId"],options:a(async({auth:e,siteId:t,listId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Please select a site and list first.",options:[]};let n=e,o=n.props?.cloud,i=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[],u=await i.api(`/sites/${t}/lists/${r}/items?$select=id&$expand=fields($select=Title)`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.fields.Title??`Item ${c.id}`,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),pageId:T.Dropdown({auth:$,displayName:"Page",required:!0,refreshers:["siteId"],options:a(async({auth:e,siteId:t})=>{if(!e||!t)return{disabled:!0,placeholder:"Please select a site first.",options:[]};let r=e,n=r.props?.cloud,o=Je.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(r.access_token),"getAccessToken")},baseUrl:S(n)}),i=[],s=await o.api(`/sites/${t}/pages?$select=id,title`).get();for(;s.value.length>0;){for(let u of s.value)i.push({label:u.title??`Page ${u.id}`,value:u.id});if(s["@odata.nextLink"])s=await o.api(s["@odata.nextLink"]).get();else break}return{disabled:!1,options:i}},"options")})};var jp=Y(se());var Fp=ee({auth:$,name:"microsoft_sharepoint_create_folder",displayName:"Create Folder",description:"Creates a new folder at path you specify.",audience:"both",aiMetadata:{description:"Creates a folder at a given path inside a SharePoint document library (drive), creating it relative to a parent folder path or the drive root. Use to provision a destination folder before uploading or moving files. Requires the target site and drive; the folder is keyed on its path, so re-running with the same path leaves the existing folder in place rather than producing a duplicate.",idempotent:!0},props:{siteId:A.siteId,driveId:A.driveId,parentFolder:T.ShortText({displayName:"Parent Folder",description:'Parent folder,like "/demo/" or "/docs/assignment/".Leave it default if you want to create folder at the root (**/**) level.',required:!0,defaultValue:"/"}),folderName:T.ShortText({displayName:"Folder Name",required:!0})},async run(e){let{driveId:t,parentFolder:r,folderName:n}=e.propsValue,o=e.auth.props?.cloud,i=jp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}),s=r+n;return await i.api(`/drives/${t}/root:${s}`).patch({folder:{}})}});var Vp=Y(se());var Bp=ee({auth:$,name:"microsoft_sharepoint_create_list",displayName:"Create List",description:"Creates a new list.",audience:"both",aiMetadata:{description:"Creates a new SharePoint list (with a display name and description) on a given site. Use when an agent needs a fresh list to hold structured items. Not idempotent: each call creates another list even if one with the same name already exists.",idempotent:!1},props:{siteId:A.siteId,displayName:T.ShortText({displayName:"List Name",required:!0}),description:T.ShortText({displayName:"List Description",required:!0})},async run(e){let{siteId:t,displayName:r,description:n}=e.propsValue,o=e.auth.props?.cloud,i=Vp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}),s={displayName:r,description:n};return await i.api(`/sites/${t}/lists`).post(s)}});var Hp=Y(se());var Zp=ee({auth:$,name:"microsoft_sharepoint_create_list_item",displayName:"Create List Item",description:"Creates a new item in a list.",audience:"both",aiMetadata:{description:"Adds a new item (row) to a SharePoint list on a given site, setting the list column field values you provide. Use to record a new entry in an existing list. Not idempotent: each call appends another item, so repeating it creates duplicates.",idempotent:!1},props:{siteId:A.siteId,listId:A.listId,listColumns:A.listColumns},async run(e){let{siteId:t,listId:r,listColumns:n}=e.propsValue,o=e.auth.props?.cloud,i=Hp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}),s={};Object.entries(n).forEach(([c,d])=>{Array.isArray(d)&&(s[`${c}@odata.type`]="Collection(Edm.String)")});let u={fields:{...n,...s}};return await i.api(`/sites/${t}/lists/${r}/items`).post(u)}});var qp=Y(se());var Gp=ee({auth:$,name:"microsoft_sharepoint_delete_list_item",displayName:"Delete List Item",description:"Deletes an existing item from a list.",audience:"both",aiMetadata:{description:"Permanently removes an item from a SharePoint list, identified by its list item ID on a given site. Use to clean up or retract a specific row. Destructive but idempotent: once the item is gone, repeating the call with the same ID leaves the list unchanged.",idempotent:!0},props:{siteId:A.siteId,listId:A.listId,listItemId:A.listItemId},async run(e){let{siteId:t,listId:r,listItemId:n}=e.propsValue,o=e.auth.props?.cloud;return await qp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}).api(`/sites/${t}/lists/${r}/items/${n}`).delete()}});var Wp=Y(se());var Kp=ee({auth:$,name:"microsoft_sharepoint_search_list_item",displayName:"Find List Item",description:"Finds a item in a list based on name.",audience:"both",aiMetadata:{description:"Looks up items in a SharePoint list by exact Title match on a given site, returning the matching items with their fields. Use to resolve a list item ID (or confirm existence) before updating or deleting it. Read-only and idempotent; matches only the Title column, not arbitrary fields.",idempotent:!0},props:{siteId:A.siteId,listId:A.listId,searchValue:T.ShortText({displayName:"Title",description:"Item title to search",required:!0})},async run(e){let{siteId:t,listId:r,searchValue:n}=e.propsValue,o=e.auth.props?.cloud,i=Wp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}),s=n.replaceAll("'","''");return await i.api(`/sites/${t}/lists/${r}/items?$expand=fields&filter=fields/Title eq '${s}'`).headers({Prefer:"HonorNonIndexedQueriesWarningMayFailRandomly"}).get()}});var Jp=Y(se());var Xp=ee({auth:$,name:"microsoft_sharepoint_update_list_item",displayName:"Update List Item",description:"Updates an existing item in a list.",audience:"both",aiMetadata:{description:"Updates the column field values of an existing item in a SharePoint list, identified by its list item ID on a given site. Use to edit a known row rather than create one. Requires a valid item ID; idempotent, since re-applying the same field values leaves the item in the same final state.",idempotent:!0},props:{siteId:A.siteId,listId:A.listId,listItemId:A.listItemId,listColumns:A.listColumns},async run(e){let{siteId:t,listId:r,listItemId:n,listColumns:o}=e.propsValue,i=e.auth.props?.cloud,s=Jp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(i)}),u={};Object.entries(o).forEach(([d,f])=>{Array.isArray(f)&&(u[`${d}@odata.type`]="Collection(Edm.String)")});let c={...o,...u};return await s.api(`/sites/${t}/lists/${r}/items/${n}/fields`).patch(c)}});var Yp=Y(se());var Qp=ee({auth:$,name:"microsoft_sharepoint_upload_file",displayName:"Upload File",description:"Uploads a new file at path you specify.",audience:"both",aiMetadata:{description:"Uploads file content to a SharePoint document library (drive), placing it under a parent folder path with the file name you specify. Use to push a file (from a prior step or URL) into a site. Idempotent on the target path: uploading the same name to the same folder replaces the existing file rather than creating a duplicate.",idempotent:!0},props:{siteId:A.siteId,driveId:A.driveId,file:T.File({displayName:"File",description:"The file or url you want to upload",required:!0}),parentFolder:T.ShortText({displayName:"Parent Folder",description:'Parent folder, like "/demo/" or "/docs/assignment/".Leave it default if you want to create folder at the root (**CHANGE THIS BACK//**) level.',required:!0,defaultValue:"/"}),fileName:T.ShortText({displayName:"File Name",required:!0})},async run(e){let{siteId:t,driveId:r,file:n,parentFolder:o,fileName:i}=e.propsValue,s=e.auth.props?.cloud,u=Yp.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(s)}),d=(await u.api(`/sites/${t}/drives/${r}/root:${o}`).get()).id??"test";return await u.api(`/sites/${t}/drives/${r}/items/${d}:/${i}:/content`).put(n.data)}});var co=Y(se());var ed=2e3,T_=120;async function I_(e){return new Promise(t=>setTimeout(t,e))}a(I_,"delay");var td=ee({auth:$,name:"microsoft_sharepoint_copy_item",displayName:"Copy File or Folder (Across Sites)",description:"Copy a file or folder from one site to another within the same tenant, with overwrite option.",audience:"both",aiMetadata:{description:"Copies a file or folder from one SharePoint site/drive to a destination site, drive, and folder within the same tenant, optionally renaming the copy. Use to duplicate content across sites; for same-site copies use the within-site variant. The conflict behavior (fail, replace, or rename) controls what happens on a name clash. Not idempotent: each run produces another copy (rename mode) or overwrites the target (replace mode).",idempotent:!1},props:{siteId:A.siteId,driveId:A.driveId,itemId:A.itemId,destination_site_id:A.siteId,destination_drive_id:A.createDriveDropdown({displayName:"Destination Drive",refreshers:["destination_site_id"]}),destination_folder_id:A.destinationFolderId,new_name:T.ShortText({displayName:"New Name (Optional)",description:"A new name for the copied item. If not provided, the original name is used.",required:!1}),conflict_behavior:T.StaticDropdown({displayName:"Conflict Behavior",description:"Action to take if a file with the same name already exists.",required:!0,options:{options:[{label:"Fail on conflict",value:"fail"},{label:"Overwrite existing file",value:"replace"},{label:"Rename with a number",value:"rename"}]},defaultValue:"fail"})},async run(e){let{siteId:t,driveId:r,itemId:n,destination_drive_id:o,destination_folder_id:i,new_name:s,conflict_behavior:u}=e.propsValue,c=e.auth.props?.cloud,d=co.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(c)}),f={parentReference:{driveId:o}};i&&(f.parentReference.id=i),s&&(f.name=s);let v;try{v=await d.api(`/drives/${r}/items/${n}/copy`).responseType(co.ResponseType.RAW).query({"@microsoft.graph.conflictBehavior":u}).post(f)}catch(m){throw m.statusCode===400?new Error(`Invalid request: ${m.message||"Check your input parameters"}`):m.statusCode===403?new Error("Insufficient permissions to copy this item. Requires Files.ReadWrite or higher."):m.statusCode===404?new Error("Source item not found. Please verify the site, drive, and item IDs."):new Error(`Failed to initiate copy operation: ${m.message||"Unknown error"}`)}let y=v.headers.get("Location");if(!y)throw new Error("Could not get monitor URL from copy operation response.");let p=T_*1e3/ed;for(;p>0;){let m=await d.api(y).get();if(m.status==="completed")return{success:!0,status:"completed",resourceId:m.resourceId,resourceLocation:m.resourceLocation};if(m.status==="failed"){let _=m.error?.details?m.error.details.map(g=>g.message||g.code).join(", "):m.error?.message||"Unknown error";throw new Error(`Copy operation failed: ${_}`)}await I_(ed),p--}throw new Error("Copy operation timed out after 120 seconds.")}});var Tr=Y(se());var rd=2e3,E_=120;async function S_(e){return new Promise(t=>setTimeout(t,e))}a(S_,"delay");var nd=ee({auth:$,name:"microsoft_sharepoint_copy_item_within_site",displayName:"Copy File or Folder (Within Site)",description:"Copy a file or folder to another folder within the same site.",audience:"both",aiMetadata:{description:"Copies a file or folder to another folder within the same SharePoint site and drive, optionally renaming the copy; select the root to copy to the drive top level. Use for same-site duplication; for cross-site copies use the across-sites variant. The conflict behavior (fail, replace, or rename) controls name clashes. Not idempotent: each run produces another copy (rename mode) or overwrites the target (replace mode).",idempotent:!1},props:{siteId:A.siteId,driveId:A.driveId,itemId:A.itemId,destinationFolderId:T.Dropdown({auth:$,displayName:"Destination Folder",description:'The folder to copy the item into. Select "Root" to copy to the top level of the drive.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Tr.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root",value:"root"}],u=await i.api(`/sites/${t}/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),newName:T.ShortText({displayName:"New Name (Optional)",description:"A new name for the copied item. If not provided, the original name is used.",required:!1}),conflictBehavior:T.StaticDropdown({displayName:"Conflict Behavior",description:"Action to take if a file with the same name already exists in the destination.",required:!0,options:{options:[{label:"Fail on conflict",value:"fail"},{label:"Overwrite existing file",value:"replace"},{label:"Rename with a number",value:"rename"}]},defaultValue:"fail"})},async run(e){let{siteId:t,driveId:r,itemId:n,destinationFolderId:o,newName:i,conflictBehavior:s}=e.propsValue,u=e.auth.props?.cloud,c=Tr.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(u)}),f={parentReference:{id:o==="root"?(await c.api(`/drives/${r}/root`).get()).id:o}};i&&(f.name=i);let v;try{v=await c.api(`/drives/${r}/items/${n}/copy`).responseType(Tr.ResponseType.RAW).query({"@microsoft.graph.conflictBehavior":s}).post(f)}catch(m){throw m.statusCode===400?new Error(`Invalid request: ${m.message||"Check your input parameters"}`):m.statusCode===403?new Error("Insufficient permissions to copy this item. Requires Files.ReadWrite or higher."):m.statusCode===404?new Error("Source item not found. Please verify the site, drive, and item IDs."):new Error(`Failed to initiate copy operation: ${m.message||"Unknown error"}`)}let y=v.headers.get("Location");if(!y)throw new Error("Could not get monitor URL from copy operation response.");let p=E_*1e3/rd;for(;p>0;){let m=await c.api(y).get();if(m.status==="completed")return{success:!0,status:"completed",resourceId:m.resourceId,resourceLocation:m.resourceLocation};if(m.status==="failed"){let _=m.error?.details?m.error.details.map(g=>g.message||g.code).join(", "):m.error?.message||"Unknown error";throw new Error(`Copy operation failed: ${_}`)}await S_(rd),p--}throw new Error("Copy operation timed out after 120 seconds.")}});var Xi=Y(se());var od=ee({auth:$,name:"microsoft_sharepoint_find_file",displayName:"Find File",description:"Look up a file by its name or path.",audience:"both",aiMetadata:{description:"Locates files in a SharePoint document library (drive) on a given site, either by exact path from the drive root or by keyword search on the file name (optionally scoped to a folder). Use to resolve a file ID/metadata before downloading, moving, or copying. Read-only and idempotent; path mode returns an empty result rather than erroring when the file is missing.",idempotent:!0},props:{siteId:A.siteId,driveId:A.driveId,findMethod:T.StaticDropdown({displayName:"Find Method",description:"Choose how to find the file.",required:!0,options:{options:[{label:"Find by Exact Path",value:"path"},{label:"Search by Name",value:"search"}]},defaultValue:"search"}),filePath:T.ShortText({displayName:"File Path",description:"The exact path to the file from the drive's root. **Required if finding by path.** Example: `Documents/Reports/Q1-Report.docx`",required:!1}),searchQuery:T.ShortText({displayName:"Search Query",description:"The file name or keyword to search for. **Required if searching by name.** Example: `Q1-Report.docx`",required:!1}),searchFolderId:T.Dropdown({auth:$,displayName:"Folder to Search In (Optional)",description:"The folder to search within. If not specified, the entire drive will be searched. **Only applies when searching by name.**",required:!1,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Xi.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[],u=await i.api(`/sites/${t}/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")})},async run(e){let{driveId:t,findMethod:r,filePath:n,searchQuery:o,searchFolderId:i}=e.propsValue,s=e.auth.props?.cloud,u=Xi.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(s)});if(r==="path"){if(!n)throw new Error("File Path is required when finding by path.");let c=n.startsWith("/")?n.substring(1):n;try{return{success:!0,files:[await u.api(`/drives/${t}/root:/${encodeURI(c)}`).get()]}}catch(d){let f=d;if(f.statusCode===404)return{success:!0,files:[]};throw new Error(`Failed to find file by path: ${f.message||"Unknown error"}`)}}else{if(!o)throw new Error("Search Query is required when searching by name.");let c=`/drives/${t}/`;i?c+=`items/${i}/`:c+="root/",c+=`search(q='${encodeURIComponent(o)}')`;try{return{success:!0,files:(await u.api(c).get()).value||[]}}catch(d){throw new Error(`Failed to search for file: ${d.message||"Unknown error"}`)}}}});var Yi=Y(se());var id=ee({auth:$,name:"microsoft_sharepoint_get_folder_contents",displayName:"Get Folder Contents",description:"List all files and subfolders in a specified folder, optionally with detailed metadata.",audience:"both",aiMetadata:{description:"Lists the immediate files and subfolders of a folder in a SharePoint document library (drive) on a given site, with optional paging, field selection, sorting, and inclusion of custom SharePoint column metadata. Use to enumerate or browse a folder one level deep. Read-only and idempotent; returns one page (default 200 items) with an @odata.nextLink for further pages.",idempotent:!0},props:{siteId:A.siteId,driveId:A.driveId,folderId:T.Dropdown({auth:$,displayName:"Folder",description:'The folder whose contents you want to list. Select "Root Folder" for the top-level folder.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Yi.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root Folder",value:"root"}],u=await i.api(`/sites/${t}/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),includeCustomFields:T.Checkbox({displayName:"Include Custom Metadata",description:"Check this to include SharePoint-specific metadata (custom columns). This may slow down the request.",required:!1,defaultValue:!1}),top:T.Number({displayName:"Page Size",description:"The maximum number of items to return. The API default is 200. If more items exist, the output will contain a field `@odata.nextLink` that you can use in a custom API call to get the next page.",required:!1}),select:T.ShortText({displayName:"Select Fields (Optional)",description:"A comma-separated list of properties to return. Example: `id,name,size,webUrl`",required:!1}),orderby:T.ShortText({displayName:"Order By (Optional)",description:"Specifies how to sort the returned items. Example: `name asc` or `lastModifiedDateTime desc`",required:!1})},async run(e){let{siteId:t,driveId:r,folderId:n,includeCustomFields:o,top:i,select:s,orderby:u}=e.propsValue,c=e.auth.props?.cloud,d=Yi.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(c)}),f=n==="root"?`/sites/${t}/drive/root/children`:`/sites/${t}/drive/items/${n}/children`,v={};return o&&(v.$expand="listItem(expand=fields)"),i&&(v.$top=i),s&&(v.$select=s),u&&(v.$orderby=u),(await d.api(f).query(v).get()).value||[]}});var ad=Y(se());var sd=ee({auth:$,name:"microsoft_sharepoint_get_site_information",displayName:"Get Site Information",description:"Fetch metadata of a SharePoint site (site ID, title, URL, description, etc.).",audience:"both",aiMetadata:{description:"Fetches metadata for a single SharePoint site by its site ID (title, URL, description, and similar properties), with optional field selection. Use to inspect or confirm site details once you have its ID. Read-only and idempotent.",idempotent:!0},props:{siteId:A.siteId,select:T.ShortText({displayName:"Select Fields (Optional)",description:"A comma-separated list of properties to return. If left blank, all default properties are returned. Example: `id,displayName,webUrl,description`",required:!1})},async run(e){let{siteId:t,select:r}=e.propsValue,n=e.auth.props?.cloud,i=ad.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)}).api(`/sites/${t}`);return r&&i.select(r.split(",").map(s=>s.trim())),await i.get()}});var ud=Y(se());var cd=ee({auth:$,name:"microsoft_sharepoint_find_site",displayName:"Find Site",description:"Search for SharePoint sites by name and return matching results.",audience:"both",aiMetadata:{description:"Searches SharePoint sites across the tenant by a name keyword and returns matching sites with their IDs, names, and URLs. Use as the entry point to resolve a site ID needed by other SharePoint actions. Read-only and idempotent.",idempotent:!0},props:{searchTerm:T.ShortText({displayName:"Site Name",description:"The name or keyword to search for.",required:!0})},async run(e){let{searchTerm:t}=e.propsValue,r=e.auth.props?.cloud,n=ud.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(r)}),o=[],i=await n.api(`/sites?search=${encodeURIComponent(t)}&$select=displayName,id,name,webUrl`).get();for(;i.value.length>0;){for(let s of i.value)o.push({id:s.id,displayName:s.displayName,name:s.name,webUrl:s.webUrl});if(i["@odata.nextLink"])i=await n.api(i["@odata.nextLink"]).get();else break}return{sites:o}}});var lo=Y(se());var ld=ee({auth:$,name:"microsoft_sharepoint_move_file",displayName:"Move File",description:"Move a file from one folder to another within the same drive.",audience:"both",aiMetadata:{description:"Moves a file to a different folder within the same SharePoint drive, optionally renaming it in the process; select the root to move to the drive top level. Use to relocate an existing file rather than copy it. Idempotent: moving a file already at the destination (with the same name) leaves it where it is.",idempotent:!0},props:{siteId:A.siteId,driveId:A.driveId,fileId:T.Dropdown({auth:$,displayName:"File to Move",description:"The file you want to move.",required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=lo.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[],u=await i.api(`/drives/${r}/root/children?$select=id,name,file`).get();for(;u.value.length>0;){for(let c of u.value)c.file&&s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),destinationFolderId:T.Dropdown({auth:$,displayName:"Destination Folder",description:'The folder to move the file into. Select "Root" to move to the top level of the drive.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=lo.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root",value:"root"}],u=await i.api(`/sites/${t}/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")}),newName:T.ShortText({displayName:"New Name (Optional)",description:"Provide a new name to rename the file during the move.",required:!1})},async run(e){let{driveId:t,fileId:r,destinationFolderId:n,newName:o}=e.propsValue,i=e.auth.props?.cloud,s=lo.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(i)});try{let c={parentReference:{id:n==="root"?(await s.api(`/drives/${t}/root`).get()).id:n}};return o&&(c.name=o),{success:!0,message:"File moved successfully",item:await s.api(`/drives/${t}/items/${r}`).patch(c)}}catch(u){throw u.statusCode===400?new Error(`Invalid request: ${u.message||"Check your input parameters"}`):u.statusCode===403?new Error("Insufficient permissions to move this file. Requires Files.ReadWrite or higher."):u.statusCode===404?new Error("File or destination not found. Please verify the IDs."):new Error(`Failed to move file: ${u.message||"Unknown error"}`)}}});var pd=Y(se());var dd=ee({auth:$,name:"microsoft_sharepoint_publish_page",displayName:"Publish Page",description:"Publishes a SharePoint page, making it available to all users. If the page is checked out, it will be automatically checked in. Note: Pages with active approval flows will not publish until approval is complete.",audience:"both",aiMetadata:{description:"Publishes a SharePoint site page by its page ID on a given site, making the latest version visible to all users (auto-checking it in if needed). Use to make page edits live. Idempotent: re-publishing an already-published page leaves it published. A page awaiting an approval flow will not publish until approval completes.",idempotent:!0},props:{siteId:A.siteId,pageId:A.pageId},async run(e){let{siteId:t,pageId:r}=e.propsValue,n=e.auth.props?.cloud,o=pd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)});try{return await o.api(`/sites/${t}/pages/${r}/microsoft.graph.sitePage/publish`).post({}),{success:!0,message:"Page published successfully",pageId:r,siteId:t}}catch(i){throw i.statusCode===404?new Error(`Page not found. Please verify the page ID: ${r}`):i.statusCode===403?new Error("Insufficient permissions to publish this page. Requires Files.ReadWrite or higher."):i.statusCode===409?new Error("Page cannot be published. It may be awaiting approval or already published."):new Error(`Failed to publish page: ${i.message||"Unknown error"}`)}}});var Ir=Y(se());var fd="activepieces_sharepoint_trigger",md=Ie({auth:$,name:"new_file_in_folder",displayName:"New File in Folder",description:"Fires when a new file is created or added in a specific folder.",aiMetadata:{description:"Fires when a new file appears directly inside one specific monitored folder of a SharePoint drive (the folder itself, not its subfolders). Each event represents a single newly created or added file with its metadata."},props:{siteId:A.siteId,driveId:A.driveId,folderId:T.Dropdown({auth:$,displayName:"Folder to Monitor",description:'The folder to watch for new files. Select "Root Folder" for the top-level folder of the drive.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Ir.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root Folder",value:"root"}],u=await i.api(`/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")})},type:"WEBHOOK",sampleData:{id:"01DRYVE_ID_GOES_HERE",name:"Example-Report.docx",webUrl:"https://contoso.sharepoint.com/Shared%20Documents/Example-Report.docx",size:12345,createdDateTime:"2025-09-26T14:26:12Z",lastModifiedDateTime:"2025-09-26T14:26:12Z",file:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},parentReference:{driveId:"DRIVE_ID_HERE",id:"PARENT_FOLDER_ID_HERE",path:"/drives/DRIVE_ID_HERE/root:/Shared Documents"}},async onEnable(e){let{siteId:t,driveId:r,folderId:n}=e.propsValue,o=e.auth.props?.cloud,i=Ir.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)});try{let s=n==="root"?(await i.api(`/drives/${r}/root`).get()).id:n,u=new Date;u.setDate(u.getDate()+2);let c=await i.api("/subscriptions").post({changeType:"created",notificationUrl:e.webhookUrl,resource:`/sites/${t}/drive/items/${s}/children`,expirationDateTime:u.toISOString(),clientState:fd});await e.store.put("subscriptionId",c.id)}catch(s){throw new Error(`Failed to create subscription: ${s.message||"Unknown error"}`)}},async onDisable(e){let t=await e.store.get("subscriptionId");if(t){let r=e.auth.props?.cloud,n=Ir.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(r)});try{await n.api(`/subscriptions/${t}`).delete()}catch(o){console.warn(`Error deleting subscription ${t}:`,o)}}await e.store.delete("subscriptionId")},async run(e){let t=e.payload.body?.value;if(!t||!Array.isArray(t))return[];let r=t.filter(s=>s.clientState===fd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Ir.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)}),i=[];for(let s of r)try{let u=await o.api(s.resource).get();u.file&&i.push(u)}catch(u){console.error("Error fetching file from notification:",u)}return i}});var Er=Y(se());var hd="activepieces_sharepoint_subfolder_trigger",gd=Ie({auth:$,name:"new_file_in_subfolders",displayName:"New File in Subfolders",description:"Fires when a new file is added anywhere in the first-level subfolders of a folder. Note: This trigger will not monitor subfolders created after the flow is activated.",aiMetadata:{description:"Fires when a new file is added to any of the immediate (first-level) subfolders of a chosen parent folder in a SharePoint drive. Each event represents one newly added file. Only subfolders that existed when the flow was activated are monitored; subfolders created later are not watched."},props:{siteId:A.siteId,driveId:A.driveId,parentFolderId:T.Dropdown({auth:$,displayName:"Parent Folder",description:"The parent folder whose subfolders you want to monitor.",required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=Er.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root Folder",value:"root"}],u=await i.api(`/drives/${r}/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")})},type:"WEBHOOK",sampleData:{id:"01DRYVE_ID_GOES_HERE",name:"New-File-In-Subfolder.pdf",webUrl:"https://contoso.sharepoint.com/Shared%20Documents/SubfolderA/New-File-In-Subfolder.pdf",size:54321,createdDateTime:"2025-09-26T14:30:00Z",lastModifiedDateTime:"2025-09-26T14:30:00Z",file:{mimeType:"application/pdf"},parentReference:{id:"SUBFOLDER_ID_HERE"}},async onEnable(e){let{siteId:t,driveId:r,parentFolderId:n}=e.propsValue,o=e.auth.props?.cloud,i=Er.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)});try{let s=n==="root"?(await i.api(`/drives/${r}/root`).get()).id:n,c=(await i.api(`/drives/${r}/items/${s}/children?$filter=folder ne null&$select=id`).get()).value,d=new Date;d.setDate(d.getDate()+2);let f=c.map(p=>i.api("/subscriptions").post({changeType:"created",notificationUrl:e.webhookUrl,resource:`/sites/${t}/drive/items/${p.id}/children`,expirationDateTime:d.toISOString(),clientState:hd})),y=(await Promise.allSettled(f)).filter(p=>p.status==="fulfilled").map(p=>p.value.id);await e.store.put("subscriptionIds",y)}catch(s){throw new Error(`Failed to create subscriptions: ${s.message||"Unknown error"}`)}},async onDisable(e){let t=await e.store.get("subscriptionIds");if(t&&t.length>0){let r=e.auth.props?.cloud,n=Er.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(r)}),o=t.map(i=>n.api(`/subscriptions/${i}`).delete().catch(s=>console.error(`Failed to delete subscription ${i}:`,s)));await Promise.allSettled(o)}await e.store.delete("subscriptionIds")},async run(e){let t=e.payload.body?.value;if(!t||!Array.isArray(t))return[];let r=t.filter(s=>s.clientState===hd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Er.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)}),i=[];for(let s of r)try{let u=await o.api(s.resource).get();u.file&&i.push(u)}catch(u){console.error("Error fetching file from notification:",u)}return i}});var yd=Y(se()),fo=Y(Bt());var po={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=yd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=await s.api(`/sites/${n}/lists`).get(),d=!1;for(;!d&&c.value.length>0;){for(let f of c.value){if(o){u.push(f),u.length>=10&&(d=!0);continue}u.push(f)}if(d||!c["@odata.nextLink"])break;c=await s.api(c["@odata.nextLink"]).get()}return u.sort((f,v)=>{let y=(0,fo.default)(f.createdDateTime);return(0,fo.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,fo.default)(f.createdDateTime).valueOf(),data:f}))},"items")},vd=Ie({auth:$,name:"new_list",displayName:"New List",description:"Triggers when a new list is created in a site.",aiMetadata:{description:"Fires when a new list is created on one specific SharePoint site, based on list creation time (polling). Each event represents one newly created list; changes to existing lists do not trigger it (use New or Updated List for that)."},props:{siteId:A.siteId},type:"POLLING",sampleData:void 0,async onEnable(e){await ie.onEnable(po,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(po,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(po,e)},async run(e){return await ie.poll(po,e)}});var _d=Y(se()),Sr=Y(Bt());var ho={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,listId:o}=t,i=e.props?.cloud,s=_d.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=r===0?`$filter=createdDateTime gt ${(0,Sr.default)().toISOString()}`:"$top=10",d=await s.api(`/sites/${n}/lists/${o}/items?${c}`).expand("fields").get();if(r===0)for(let f of d.value)u.push(f);else for(;d.value.length>0;){for(let f of d.value)u.push(f);if(d["@odata.nextLink"])d=await s.api(d["@odata.nextLink"]).get();else break}return u.sort((f,v)=>{let y=(0,Sr.default)(f.createdDateTime);return(0,Sr.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,Sr.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Pd=Ie({auth:$,name:"new_list_item",displayName:"New List Item",description:"Triggers when a new item is created in a SharePoint list.",aiMetadata:{description:"Fires when a new item (row) is added to one specific SharePoint list on a given site, based on item creation time (polling). Each event represents one newly created list item with its fields; updates to existing items do not trigger it."},props:{siteId:A.siteId,listId:A.listId},type:"POLLING",sampleData:void 0,async onEnable(e){await ie.onEnable(ho,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(ho,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(ho,e)},async run(e){return await ie.poll(ho,e)}});var ta=Y(se()),Ar=Y(Bt());var go={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,driveId:o,folderId:i}=t,s=r===0,u=e.props?.cloud,c=ta.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(u)}),d=[],f=i!=="root"?`/sites/${n}/drive/items/${i}/children`:`/sites/${n}/drives/${o}/items/root/children`,v=await c.api(f).orderby("lastModifiedDateTime desc").get(),y=!1;for(;!y&&v.value.length>0;){for(let p of v.value){if(!p.file)continue;let m=(0,Ar.default)(p.lastModifiedDateTime).valueOf();if(s){d.push(p),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(p)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((p,m)=>{let _=(0,Ar.default)(p.lastModifiedDateTime);return(0,Ar.default)(m.lastModifiedDateTime).diff(_)}),d.map(p=>({epochMilliSeconds:(0,Ar.default)(p.lastModifiedDateTime).valueOf(),data:p}))},"items")},xd=Ie({auth:$,name:"new_or_updated_file",displayName:"New or Updated File",description:"Triggers when a file is created or updated in a given folder.",aiMetadata:{description:"Fires when a file is created or modified directly inside one monitored folder of a SharePoint drive, based on its last-modified time (polling). Each event represents a file that is new or whose contents/metadata changed; choose this over New File in Folder when edits to existing files should also trigger."},props:{siteId:A.siteId,driveId:A.driveId,folderId:T.Dropdown({auth:$,displayName:"Folder to Monitor",description:'The folder to watch for new or updated files. Select "Root Folder" for the top-level folder of the drive.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=ta.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root Folder",value:"root"}],u=await i.api(`/sites/${t}/drives/${r}/items/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")})},type:"POLLING",sampleData:{id:"01DRYVE_ID_GOES_HERE",name:"Updated-Financials.xlsx",webUrl:"https://contoso.sharepoint.com/Shared%20Documents/Updated-Financials.xlsx",size:65432,createdDateTime:"2025-09-26T10:00:00Z",lastModifiedDateTime:"2025-09-26T14:34:00Z",file:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},parentReference:{id:"PARENT_FOLDER_ID_HERE"}},async onEnable(e){await ie.onEnable(go,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(go,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(go,e)},async run(e){return await ie.poll(go,e)}});var ra=Y(se()),wr=Y(Bt());var yo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,driveId:o,parentFolderId:i}=t,s=r===0,u=e.props?.cloud,c=ra.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(u)}),d=[],f=i!=="root"?`/sites/${n}/drive/items/${i}/children`:`/sites/${n}/drives/${o}/items/root/children`,v=await c.api(f).orderby("lastModifiedDateTime desc").get(),y=!1;for(;!y&&v.value.length>0;){for(let p of v.value){if(!p.folder)continue;let m=(0,wr.default)(p.lastModifiedDateTime).valueOf();if(s){d.push(p),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(p)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((p,m)=>{let _=(0,wr.default)(p.lastModifiedDateTime);return(0,wr.default)(m.lastModifiedDateTime).diff(_)}),d.map(p=>({epochMilliSeconds:(0,wr.default)(p.lastModifiedDateTime).valueOf(),data:p}))},"items")},bd=Ie({auth:$,name:"new_or_updated_folder",displayName:"New or Updated Folder",description:"Triggers when a folder is created or updated (e.g., name change).",aiMetadata:{description:"Fires when a subfolder is created or modified (such as a rename) directly inside one monitored parent folder of a SharePoint drive, based on its last-modified time (polling). Each event represents one new or changed folder."},props:{siteId:A.siteId,driveId:A.driveId,parentFolderId:T.Dropdown({auth:$,displayName:"Parent Folder to Monitor",description:'The folder to watch for new or updated subfolders. Select "Root Folder" to monitor the top-level of the drive.',required:!0,refreshers:["siteId","driveId"],options:a(async({auth:e,siteId:t,driveId:r})=>{if(!e||!t||!r)return{disabled:!0,placeholder:"Select a site and drive first.",options:[]};let n=e,o=n.props?.cloud,i=ra.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(n.access_token),"getAccessToken")},baseUrl:S(o)}),s=[{label:"Root Folder",value:"root"}],u=await i.api(`/sites/${t}/drives/${r}/items/root/children?$filter=folder ne null&$select=id,name`).get();for(;u.value.length>0;){for(let c of u.value)s.push({label:c.name,value:c.id});if(u["@odata.nextLink"])u=await i.api(u["@odata.nextLink"]).get();else break}return{disabled:!1,options:s}},"options")})},type:"POLLING",sampleData:{id:"01DRYVE_FOLDER_ID_GOES_HERE",name:"Project Alpha",webUrl:"https://contoso.sharepoint.com/Shared%20Documents/Project%20Alpha",size:0,createdDateTime:"2025-09-26T14:50:00Z",lastModifiedDateTime:"2025-09-26T14:50:00Z",folder:{childCount:0},parentReference:{id:"PARENT_FOLDER_ID_HERE"}},async onEnable(e){await ie.onEnable(yo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(yo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(yo,e)},async run(e){return await ie.poll(yo,e)}});var Td=Y(se()),$r=Y(Bt());var vo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Td.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=await s.api(`/sites/${n}/lists`).get(),d=!1;for(;!d&&c.value.length>0;){for(let f of c.value){let v=(0,$r.default)(f.lastModifiedDateTime).valueOf();if(o){u.push(f),u.length>=10&&(d=!0);continue}if(v<r){d=!0;break}u.push(f)}if(d||!c["@odata.nextLink"])break;c=await s.api(c["@odata.nextLink"]).get()}return u.sort((f,v)=>{let y=(0,$r.default)(f.lastModifiedDateTime);return(0,$r.default)(v.lastModifiedDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,$r.default)(f.lastModifiedDateTime).valueOf(),data:f}))},"items")},Id=Ie({auth:$,name:"new_or_updated_list",displayName:"New or Updated List",description:"Triggers when a list is created or updated in a site.",aiMetadata:{description:"Fires when a list on one specific SharePoint site is created or modified, based on its last-modified time (polling). Each event represents one new or changed list; choose this over New List when edits to existing lists should also trigger."},props:{siteId:A.siteId},type:"POLLING",sampleData:{id:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",displayName:"Projects Tracker",description:"Updated list for tracking all ongoing projects.",createdDateTime:"2025-09-26T11:00:00Z",lastModifiedDateTime:"2025-09-26T14:55:00Z",webUrl:"https://contoso.sharepoint.com/sites/MySite/Lists/Projects%20Tracker"},async onEnable(e){await ie.onEnable(vo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(vo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(vo,e)},async run(e){return await ie.poll(vo,e)}});var _o=Y(se());var Ed="activepieces_sharepoint_updated_list_item_trigger",Sd=Ie({auth:$,name:"updated_list_item",displayName:"Updated List Item",description:"Fires when an existing item in a SharePoint list is updated.",aiMetadata:{description:"Fires when an existing item in one specific SharePoint list on a given site is modified. Each event represents the updated list item with its current fields; newly created items are not the focus (use New List Item for creations)."},props:{siteId:A.siteId,listId:A.listId},type:"WEBHOOK",sampleData:{id:"2",createdDateTime:"2025-09-26T14:10:00Z",lastModifiedDateTime:"2025-09-26T14:38:00Z",webUrl:"https://contoso.sharepoint.com/sites/MySite/Lists/MyTasks/2_.000",fields:{"@odata.etag":'"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,2"',id:"2",Title:"Complete Project Proposal",Status:"In Progress",Priority:"High",DueDate:"2025-10-05T00:00:00Z"}},async onEnable(e){let{siteId:t,listId:r}=e.propsValue,n=e.auth.props?.cloud,o=_o.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)});try{let i=new Date;i.setDate(i.getDate()+2);let s=await o.api("/subscriptions").post({changeType:"updated",notificationUrl:e.webhookUrl,resource:`/sites/${t}/lists/${r}/items`,expirationDateTime:i.toISOString(),clientState:Ed});await e.store.put("subscriptionId",s.id)}catch(i){throw new Error(`Failed to create subscription: ${i.message||"Unknown error"}`)}},async onDisable(e){let t=await e.store.get("subscriptionId");if(t){let r=e.auth.props?.cloud,n=_o.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(r)});try{await n.api(`/subscriptions/${t}`).delete()}catch(o){console.warn(`Error deleting subscription ${t}:`,o)}}await e.store.delete("subscriptionId")},async run(e){let t=e.payload.body?.value;if(!t||!Array.isArray(t))return[];let r=t.filter(s=>s.clientState===Ed);if(r.length===0)return[];let n=e.auth.props?.cloud,o=_o.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(n)}),i=[];for(let s of r)try{let u=await o.api(s.resource).expand("fields").get();i.push(u)}catch(u){console.error("Error fetching list item from notification:",u)}return i}});var A_=au({displayName:"Microsoft SharePoint",auth:$,minimumSupportedRelease:"0.78.0",logoUrl:"https://cdn.activepieces.com/pieces/microsoft-sharepoint.png",categories:["CONTENT_AND_FILES"],authors:["kishanprmr","pranith124","onyedikachi-david"],actions:[Fp,Bp,Zp,Xp,Gp,Kp,Qp,dd,td,nd,ld,od,id,sd,cd,xl({auth:$,baseUrl:a(e=>{let t=e.props?.cloud;return S(t)+"/v1.0"},"baseUrl"),authMapping:a(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[md,gd,xd,bd,Pd,Sd,vd,Id]});0&&(module.exports={microsoftSharePoint});
|
|
17
|
+
/*! Bundled license information:
|
|
18
|
+
|
|
19
|
+
mime-types/index.js:
|
|
20
|
+
(*!
|
|
21
|
+
* mime-types
|
|
22
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
23
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
24
|
+
* MIT Licensed
|
|
25
|
+
*)
|
|
26
|
+
*/
|