@activepieces/piece-microsoft-sharepoint 0.3.4 → 0.3.6

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.
Files changed (109) hide show
  1. package/package.json +7 -15
  2. package/src/index.js +26 -81
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/copy-item-within-site.d.ts +0 -9
  7. package/src/lib/actions/copy-item-within-site.d.ts.map +0 -1
  8. package/src/lib/actions/copy-item-within-site.js +0 -166
  9. package/src/lib/actions/copy-item-within-site.js.map +0 -1
  10. package/src/lib/actions/copy-item.d.ts +0 -11
  11. package/src/lib/actions/copy-item.d.ts.map +0 -1
  12. package/src/lib/actions/copy-item.js +0 -126
  13. package/src/lib/actions/copy-item.js.map +0 -1
  14. package/src/lib/actions/create-folder.d.ts +0 -7
  15. package/src/lib/actions/create-folder.d.ts.map +0 -1
  16. package/src/lib/actions/create-folder.js +0 -53
  17. package/src/lib/actions/create-folder.js.map +0 -1
  18. package/src/lib/actions/create-list-item.d.ts +0 -6
  19. package/src/lib/actions/create-list-item.d.ts.map +0 -1
  20. package/src/lib/actions/create-list-item.js +0 -52
  21. package/src/lib/actions/create-list-item.js.map +0 -1
  22. package/src/lib/actions/create-list.d.ts +0 -6
  23. package/src/lib/actions/create-list.d.ts.map +0 -1
  24. package/src/lib/actions/create-list.js +0 -50
  25. package/src/lib/actions/create-list.js.map +0 -1
  26. package/src/lib/actions/delete-list-item.d.ts +0 -6
  27. package/src/lib/actions/delete-list-item.d.ts.map +0 -1
  28. package/src/lib/actions/delete-list-item.js +0 -42
  29. package/src/lib/actions/delete-list-item.js.map +0 -1
  30. package/src/lib/actions/find-file.d.ts +0 -9
  31. package/src/lib/actions/find-file.d.ts.map +0 -1
  32. package/src/lib/actions/find-file.js +0 -145
  33. package/src/lib/actions/find-file.js.map +0 -1
  34. package/src/lib/actions/find-site.d.ts +0 -4
  35. package/src/lib/actions/find-site.d.ts.map +0 -1
  36. package/src/lib/actions/find-site.js +0 -61
  37. package/src/lib/actions/find-site.js.map +0 -1
  38. package/src/lib/actions/get-folder-contents.d.ts +0 -10
  39. package/src/lib/actions/get-folder-contents.d.ts.map +0 -1
  40. package/src/lib/actions/get-folder-contents.js +0 -120
  41. package/src/lib/actions/get-folder-contents.js.map +0 -1
  42. package/src/lib/actions/get-site-information.d.ts +0 -5
  43. package/src/lib/actions/get-site-information.d.ts.map +0 -1
  44. package/src/lib/actions/get-site-information.js +0 -47
  45. package/src/lib/actions/get-site-information.js.map +0 -1
  46. package/src/lib/actions/move-file.d.ts +0 -8
  47. package/src/lib/actions/move-file.d.ts.map +0 -1
  48. package/src/lib/actions/move-file.js +0 -166
  49. package/src/lib/actions/move-file.js.map +0 -1
  50. package/src/lib/actions/publish-page.d.ts +0 -5
  51. package/src/lib/actions/publish-page.d.ts.map +0 -1
  52. package/src/lib/actions/publish-page.js +0 -61
  53. package/src/lib/actions/publish-page.js.map +0 -1
  54. package/src/lib/actions/search-list-item.d.ts +0 -6
  55. package/src/lib/actions/search-list-item.d.ts.map +0 -1
  56. package/src/lib/actions/search-list-item.js +0 -49
  57. package/src/lib/actions/search-list-item.js.map +0 -1
  58. package/src/lib/actions/update-list-item.d.ts +0 -7
  59. package/src/lib/actions/update-list-item.d.ts.map +0 -1
  60. package/src/lib/actions/update-list-item.js +0 -51
  61. package/src/lib/actions/update-list-item.js.map +0 -1
  62. package/src/lib/actions/upload-file.d.ts +0 -8
  63. package/src/lib/actions/upload-file.d.ts.map +0 -1
  64. package/src/lib/actions/upload-file.js +0 -57
  65. package/src/lib/actions/upload-file.js.map +0 -1
  66. package/src/lib/auth.d.ts +0 -2
  67. package/src/lib/auth.d.ts.map +0 -1
  68. package/src/lib/auth.js +0 -37
  69. package/src/lib/auth.js.map +0 -1
  70. package/src/lib/common/index.d.ts +0 -15
  71. package/src/lib/common/index.d.ts.map +0 -1
  72. package/src/lib/common/index.js +0 -416
  73. package/src/lib/common/index.js.map +0 -1
  74. package/src/lib/common/microsoft-cloud.d.ts +0 -5
  75. package/src/lib/common/microsoft-cloud.d.ts.map +0 -1
  76. package/src/lib/common/microsoft-cloud.js +0 -38
  77. package/src/lib/common/microsoft-cloud.js.map +0 -1
  78. package/src/lib/triggers/new-file-in-folder.d.ts +0 -19
  79. package/src/lib/triggers/new-file-in-folder.d.ts.map +0 -1
  80. package/src/lib/triggers/new-file-in-folder.js +0 -170
  81. package/src/lib/triggers/new-file-in-folder.js.map +0 -1
  82. package/src/lib/triggers/new-file-in-subfolders.d.ts +0 -19
  83. package/src/lib/triggers/new-file-in-subfolders.d.ts.map +0 -1
  84. package/src/lib/triggers/new-file-in-subfolders.js +0 -166
  85. package/src/lib/triggers/new-file-in-subfolders.js.map +0 -1
  86. package/src/lib/triggers/new-list-item.d.ts +0 -15
  87. package/src/lib/triggers/new-list-item.d.ts.map +0 -1
  88. package/src/lib/triggers/new-list-item.js +0 -102
  89. package/src/lib/triggers/new-list-item.js.map +0 -1
  90. package/src/lib/triggers/new-list.d.ts +0 -11
  91. package/src/lib/triggers/new-list.d.ts.map +0 -1
  92. package/src/lib/triggers/new-list.js +0 -96
  93. package/src/lib/triggers/new-list.js.map +0 -1
  94. package/src/lib/triggers/new-or-updated-file.d.ts +0 -19
  95. package/src/lib/triggers/new-or-updated-file.d.ts.map +0 -1
  96. package/src/lib/triggers/new-or-updated-file.js +0 -162
  97. package/src/lib/triggers/new-or-updated-file.js.map +0 -1
  98. package/src/lib/triggers/new-or-updated-folder.d.ts +0 -19
  99. package/src/lib/triggers/new-or-updated-folder.d.ts.map +0 -1
  100. package/src/lib/triggers/new-or-updated-folder.js +0 -162
  101. package/src/lib/triggers/new-or-updated-folder.js.map +0 -1
  102. package/src/lib/triggers/new-or-updated-list.d.ts +0 -11
  103. package/src/lib/triggers/new-or-updated-list.d.ts.map +0 -1
  104. package/src/lib/triggers/new-or-updated-list.js +0 -110
  105. package/src/lib/triggers/new-or-updated-list.js.map +0 -1
  106. package/src/lib/triggers/updated-list-item.d.ts +0 -15
  107. package/src/lib/triggers/updated-list-item.d.ts.map +0 -1
  108. package/src/lib/triggers/updated-list-item.js +0 -120
  109. 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
- exports.microsoftSharePoint = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const microsoft_cloud_1 = require("./lib/common/microsoft-cloud");
7
- const pieces_framework_1 = require("@activepieces/pieces-framework");
8
- const shared_1 = require("@activepieces/shared");
9
- const create_folder_1 = require("./lib/actions/create-folder");
10
- const create_list_1 = require("./lib/actions/create-list");
11
- const create_list_item_1 = require("./lib/actions/create-list-item");
12
- const delete_list_item_1 = require("./lib/actions/delete-list-item");
13
- const search_list_item_1 = require("./lib/actions/search-list-item");
14
- const update_list_item_1 = require("./lib/actions/update-list-item");
15
- const upload_file_1 = require("./lib/actions/upload-file");
16
- const copy_item_1 = require("./lib/actions/copy-item");
17
- const copy_item_within_site_1 = require("./lib/actions/copy-item-within-site");
18
- const find_file_1 = require("./lib/actions/find-file");
19
- const get_folder_contents_1 = require("./lib/actions/get-folder-contents");
20
- const get_site_information_1 = require("./lib/actions/get-site-information");
21
- const find_site_1 = require("./lib/actions/find-site");
22
- const move_file_1 = require("./lib/actions/move-file");
23
- const publish_page_1 = require("./lib/actions/publish-page");
24
- const auth_1 = require("./lib/auth");
25
- const new_file_in_folder_1 = require("./lib/triggers/new-file-in-folder");
26
- const new_file_in_subfolders_1 = require("./lib/triggers/new-file-in-subfolders");
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 Fd=Object.create;var Gt=Object.defineProperty;var Vd=Object.getOwnPropertyDescriptor;var Bd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,Zd=Object.prototype.hasOwnProperty;var a=(e,t)=>Gt(e,"name",{value:t,configurable:!0});var qd=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var b=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},To=(e,t)=>{for(var r in t)Gt(e,r,{get:t[r],enumerable:!0})},aa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bd(t))!Zd.call(e,o)&&o!==r&&Gt(e,o,{get:()=>t[o],enumerable:!(n=Vd(t,o))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?Fd(Hd(e)):{},aa(t||!e||!e.__esModule?Gt(r,"default",{value:e,enumerable:!0}):r,e)),ce=e=>aa(Gt({},"__esModule",{value:!0}),e);var $s=b((ws,Qr)=>{(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(l,m){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let _=0,g=-1,P=(l.match(u.zoneIndex)||[])[0],I,Z;for(P&&(P=P.substring(1),l=l.replace(/%.+$/,""));(g=l.indexOf(":",g+1))>=0;)_++;if(l.substr(0,2)==="::"&&_--,l.substr(-2,2)==="::"&&_--,_>m)return null;for(Z=m-_,I=":";Z--;)I+="0:";return l=l.replace("::",I),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),m=(function(){let ge=l.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(l,m,_,g){if(l.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),l[P]>>I!==m[P]>>I)return!1;g-=_,P+=1}return!0}a(d,"matchCIDR");function f(l){if(o.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}a(f,"parseIntAuto");function v(l,m){for(;l.length<m;)l=`0${l}`;return l}a(v,"padPart");let y={};y.IPv4=(function(){function l(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,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(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(m,_){let 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,_)},l.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},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l})(),y.IPv4.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=m[0].toByteArray(),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(l){return this.parser(l)!==null},y.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(l){return!!(y.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(l){let m=l.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(l)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(l){let m,_,g,P,I;try{for(m=this.parseCIDR(l),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(l){let m=this.parser(l);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(l){let m;if(m=l.match(/^(.+)\/(\d+)$/)){let _=parseInt(m[2]);if(_>=0&&_<=32){let 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(l){let m,_,g;if(m=l.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=l.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=l.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=l.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(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],_=0,g=Math.floor(l/8);for(;_<g;)m[_]=255,_++;return g<4&&(m[g]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.IPv6=(function(){function l(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(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(m,_){let 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,_)},l.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},l.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},l.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 _},l.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+_},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),_=m[0],g=m[1];return new y.IPv4([_>>8,_&255,g>>8,g&255])},l.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+_},l.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)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),y.IPv6.broadcastAddressFromCIDR=function(l){try{let m=this.parseCIDR(l),_=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(l){return this.parser(l)!==null},y.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let m=this.parser(l);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(l){let m,_,g,P,I;try{for(m=this.parseCIDR(l),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(l){let m=this.parser(l);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},y.IPv6.parseCIDR=function(l){let m,_,g;if((_=l.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(l){let m,_,g,P,I,Z;if(g=l.match(u.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(u.native.test(l))return c(l,8);if((g=l.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(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0,g=Math.floor(l/8);for(;_<g;)m[_]=255,_++;return g<16&&(m[g]=Math.pow(2,l%8)-1<<8-l%8),new this(m)},y.fromByteArray=function(l){let m=l.length;if(m===4)return new y.IPv4(l);if(m===16)return new y.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(l){return y.IPv6.isValid(l)||y.IPv4.isValid(l)},y.isValidCIDR=function(l){return y.IPv6.isValidCIDR(l)||y.IPv4.isValidCIDR(l)},y.parse=function(l){if(y.IPv6.isValid(l))return y.IPv6.parse(l);if(y.IPv4.isValid(l))return y.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(l){try{return y.IPv6.parseCIDR(l)}catch{try{return y.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(l){let m=this.parse(l);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},y.subnetMatch=function(l,m,_){let 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],l.kind()===Z[0].kind()&&l.match.apply(l,Z))return P}return _},typeof Qr<"u"&&Qr.exports?Qr.exports=y:e.ipaddr=y})(ws)});var Ru=b(($C,Ou)=>{var $u=require("stream").Stream,$h=require("util");Ou.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");$h.inherits(Me,$u);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=$u.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 Cu=b((RC,Du)=>{var Oh=require("util"),ku=require("stream").Stream,zu=Ru();Du.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");Oh.inherits(he,ku);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 zu)){var r=zu.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 ku.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 Uu=b((kC,Nu)=>{"use strict";Nu.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 ju=b($e=>{"use strict";var on=Uu(),Rh=require("path").extname,Mu=/^\s*([^;\s]*)(?:;|\s|$)/,zh=/^text\//i;$e.charset=Lu;$e.charsets={lookup:Lu};$e.contentType=kh;$e.extension=Dh;$e.extensions=Object.create(null);$e.lookup=Ch;$e.types=Object.create(null);Nh($e.extensions,$e.types);function Lu(e){if(!e||typeof e!="string")return!1;var t=Mu.exec(e),r=t&&on[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&zh.test(t[1])?"UTF-8":!1}a(Lu,"charset");function kh(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(kh,"contentType");function Dh(e){if(!e||typeof e!="string")return!1;var t=Mu.exec(e),r=t&&$e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Dh,"extension");function Ch(e){if(!e||typeof e!="string")return!1;var t=Rh("x."+e).toLowerCase().substr(1);return t&&$e.types[t]||!1}a(Ch,"lookup");function Nh(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(on).forEach(a(function(o){var i=on[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(on[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(Nh,"populateMaps")});var Vu=b((NC,Fu)=>{Fu.exports=Uh;function Uh(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(Uh,"defer")});var li=b((MC,Hu)=>{var Bu=Vu();Hu.exports=Mh;function Mh(e){var t=!1;return Bu(function(){t=!0}),a(function(n,o){t?e(n,o):Bu(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(Mh,"async")});var pi=b((jC,Zu)=>{Zu.exports=Lh;function Lh(e){Object.keys(e.jobs).forEach(jh.bind(e)),e.jobs={}}a(Lh,"abort");function jh(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(jh,"clean")});var di=b((VC,Gu)=>{var qu=li(),Fh=pi();Gu.exports=Vh;function Vh(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?Fh(r):r.results[o]=s,n(i,r.results))})}a(Vh,"iterate");function Bh(e,t,r,n){var o;return e.length==2?o=e(r,qu(n)):o=e(r,t,qu(n)),o}a(Bh,"runJob")});var fi=b((HC,Wu)=>{Wu.exports=Hh;function Hh(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(Hh,"state")});var mi=b((qC,Ku)=>{var Zh=pi(),qh=li();Ku.exports=Gh;function Gh(e){Object.keys(this.jobs).length&&(this.index=this.size,Zh(this),qh(e)(null,this.results))}a(Gh,"terminator")});var Xu=b((WC,Ju)=>{var Wh=di(),Kh=fi(),Jh=mi();Ju.exports=Xh;function Xh(e,t,r){for(var n=Kh(e);n.index<(n.keyedList||e).length;)Wh(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 Jh.bind(n,r)}a(Xh,"parallel")});var hi=b((JC,an)=>{var Yu=di(),Yh=fi(),Qh=mi();an.exports=eg;an.exports.ascending=Qu;an.exports.descending=tg;function eg(e,t,r,n){var o=Yh(e,r);return Yu(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){Yu(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),Qh.bind(o,n)}a(eg,"serialOrdered");function Qu(e,t){return e<t?-1:e>t?1:0}a(Qu,"ascending");function tg(e,t){return-1*Qu(e,t)}a(tg,"descending")});var tc=b((YC,ec)=>{var rg=hi();ec.exports=ng;function ng(e,t,r){return rg(e,t,null,r)}a(ng,"serial")});var nc=b((eN,rc)=>{rc.exports={parallel:Xu(),serial:tc(),serialOrdered:hi()}});var gi=b((tN,oc)=>{"use strict";oc.exports=Object});var ac=b((rN,ic)=>{"use strict";ic.exports=Error});var uc=b((nN,sc)=>{"use strict";sc.exports=EvalError});var lc=b((oN,cc)=>{"use strict";cc.exports=RangeError});var dc=b((iN,pc)=>{"use strict";pc.exports=ReferenceError});var mc=b((aN,fc)=>{"use strict";fc.exports=SyntaxError});var sn=b((sN,hc)=>{"use strict";hc.exports=TypeError});var yc=b((uN,gc)=>{"use strict";gc.exports=URIError});var _c=b((cN,vc)=>{"use strict";vc.exports=Math.abs});var xc=b((lN,Pc)=>{"use strict";Pc.exports=Math.floor});var Tc=b((pN,bc)=>{"use strict";bc.exports=Math.max});var Ec=b((dN,Ic)=>{"use strict";Ic.exports=Math.min});var Ac=b((fN,Sc)=>{"use strict";Sc.exports=Math.pow});var $c=b((mN,wc)=>{"use strict";wc.exports=Math.round});var Rc=b((hN,Oc)=>{"use strict";Oc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var kc=b((yN,zc)=>{"use strict";var og=Rc();zc.exports=a(function(t){return og(t)||t===0?t:t<0?-1:1},"sign")});var Cc=b((_N,Dc)=>{"use strict";Dc.exports=Object.getOwnPropertyDescriptor});var yi=b((PN,Nc)=>{"use strict";var un=Cc();if(un)try{un([],"length")}catch{un=null}Nc.exports=un});var Mc=b((xN,Uc)=>{"use strict";var cn=Object.defineProperty||!1;if(cn)try{cn({},"a",{value:1})}catch{cn=!1}Uc.exports=cn});var vi=b((bN,Lc)=>{"use strict";Lc.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,r);if(u.value!==o||u.enumerable!==!0)return!1}return!0},"hasSymbols")});var Vc=b((IN,Fc)=>{"use strict";var jc=typeof Symbol<"u"&&Symbol,ig=vi();Fc.exports=a(function(){return typeof jc!="function"||typeof Symbol!="function"||typeof jc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ig()},"hasNativeSymbols")});var _i=b((SN,Bc)=>{"use strict";Bc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Pi=b((AN,Hc)=>{"use strict";var ag=gi();Hc.exports=ag.getPrototypeOf||null});var Gc=b((wN,qc)=>{"use strict";var sg="Function.prototype.bind called on incompatible ",ug=Object.prototype.toString,cg=Math.max,lg="[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"),pg=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"),dg=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");qc.exports=a(function(t){var r=this;if(typeof r!="function"||ug.apply(r)!==lg)throw new TypeError(sg+r);for(var n=pg(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=cg(0,r.length-n.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(o=Function("binder","return function ("+dg(u,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var d=a(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var $t=b((ON,Wc)=>{"use strict";var fg=Gc();Wc.exports=Function.prototype.bind||fg});var ln=b((RN,Kc)=>{"use strict";Kc.exports=Function.prototype.call});var xi=b((zN,Jc)=>{"use strict";Jc.exports=Function.prototype.apply});var Yc=b((kN,Xc)=>{"use strict";Xc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var el=b((DN,Qc)=>{"use strict";var mg=$t(),hg=xi(),gg=ln(),yg=Yc();Qc.exports=yg||mg.call(gg,hg)});var rl=b((CN,tl)=>{"use strict";var vg=$t(),_g=sn(),Pg=ln(),xg=el();tl.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new _g("a function is required");return xg(vg,Pg,t)},"callBindBasic")});var ul=b((UN,sl)=>{"use strict";var bg=rl(),nl=yi(),il;try{il=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var bi=!!il&&nl&&nl(Object.prototype,"__proto__"),al=Object,ol=al.getPrototypeOf;sl.exports=bi&&typeof bi.get=="function"?bg([bi.get]):typeof ol=="function"?a(function(t){return ol(t==null?t:al(t))},"getDunder"):!1});var fl=b((LN,dl)=>{"use strict";var cl=_i(),ll=Pi(),pl=ul();dl.exports=cl?a(function(t){return cl(t)},"getProto"):ll?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ll(t)},"getProto"):pl?a(function(t){return pl(t)},"getProto"):null});var Ti=b((FN,ml)=>{"use strict";var Tg=Function.prototype.call,Ig=Object.prototype.hasOwnProperty,Eg=$t();ml.exports=Eg.call(Tg,Ig)});var xl=b((VN,Pl)=>{"use strict";var X,Sg=gi(),Ag=ac(),wg=uc(),$g=lc(),Og=dc(),kt=mc(),zt=sn(),Rg=yc(),zg=_c(),kg=xc(),Dg=Tc(),Cg=Ec(),Ng=Ac(),Ug=$c(),Mg=kc(),vl=Function,Ii=a(function(e){try{return vl('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),hr=yi(),Lg=Mc(),Ei=a(function(){throw new zt},"throwTypeError"),jg=hr?(function(){try{return arguments.callee,Ei}catch{try{return hr(arguments,"callee").get}catch{return Ei}}})():Ei,Ot=Vc()(),be=fl(),Fg=Pi(),Vg=_i(),_l=xi(),gr=ln(),Rt={},Bg=typeof Uint8Array>"u"||!be?X:be(Uint8Array),gt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?X:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?X:ArrayBuffer,"%ArrayIteratorPrototype%":Ot&&be?be([][Symbol.iterator]()):X,"%AsyncFromSyncIteratorPrototype%":X,"%AsyncFunction%":Rt,"%AsyncGenerator%":Rt,"%AsyncGeneratorFunction%":Rt,"%AsyncIteratorPrototype%":Rt,"%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%":wg,"%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%":vl,"%GeneratorFunction%":Rt,"%Int8Array%":typeof Int8Array>"u"?X:Int8Array,"%Int16Array%":typeof Int16Array>"u"?X:Int16Array,"%Int32Array%":typeof Int32Array>"u"?X:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ot&&be?be(be([][Symbol.iterator]())):X,"%JSON%":typeof JSON=="object"?JSON:X,"%Map%":typeof Map>"u"?X:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ot||!be?X:be(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Sg,"%Object.getOwnPropertyDescriptor%":hr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?X:Promise,"%Proxy%":typeof Proxy>"u"?X:Proxy,"%RangeError%":$g,"%ReferenceError%":Og,"%Reflect%":typeof Reflect>"u"?X:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?X:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ot||!be?X:be(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?X:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ot&&be?be(""[Symbol.iterator]()):X,"%Symbol%":Ot?Symbol:X,"%SyntaxError%":kt,"%ThrowTypeError%":jg,"%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%":Rg,"%WeakMap%":typeof WeakMap>"u"?X:WeakMap,"%WeakRef%":typeof WeakRef>"u"?X:WeakRef,"%WeakSet%":typeof WeakSet>"u"?X:WeakSet,"%Function.prototype.call%":gr,"%Function.prototype.apply%":_l,"%Object.defineProperty%":Lg,"%Object.getPrototypeOf%":Fg,"%Math.abs%":zg,"%Math.floor%":kg,"%Math.max%":Dg,"%Math.min%":Cg,"%Math.pow%":Ng,"%Math.round%":Ug,"%Math.sign%":Mg,"%Reflect.getPrototypeOf%":Vg};if(be)try{null.error}catch(e){hl=be(be(e)),gt["%Error.prototype%"]=hl}var hl,Hg=a(function e(t){var r;if(t==="%AsyncFunction%")r=Ii("async function () {}");else if(t==="%GeneratorFunction%")r=Ii("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Ii("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&be&&(r=be(o.prototype))}return gt[t]=r,r},"doEval"),gl={__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"]},yr=$t(),pn=Ti(),Zg=yr.call(gr,Array.prototype.concat),qg=yr.call(_l,Array.prototype.splice),yl=yr.call(gr,String.prototype.replace),dn=yr.call(gr,String.prototype.slice),Gg=yr.call(gr,RegExp.prototype.exec),Wg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Kg=/\\(\\)?/g,Jg=a(function(t){var r=dn(t,0,1),n=dn(t,-1);if(r==="%"&&n!=="%")throw new kt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new kt("invalid intrinsic syntax, expected opening `%`");var o=[];return yl(t,Wg,function(i,s,u,c){o[o.length]=u?yl(c,Kg,"$1"):s||i}),o},"stringToPath"),Xg=a(function(t,r){var n=t,o;if(pn(gl,n)&&(o=gl[n],n="%"+o[0]+"%"),pn(gt,n)){var i=gt[n];if(i===Rt&&(i=Hg(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 kt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Pl.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(Gg(/^%?[^%]*%?$/,t)===null)throw new kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Jg(t),o=n.length>0?n[0]:"",i=Xg("%"+o+"%",r),s=i.name,u=i.value,c=!1,d=i.alias;d&&(o=d[0],qg(n,Zg([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],l=dn(y,0,1),m=dn(y,-1);if((l==='"'||l==="'"||l==="`"||m==='"'||m==="'"||m==="`")&&l!==m)throw new kt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(c=!0),o+="."+y,s="%"+o+"%",pn(gt,s))u=gt[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(hr&&f+1>=n.length){var _=hr(u,y);v=!!_,v&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[y]}else v=pn(u,y),u=u[y];v&&!c&&(gt[s]=u)}}return u},"GetIntrinsic")});var Tl=b((HN,bl)=>{"use strict";var Yg=vi();bl.exports=a(function(){return Yg()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Sl=b((qN,El)=>{"use strict";var Qg=xl(),Il=Qg("%Object.defineProperty%",!0),ey=Tl()(),ty=Ti(),ry=sn(),fn=ey?Symbol.toStringTag:null;El.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 ry("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");fn&&(n||!ty(t,fn))&&(Il?Il(t,fn,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[fn]=r)},"setToStringTag")});var wl=b((WN,Al)=>{"use strict";var ny=Function.prototype.call,oy=Object.prototype.hasOwnProperty,iy=$t();Al.exports=iy.call(ny,oy)});var Ol=b((KN,$l)=>{"use strict";$l.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var kl=b((JN,zl)=>{"use strict";var $i=Cu(),ay=require("util"),Si=require("path"),sy=require("http"),uy=require("https"),cy=require("url").parse,ly=require("fs"),py=require("stream").Stream,dy=require("crypto"),Ai=ju(),fy=nc(),my=Sl(),st=wl(),wi=Ol();function Rl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(Rl,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],$i.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(Q,"FormData");ay.inherits(Q,$i);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=$i.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&&st(t,"httpVersion"))&&!(t instanceof py))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){st(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ly.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):st(e,"httpVersion")?t(null,Number(e.headers["content-length"])):st(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="'+Rl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&wi(s,r.header);var u;for(var c in s)if(st(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=Si.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Si.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&st(e,"httpVersion")&&(r=Si.basename(e.client._httpMessage.path||"")),r)return'filename="'+Rl(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Ai.lookup(e.name)),!r&&e&&e.path&&(r=Ai.lookup(e.path)),!r&&e&&e.readable&&st(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Ai.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)st(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="--------------------------"+dy.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}fy.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=cy(e),n=wi({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=wi(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=uy.request(n):r=sy.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]"};my(Q.prototype,"FormData");zl.exports=Q});var pe={};To(pe,{__addDisposableResource:()=>cp,__assign:()=>mn,__asyncDelegator:()=>tp,__asyncGenerator:()=>ep,__asyncValues:()=>rp,__await:()=>Dt,__awaiter:()=>Wl,__classPrivateFieldGet:()=>ap,__classPrivateFieldIn:()=>up,__classPrivateFieldSet:()=>sp,__createBinding:()=>gn,__decorate:()=>Fl,__disposeResources:()=>lp,__esDecorate:()=>Bl,__exportStar:()=>Jl,__extends:()=>Ll,__generator:()=>Kl,__importDefault:()=>ip,__importStar:()=>op,__makeTemplateObject:()=>np,__metadata:()=>Gl,__param:()=>Vl,__propKey:()=>Zl,__read:()=>zi,__rest:()=>jl,__rewriteRelativeImportExtension:()=>pp,__runInitializers:()=>Hl,__setFunctionName:()=>ql,__spread:()=>Xl,__spreadArray:()=>Ql,__spreadArrays:()=>Yl,__values:()=>hn,default:()=>Ay});function Ll(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Oi(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function jl(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 Fl(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 Vl(e,t){return function(r,n){t(r,n,e)}}function Bl(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,l=r.length-1;l>=0;l--){var m={};for(var _ in n)m[_]=_==="access"?{}:n[_];for(var _ in n.access)m.access[_]=n.access[_];m.addInitializer=function(P){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(P||null))};var g=(0,r[l])(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 Hl(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 ql(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 Gl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Wl(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 Kl(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 Jl(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&gn(t,e,r)}function hn(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 zi(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 Xl(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(zi(arguments[t]));return e}function Yl(){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 Ql(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 Dt(e){return this instanceof Dt?(this.v=e,this):new Dt(e)}function ep(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(l){return function(m){return Promise.resolve(m).then(l,v)}}function u(l,m){n[l]&&(o[l]=function(_){return new Promise(function(g,P){i.push([l,_,g,P])>1||c(l,_)})},m&&(o[l]=m(o[l])))}function c(l,m){try{d(n[l](m))}catch(_){y(i[0][3],_)}}function d(l){l.value instanceof Dt?Promise.resolve(l.value.v).then(f,v):y(i[0][2],l)}function f(l){c("next",l)}function v(l){c("throw",l)}function y(l,m){l(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function tp(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:Dt(e[o](s)),done:!1}:i?i(s):s}:i}}function rp(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 hn=="function"?hn(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 np(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function op(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Ri(e),n=0;n<r.length;n++)r[n]!=="default"&&gn(t,e,r[n]);return Ey(t,e),t}function ip(e){return e&&e.__esModule?e:{default:e}}function ap(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 sp(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 up(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 cp(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 lp(e){function t(i){e.error=e.hasError?new Sy(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 pp(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 Oi,mn,gn,Ey,Ri,Sy,Ay,de=qd(()=>{Oi=a(function(e,t){return Oi=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])},Oi(e,t)},"extendStatics");a(Ll,"__extends");mn=a(function(){return mn=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"),mn.apply(this,arguments)},"__assign");a(jl,"__rest");a(Fl,"__decorate");a(Vl,"__param");a(Bl,"__esDecorate");a(Hl,"__runInitializers");a(Zl,"__propKey");a(ql,"__setFunctionName");a(Gl,"__metadata");a(Wl,"__awaiter");a(Kl,"__generator");gn=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(Jl,"__exportStar");a(hn,"__values");a(zi,"__read");a(Xl,"__spread");a(Yl,"__spreadArrays");a(Ql,"__spreadArray");a(Dt,"__await");a(ep,"__asyncGenerator");a(tp,"__asyncDelegator");a(rp,"__asyncValues");a(np,"__makeTemplateObject");Ey=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Ri=a(function(e){return Ri=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Ri(e)},"ownKeys");a(op,"__importStar");a(ip,"__importDefault");a(ap,"__classPrivateFieldGet");a(sp,"__classPrivateFieldSet");a(up,"__classPrivateFieldIn");a(cp,"__addDisposableResource");Sy=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(lp,"__disposeResources");a(pp,"__rewriteRelativeImportExtension");Ay={__extends:Ll,__assign:mn,__rest:jl,__decorate:Fl,__param:Vl,__esDecorate:Bl,__runInitializers:Hl,__propKey:Zl,__setFunctionName:ql,__metadata:Gl,__awaiter:Wl,__generator:Kl,__createBinding:gn,__exportStar:Jl,__values:hn,__read:zi,__spread:Xl,__spreadArrays:Yl,__spreadArray:Ql,__await:Dt,__asyncGenerator:ep,__asyncDelegator:tp,__asyncValues:rp,__makeTemplateObject:np,__importStar:op,__importDefault:ip,__classPrivateFieldGet:ap,__classPrivateFieldSet:sp,__classPrivateFieldIn:up,__addDisposableResource:cp,__disposeResources:lp,__rewriteRelativeImportExtension:pp}});var _r=b(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.RequestMethod=void 0;var dp;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(dp||(yn.RequestMethod=dp={}))});var fp=b(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.BatchRequestContent=void 0;var Ct=(de(),ce(pe)),ki=_r(),wy=(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 Ct.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Ct.__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===ki.RequestMethod.PATCH||t.method===ki.RequestMethod.POST||t.method===ki.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 Ct.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c,d;return Ct.__generator(this,function(f){switch(f.label){case 0:r=!1,f.label=1;case 1:return f.trys.push([1,3,,4]),o=t.clone(),[4,o.json()];case 2:return n=f.sent(),r=!0,[3,4];case 3:return i=f.sent(),[3,4];case 4:if(r)return[3,12];f.label=5;case 5:return f.trys.push([5,11,,12]),typeof Blob<"u"?[4,t.blob()]:[3,8];case 6:return s=f.sent(),u=new FileReader,[4,new Promise(function(v){u.addEventListener("load",function(){var y=u.result,l=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=l.exec(y);v(m[4])},!1),u.readAsDataURL(s)})];case 7:return n=f.sent(),[3,10];case 8:return typeof Buffer<"u"?[4,t.buffer()]:[3,10];case 9: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 Ct.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Ct.__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})();vn.BatchRequestContent=wy});var mp=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.BatchResponseContent=void 0;var $y=(de(),ce(pe)),Oy=(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 $y.__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})();_n.BatchResponseContent=Oy});var Di=b(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.GRAPH_URLS=ut.GRAPH_BASE_URL=ut.GRAPH_API_VERSION=void 0;ut.GRAPH_API_VERSION="v1.0";ut.GRAPH_BASE_URL="https://graph.microsoft.com/";ut.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 Ke=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.GraphClientError=void 0;var Ry=(de(),ce(pe)),zy=(function(e){Ry.__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);Pn.GraphClientError=zy});var xn=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.isCustomHost=Ce.isGraphURL=Ce.serializeContent=Ce.urlJoin=Ce.oDataQueryNames=void 0;var ky=Di(),Dy=Ke();Ce.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var Cy=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=Cy;var Ny=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=Ny;var Uy=a(function(e){return hp(e)},"isGraphURL");Ce.isGraphURL=Uy;var My=a(function(e,t){return t.forEach(function(r){return Ly(r)}),hp(e,t)},"isCustomHost");Ce.isCustomHost=My;var hp=a(function(e,t){if(t===void 0&&(t=ky.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"),Ly=a(function(e){if(e.indexOf("/")!==-1)throw new Dy.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 ct=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.MiddlewareControl=void 0;var jy=(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})();bn.MiddlewareControl=jy});var Nt=b(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.cloneRequestWithNewUrl=Ne.appendRequestHeader=Ne.setRequestHeader=Ne.getRequestHeader=Ne.generateUUID=void 0;var gp=(de(),ce(pe)),Fy=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=Fy;var Vy=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=Vy;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 Hy=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=Hy;var Zy=a(function(e,t){return gp.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,c,d,f,v,y,l,m;return gp.__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,l=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:l,signal:m})]}})})},"cloneRequestWithNewUrl");Ne.cloneRequestWithNewUrl=Zy});var Ci=b(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.AuthenticationHandlerOptions=void 0;var qy=(function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e})();Tn.AuthenticationHandlerOptions=qy});var Mt=b(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.TelemetryHandlerOptions=Ut.FeatureUsageFlag=void 0;var yp=ct(),Ni;(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"})(Ni||(Ut.FeatureUsageFlag=Ni={}));var Gy=(function(){function e(){this.featureUsage=Ni.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof yp.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new yp.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})();Ut.TelemetryHandlerOptions=Gy});var En=b(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AuthenticationHandler=void 0;var vp=(de(),ce(pe)),_p=xn(),Wy=ct(),Ky=Nt(),Jy=Ci(),Pp=Mt(),Xy=(function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return vp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return vp.__generator(this,function(c){switch(c.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,_p.isGraphURL)(r)||t.customHosts&&(0,_p.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof Wy.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(Jy.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,Ky.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),Pp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Pp.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})();In.AuthenticationHandler=Xy});var An=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.HTTPMessageHandler=void 0;var xp=(de(),ce(pe)),Yy=(function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return xp.__awaiter(this,void 0,void 0,function(){var r;return xp.__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})();Sn.HTTPMessageHandler=Yy});var Pr=b(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.RetryHandlerOptions=void 0;var Qy=(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})();wn.RetryHandlerOptions=Qy});var On=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.RetryHandler=void 0;var Lt=(de(),ce(pe)),Ui=_r(),ev=ct(),bp=Nt(),Tp=Pr(),Ip=Mt(),tv=(function(){function e(t){t===void 0&&(t=new Tp.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===Ui.RequestMethod.PUT||n===Ui.RequestMethod.PATCH||n===Ui.RequestMethod.POST;if(o){var i=(0,bp.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 Lt.__awaiter(this,void 0,void 0,function(){var r;return Lt.__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 ev.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new Tp.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return Lt.__awaiter(this,void 0,void 0,function(){var o;return Lt.__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,bp.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 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),Ip.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Ip.FeatureUsageFlag.RETRY_HANDLER_ENABLED),[4,this.executeWithRetry(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.RETRY_STATUS_CODES=[429,503,504],e.RETRY_ATTEMPT_HEADER="Retry-Attempt",e.RETRY_AFTER_HEADER="Retry-After",e})();$n.RetryHandler=tv});var xr=b(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RedirectHandlerOptions=void 0;var rv=(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})();Rn.RedirectHandlerOptions=rv});var kn=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.RedirectHandler=void 0;var jt=(de(),ce(pe)),nv=_r(),ov=ct(),iv=Nt(),Mi=xr(),Ep=Mt(),av=(function(){function e(t){t===void 0&&(t=new Mi.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 jt.__awaiter(this,void 0,void 0,function(){var n,o;return jt.__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,iv.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 ov.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Mi.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Mi.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return jt.__awaiter(this,void 0,void 0,function(){var o,i;return jt.__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=nv.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 jt.__awaiter(this,void 0,void 0,function(){var r,n;return jt.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,Ep.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Ep.FeatureUsageFlag.REDIRECT_HANDLER_ENABLED),[4,this.executeWithRedirect(t,r,n)];case 1:return[2,o.sent()]}})})},e.prototype.setNext=function(t){this.nextMiddleware=t},e.REDIRECT_STATUS_CODES=[301,302,303,307,308],e.STATUS_CODE_SEE_OTHER=303,e.LOCATION_HEADER="Location",e.AUTHORIZATION_HEADER="Authorization",e.MANUAL_REDIRECT="manual",e})();zn.RedirectHandler=av});var Sp=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.PACKAGE_VERSION=void 0;Dn.PACKAGE_VERSION="3.0.7"});var Un=b(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.TelemetryHandler=void 0;var Ap=(de(),ce(pe)),wp=xn(),sv=Sp(),uv=ct(),Cn=Nt(),cv=Mt(),lv=(function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return Ap.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return Ap.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,wp.isGraphURL)(r)||t.customHosts&&(0,wp.isCustomHost)(r,t.customHosts)?(n=(0,Cn.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,Cn.generateUUID)(),(0,Cn.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(sv.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof uv.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(cv.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,Cn.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})();Nn.TelemetryHandler=lv});var $p=b(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.MiddlewareFactory=void 0;var pv=En(),dv=An(),fv=xr(),mv=Pr(),hv=kn(),gv=On(),yv=Un(),vv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),_v=(function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new pv.AuthenticationHandler(t),o=new gv.RetryHandler(new mv.RetryHandlerOptions),i=new yv.TelemetryHandler,s=new dv.HTTPMessageHandler;if(r.push(n),r.push(o),vv()){var u=new hv.RedirectHandler(new fv.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e})();Mn.MiddlewareFactory=_v});var jn=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.ChaosStrategy=void 0;var Op;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(Op||(Ln.ChaosStrategy=Op={}))});var Li=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.ChaosHandlerOptions=void 0;var Pv=jn(),xv=(function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=Pv.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})();Fn.ChaosHandlerOptions=xv});var Rp=b(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.httpStatusCode=Ft.methodStatusCode=void 0;Ft.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]};Ft.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 Dp=b(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ChaosHandler=void 0;var Vn=(de(),ce(pe)),bv=ct(),Tv=Nt(),zp=Rp(),ji=Li(),kp=jn(),Iv=(function(){function e(t,r){t===void 0&&(t=new ji.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=zp.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,Tv.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 Vn.__awaiter(this,void 0,void 0,function(){return Vn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===kp.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=zp.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===kp.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 bv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(ji.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new ji.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Vn.__awaiter(this,void 0,void 0,function(){var r;return Vn.__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})();Bn.ChaosHandler=Iv});var br=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ResponseType=void 0;var Cp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(Cp||(Hn.ResponseType=Cp={}))});var Vi=b(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.GraphResponseHandler=Vt.DocumentType=void 0;var Zn=(de(),ce(pe)),yt=br(),Fi;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Fi||(Vt.DocumentType=Fi={}));var qn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(qn||(qn={}));var Gn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Gn||(Gn={}));var Ev=(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 Zn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Zn.__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 yt.ResponseType.ARRAYBUFFER:return[3,1];case yt.ResponseType.BLOB:return[3,3];case yt.ResponseType.DOCUMENT:return[3,5];case yt.ResponseType.JSON:return[3,7];case yt.ResponseType.STREAM:return[3,9];case yt.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,Fi.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(Gn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Gn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==qn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==qn.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 Zn.__awaiter(this,void 0,void 0,function(){var o;return Zn.__generator(this,function(i){switch(i.label){case 0:return r!==yt.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})();Vt.GraphResponseHandler=Ev});var Bi=b(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Range=void 0;var Sv=(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})();Wn.Range=Sv});var Hi=b(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.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})();Kn.UploadResult=Av});var qi=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.LargeFileUploadTask=void 0;var Oe=(de(),ce(pe)),Zi=Ke(),wv=Vi(),Np=br(),Jn=Bi(),$v=Hi(),Ov=(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 Zi.GraphClientError("Please pass the FileUpload object, StreamUpload object or any custom implementation of the FileObject interface");this.file=r,o.rangeSize||(o.rangeSize=this.DEFAULT_FILE_SIZE),this.options=o,this.uploadSession=n,this.nextRange=new Jn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),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 Jn.Range;var n=r.split("-"),o=parseInt(n[0],10),i=parseInt(n[1],10);return Number.isNaN(i)&&(i=this.file.size-1),new Jn.Range(o,i)},e.prototype.updateTaskStatus=function(t){this.uploadSession.expiry=new Date(t.expirationDateTime),this.nextRange=this.parseRange(t.nextExpectedRanges)},e.prototype.getNextRange=function(){if(this.nextRange.minValue===-1)return this.nextRange;var t=this.nextRange.minValue,r=t+this.options.rangeSize-1;return r>=this.file.size&&(r=this.file.size-1),new Jn.Range(t,r)},e.prototype.sliceFile=function(t){if(console.warn("The LargeFileUploadTask.sliceFile() function has been deprecated and moved into the FileObject interface."),this.file.content instanceof ArrayBuffer||this.file.content instanceof Blob||this.file.content instanceof Uint8Array)return this.file.content.slice(t.minValue,t.maxValue+1);throw new Zi.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 Zi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,wv.GraphResponseHandler.getResponse(i)];case 4:return s=c.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,$v.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(Np.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(Np.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})();Xn.LargeFileUploadTask=Ov});var Gi=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.FileUpload=void 0;var Rv=Ke(),zv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Rv.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})();Yn.FileUpload=zv});var Wi=b(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.getValidRangeSize=void 0;var kv=5*1024*1024,Dv=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),Cv=a(function(e){e===void 0&&(e=kv);var t=60*1024*1024;return e>t&&(e=t),Dv(e)},"getValidRangeSize");Qn.getValidRangeSize=Cv});var Mp=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.OneDriveLargeFileUploadTask=void 0;var Je=(de(),ce(pe)),Up=Ke(),Nv=Gi(),Uv=qi(),Mv=Wi(),Lv=(function(e){Je.__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 Je.__awaiter(this,void 0,void 0,function(){var i,s,u;return Je.__generator(this,function(c){if(!r||!n||!o)throw new Up.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new Nv.FileUpload(s.content,i,s.size),[2,this.createTaskWithFileObject(r,u,o)]})})},t.createTaskWithFileObject=function(r,n,o){return Je.__awaiter(this,void 0,void 0,function(){var i,s,u,c;return Je.__generator(this,function(d){switch(d.label){case 0:if(!r||!n||!o)throw new Up.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,Mv.getValidRangeSize)(o.rangeSize),[2,new t(r,n,u,{rangeSize:c,uploadEventHandlers:o.uploadEventHandlers})]}})})},t.createUploadSession=function(r,n,o){return Je.__awaiter(this,void 0,void 0,function(){var i;return Je.__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"),Je.__awaiter(this,void 0,void 0,function(){var o;return Je.__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})(Uv.LargeFileUploadTask);eo.OneDriveLargeFileUploadTask=Lv});var jp=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.StreamUpload=void 0;var Lp=(de(),ce(pe)),Tr=Ke(),jv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Tr.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 Lp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c;return Lp.__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 Tr.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 Tr.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 Tr.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 Tr.GraphClientError("Error encountered while reading the stream during the upload"))})})},e})();to.StreamUpload=jv});var Fp=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.PageIterator=void 0;var Bt=(de(),ce(pe)),Fv=(function(){function e(t,r,n,o){this.client=t,this.collection=r.value,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],this.callback=n,this.cursor=0,this.complete=!1,this.requestOptions=o}return a(e,"PageIterator"),e.prototype.iterationHelper=function(){if(this.collection===void 0)return!1;for(var t=!0;t&&this.cursor<this.collection.length;){var r=this.collection[this.cursor];t=this.callback(r),this.cursor++}return t},e.prototype.fetchAndUpdateNextPageData=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t,r;return Bt.__generator(this,function(n){switch(n.label){case 0:return t=this.client.api(this.nextLink),this.requestOptions&&(this.requestOptions.headers&&(t=t.headers(this.requestOptions.headers)),this.requestOptions.middlewareOptions&&(t=t.middlewareOptions(this.requestOptions.middlewareOptions)),this.requestOptions.options&&(t=t.options(this.requestOptions.options))),[4,t.get()];case 1:return r=n.sent(),this.collection=r.value,this.cursor=0,this.nextLink=r["@odata.nextLink"],this.deltaLink=r["@odata.deltaLink"],[2]}})})},e.prototype.getDeltaLink=function(){return this.deltaLink},e.prototype.iterate=function(){return Bt.__awaiter(this,void 0,void 0,function(){var t;return Bt.__generator(this,function(r){switch(r.label){case 0:t=this.iterationHelper(),r.label=1;case 1:return t?this.nextLink===void 0?[3,3]:[4,this.fetchAndUpdateNextPageData()]:[3,5];case 2:return r.sent(),t=this.iterationHelper(),[3,4];case 3:t=!1,r.label=4;case 4:return[3,1];case 5:return this.nextLink===void 0&&this.cursor>=this.collection.length&&(this.complete=!0),[2]}})})},e.prototype.resume=function(){return Bt.__awaiter(this,void 0,void 0,function(){return Bt.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e})();ro.PageIterator=Fv});var Ki=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.CustomAuthenticationProvider=void 0;var no=(de(),ce(pe)),Vp=Ke(),Vv=(function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return no.__awaiter(this,void 0,void 0,function(){var t=this;return no.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return no.__awaiter(t,void 0,void 0,function(){var u,c;return no.__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 Vp.GraphClientError(u)),[4,Vp.GraphClientError.setGraphClientError(i)];case 2:c=d.sent(),o(c),d.label=3;case 3:return[2]}})})})})]})})},e})();oo.CustomAuthenticationProvider=Vv});var Ji=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.GraphError=void 0;var Bv=(de(),ce(pe)),Hv=(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);io.GraphError=Hv});var Hp=b(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.GraphErrorHandler=void 0;var Bp=(de(),ce(pe)),Xi=Ji(),Zv=(function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Xi.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 Xi.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),Bp.__awaiter(this,void 0,void 0,function(){var i;return Bp.__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 Xi.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e})();ao.GraphErrorHandler=Zv});var Yi=b(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.GraphRequest=void 0;var ae=(de(),ce(pe)),qv=Ke(),Gv=Hp(),Ir=xn(),Wv=Vi(),Kv=ct(),vt=_r(),Jv=br(),Xv=(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,Ir.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(Ir.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(l){switch(l.label){case 0:s=new Kv.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,l.label=1;case 1:return l.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return c=l.sent(),i=c.response,[4,Wv.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(f=l.sent(),f instanceof qv.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,Gv.GraphErrorHandler.getError(f,v,n,i)];case 5:throw y=l.sent(),y;case 6:return[2]}})})},e.prototype.setHeaderContentType=function(){if(!this._headers){this.header("Content-Type","application/json");return}for(var t=Object.keys(this._headers),r=0,n=t;r<n.length;r++){var o=n[r];if(o.toLowerCase()==="content-type")return}this.header("Content-Type","application/json")},e.prototype.header=function(t,r){return this._headers[t]=r,this},e.prototype.headers=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._headers[r]=t[r]);return this},e.prototype.option=function(t,r){return this._options[t]=r,this},e.prototype.options=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._options[r]=t[r]);return this},e.prototype.middlewareOptions=function(t){return this._middlewareOptions=t,this},e.prototype.version=function(t){return this.urlComponents.version=t,this},e.prototype.responseType=function(t){return this._responseType=t,this},e.prototype.select=function(t){return this.addCsvQueryParameter("$select",t,arguments),this},e.prototype.expand=function(t){return this.addCsvQueryParameter("$expand",t,arguments),this},e.prototype.orderby=function(t){return this.addCsvQueryParameter("$orderby",t,arguments),this},e.prototype.filter=function(t){return this.urlComponents.oDataQueryParams.$filter=t,this},e.prototype.search=function(t){return this.urlComponents.oDataQueryParams.$search=t,this},e.prototype.top=function(t){return this.urlComponents.oDataQueryParams.$top=t,this},e.prototype.skip=function(t){return this.urlComponents.oDataQueryParams.$skip=t,this},e.prototype.skipToken=function(t){return this.urlComponents.oDataQueryParams.$skipToken=t,this},e.prototype.count=function(t){return t===void 0&&(t=!0),this.urlComponents.oDataQueryParams.$count=t.toString(),this},e.prototype.query=function(t){return this.parseQueryParameter(t)},e.prototype.get=function(t){return 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:vt.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:vt.RequestMethod.POST,body:(0,Ir.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:vt.RequestMethod.PUT,body:(0,Ir.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:vt.RequestMethod.PATCH,body:(0,Ir.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:vt.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:vt.RequestMethod.GET},this.responseType(Jv.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:vt.RequestMethod.PUT,headers:{"Content-Type":"application/octet-stream"},body:t},[4,this.send(n,o,r)];case 1:return[2,i.sent()]}})})},e})();so.GraphRequest=Xv});var Qi=b(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.HTTPClient=void 0;var Zp=(de(),ce(pe)),Yv=(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})();uo.HTTPClient=Yv});var Gp=b(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.HTTPClientFactory=void 0;var Qv=(de(),ce(pe)),qp=Qi(),e_=En(),t_=An(),r_=xr(),n_=Pr(),o_=kn(),i_=On(),a_=Un(),s_=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),u_=(function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new e_.AuthenticationHandler(t),n=new i_.RetryHandler(new n_.RetryHandlerOptions),o=new a_.TelemetryHandler,i=new t_.HTTPMessageHandler;if(r.setNext(n),s_()){var s=new o_.RedirectHandler(new r_.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(qp.HTTPClient.bind.apply(qp.HTTPClient,Qv.__spreadArray([void 0],t,!1)))},e})();co.HTTPClientFactory=u_});var Wp=b(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.validatePolyFilling=void 0;var c_=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");lo.validatePolyFilling=c_});var Xp=b(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.Client=void 0;var l_=(de(),ce(pe)),Kp=Di(),p_=Ki(),d_=Yi(),Jp=Qi(),f_=Gp(),m_=Wp(),h_=(function(){function e(t){this.config={baseUrl:Kp.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Kp.GRAPH_API_VERSION},(0,m_.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=f_.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Jp.HTTPClient.bind.apply(Jp.HTTPClient,l_.__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 p_.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new d_.GraphRequest(this.httpClient,this.config,t)},e})();po.Client=h_});var se=b(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.ResponseType=R.GraphRequest=R.GraphClientError=R.GraphError=R.CustomAuthenticationProvider=R.Client=R.PageIterator=R.Range=R.UploadResult=R.FileUpload=R.StreamUpload=R.getValidRangeSize=R.OneDriveLargeFileUploadTask=R.LargeFileUploadTask=R.ChaosHandler=R.ChaosStrategy=R.ChaosHandlerOptions=R.TelemetryHandlerOptions=R.FeatureUsageFlag=R.RedirectHandlerOptions=R.RetryHandlerOptions=R.AuthenticationHandlerOptions=R.MiddlewareFactory=R.TelemetryHandler=R.RedirectHandler=R.RetryHandler=R.HTTPMessageHandler=R.AuthenticationHandler=R.BatchResponseContent=R.BatchRequestContent=void 0;var g_=fp();Object.defineProperty(R,"BatchRequestContent",{enumerable:!0,get:a(function(){return g_.BatchRequestContent},"get")});var y_=mp();Object.defineProperty(R,"BatchResponseContent",{enumerable:!0,get:a(function(){return y_.BatchResponseContent},"get")});var v_=En();Object.defineProperty(R,"AuthenticationHandler",{enumerable:!0,get:a(function(){return v_.AuthenticationHandler},"get")});var __=An();Object.defineProperty(R,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return __.HTTPMessageHandler},"get")});var P_=On();Object.defineProperty(R,"RetryHandler",{enumerable:!0,get:a(function(){return P_.RetryHandler},"get")});var x_=kn();Object.defineProperty(R,"RedirectHandler",{enumerable:!0,get:a(function(){return x_.RedirectHandler},"get")});var b_=Un();Object.defineProperty(R,"TelemetryHandler",{enumerable:!0,get:a(function(){return b_.TelemetryHandler},"get")});var T_=$p();Object.defineProperty(R,"MiddlewareFactory",{enumerable:!0,get:a(function(){return T_.MiddlewareFactory},"get")});var I_=Ci();Object.defineProperty(R,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return I_.AuthenticationHandlerOptions},"get")});var E_=Pr();Object.defineProperty(R,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return E_.RetryHandlerOptions},"get")});var S_=xr();Object.defineProperty(R,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return S_.RedirectHandlerOptions},"get")});var Yp=Mt();Object.defineProperty(R,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return Yp.FeatureUsageFlag},"get")});Object.defineProperty(R,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return Yp.TelemetryHandlerOptions},"get")});var A_=Li();Object.defineProperty(R,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return A_.ChaosHandlerOptions},"get")});var w_=jn();Object.defineProperty(R,"ChaosStrategy",{enumerable:!0,get:a(function(){return w_.ChaosStrategy},"get")});var $_=Dp();Object.defineProperty(R,"ChaosHandler",{enumerable:!0,get:a(function(){return $_.ChaosHandler},"get")});var O_=qi();Object.defineProperty(R,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return O_.LargeFileUploadTask},"get")});var R_=Mp();Object.defineProperty(R,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return R_.OneDriveLargeFileUploadTask},"get")});var z_=Wi();Object.defineProperty(R,"getValidRangeSize",{enumerable:!0,get:a(function(){return z_.getValidRangeSize},"get")});var k_=jp();Object.defineProperty(R,"StreamUpload",{enumerable:!0,get:a(function(){return k_.StreamUpload},"get")});var D_=Gi();Object.defineProperty(R,"FileUpload",{enumerable:!0,get:a(function(){return D_.FileUpload},"get")});var C_=Hi();Object.defineProperty(R,"UploadResult",{enumerable:!0,get:a(function(){return C_.UploadResult},"get")});var N_=Bi();Object.defineProperty(R,"Range",{enumerable:!0,get:a(function(){return N_.Range},"get")});var U_=Fp();Object.defineProperty(R,"PageIterator",{enumerable:!0,get:a(function(){return U_.PageIterator},"get")});var M_=Xp();Object.defineProperty(R,"Client",{enumerable:!0,get:a(function(){return M_.Client},"get")});var L_=Ki();Object.defineProperty(R,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return L_.CustomAuthenticationProvider},"get")});var j_=Ji();Object.defineProperty(R,"GraphError",{enumerable:!0,get:a(function(){return j_.GraphError},"get")});var F_=Ke();Object.defineProperty(R,"GraphClientError",{enumerable:!0,get:a(function(){return F_.GraphClientError},"get")});var V_=Yi();Object.defineProperty(R,"GraphRequest",{enumerable:!0,get:a(function(){return V_.GraphRequest},"get")});var B_=br();Object.defineProperty(R,"ResponseType",{enumerable:!0,get:a(function(){return B_.ResponseType},"get")})});var Ht=b((ra,na)=>{(function(e,t){typeof ra=="object"&&typeof na<"u"?na.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(ra,(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",l="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,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 k=String(V);return!k||k.length>=w?V:""+Array(w+1-k.length).join(E)+V},"m"),I={s:P,z:a(function(V){var w=-V.utcOffset(),E=Math.abs(w),k=Math.floor(E/60),O=E%60;return(w<=0?"+":"-")+P(k,2,"0")+":"+P(O,2,"0")},"z"),m:a(function V(w,E){if(w.date()<E.date())return-V(E,w);var k=12*(E.year()-w.year())+(E.month()-w.month()),O=w.clone().add(k,d),q=E-O<0,G=w.clone().add(k+(q?-1:1),d);return+(-(k+(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 _t},"p"),Le=a(function V(w,E,k){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!k&&O&&(Z=O),O||!k&&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 _t(E)},"w"),K=I;K.l=Le,K.i=Ee,K.w=function(V,w){return ne(V,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var _t=(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(k){var O=k.date,q=k.utc;if(O===null)return new Date(NaN);if(K.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 K},w.isValid=function(){return this.$d.toString()!==l},w.isSame=function(E,k){var O=ne(E);return this.startOf(k)<=O&&O<=this.endOf(k)},w.isAfter=function(E,k){return ne(E)<this.startOf(k)},w.isBefore=function(E,k){return this.endOf(k)<ne(E)},w.$g=function(E,k,O){return K.u(E)?this[k]:this.set(O,E)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(E,k){var O=this,q=!!K.u(k)||k,G=K.p(E),oe=a(function(dt,we){var Ye=K.w(O.$u?Date.UTC(O.$y,we,dt):new Date(O.$y,we,dt),O);return q?Ye:Ye.endOf(u)},"l"),ye=a(function(dt,we){return K.w(O.toDate()[dt].apply(O.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(we)),O)},"$"),xe=this.$W,Te=this.$M,ke=this.$D,Pt="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 pt=this.$locale().weekStart||0,Zt=(xe<pt?xe+7:xe)-pt;return oe(q?ke-Zt:ke+(6-Zt),Te);case u:case y:return ye(Pt+"Hours",0);case s:return ye(Pt+"Minutes",1);case i:return ye(Pt+"Seconds",2);case o:return ye(Pt+"Milliseconds",3);default:return this.clone()}},w.endOf=function(E){return this.startOf(E,!1)},w.$set=function(E,k){var O,q=K.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+(k-this.$W):k;if(q===d||q===v){var xe=this.clone().set(y,1);xe.$d[oe](ye),xe.init(),this.$d=xe.set(y,Math.min(this.$D,xe.daysInMonth())).$d}else oe&&this.$d[oe](ye);return this.init(),this},w.set=function(E,k){return this.clone().$set(E,k)},w.get=function(E){return this[K.p(E)]()},w.add=function(E,k){var O,q=this;E=Number(E);var G=K.p(k),oe=a(function(Te){var ke=ne(q);return K.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,xe=this.$d.getTime()+E*ye;return K.w(xe,this)},w.subtract=function(E,k){return this.add(-1*E,k)},w.format=function(E){var k=this,O=this.$locale();if(!this.isValid())return O.invalidDate||l;var q=E||"YYYY-MM-DDTHH:mm:ssZ",G=K.z(this),oe=this.$H,ye=this.$m,xe=this.$M,Te=O.weekdays,ke=O.months,Pt=O.meridiem,pt=a(function(we,Ye,qt,zr){return we&&(we[Ye]||we(k,q))||qt[Ye].slice(0,zr)},"h"),Zt=a(function(we){return K.s(oe%12||12,we,"0")},"d"),dt=Pt||function(we,Ye,qt){var zr=we<12?"AM":"PM";return qt?zr.toLowerCase():zr};return q.replace(_,(function(we,Ye){return Ye||(function(qt){switch(qt){case"YY":return String(k.$y).slice(-2);case"YYYY":return K.s(k.$y,4,"0");case"M":return xe+1;case"MM":return K.s(xe+1,2,"0");case"MMM":return pt(O.monthsShort,xe,ke,3);case"MMMM":return pt(ke,xe);case"D":return k.$D;case"DD":return K.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return pt(O.weekdaysMin,k.$W,Te,2);case"ddd":return pt(O.weekdaysShort,k.$W,Te,3);case"dddd":return Te[k.$W];case"H":return String(oe);case"HH":return K.s(oe,2,"0");case"h":return Zt(1);case"hh":return Zt(2);case"a":return dt(oe,ye,!0);case"A":return dt(oe,ye,!1);case"m":return String(ye);case"mm":return K.s(ye,2,"0");case"s":return String(k.$s);case"ss":return K.s(k.$s,2,"0");case"SSS":return K.s(k.$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,k,O){var q,G=this,oe=K.p(k),ye=ne(E),xe=(ye.utcOffset()-this.utcOffset())*t,Te=this-ye,ke=a(function(){return K.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-xe)/6048e5;break;case u:q=(Te-xe)/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:K.a(q)},w.daysInMonth=function(){return this.endOf(d).$D},w.$locale=function(){return ge[this.$L]},w.locale=function(E,k){if(!E)return this.$L;var O=this.clone(),q=Le(E,k,!0);return q&&(O.$L=q),O},w.clone=function(){return K.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})(),lt=_t.prototype;return ne.prototype=lt,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach((function(V){lt[V[1]]=function(w){return this.$g(w,V[0],V[1])}})),ne.extend=function(V,w){return V.$i||(V(w,_t,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 K_={};To(K_,{microsoftSharePoint:()=>W_});module.exports=ce(K_);var Gd=Object.freeze({status:"aborted"});function z(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(z,"$constructor");var je=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},kr=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Io={};function Be(e){return e&&Object.assign(Io,e),Io}a(Be,"config");function So(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(So,"getEnumValues");function ua(e,t){return typeof t=="bigint"?t.toString():t}a(ua,"jsonStringifyReplacer");function Cr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Cr,"cached");function ca(e){return e==null}a(ca,"nullish");function Nr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Nr,"cleanRegex");var sa=Symbol("evaluating");function ve(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==sa)return n===void 0&&(n=sa,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(ve,"defineLazy");var Ao="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Wt,"isObject");var Wd=Cr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function la(e){if(Wt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Wt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(la,"isPlainObject");var pa=new Set(["string","number","symbol"]);function xt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(xt,"escapeRegex");function Ur(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Ur,"clone");function ue(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(ue,"normalizeParams");function da(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(da,"optionalKeys");var fa={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 bt(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(bt,"aborted");function Qe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(Qe,"prefixIssues");function Dr(e){return typeof e=="string"?e:e?.message}a(Dr,"unwrapMessage");function et(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Dr(e.inst?._zod.def?.error?.(e))??Dr(t?.error?.(e))??Dr(r.customError?.(e))??Dr(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(et,"finalizeIssue");function ma(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(ma,"getLengthableOrigin");function wo(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(wo,"issue");var ha=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,ua,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),ga=z("$ZodError",ha),Kt=z("$ZodError",ha,{Parent:Error});var Jd=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=>et(c,i,Be())));throw Ao(u,o?.callee),u}return s.value},"_parse"),Mr=Jd(Kt),Xd=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=>et(c,i,Be())));throw Ao(u,o?.callee),u}return s.value},"_parseAsync"),Lr=Xd(Kt),Yd=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??ga)(i.issues.map(s=>et(s,o,Be())))}:{success:!0,data:i.value}},"_safeParse"),Jt=Yd(Kt),Qd=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=>et(s,o,Be())))}:{success:!0,data:i.value}},"_safeParseAsync"),Xt=Qd(Kt);var ef="(?:(?:\\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])))",tf=new RegExp(`^${ef}$`);var ya=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),va=/^-?\d+n?$/,_a=/^-?\d+$/,$o=/^-?\d+(?:\.\d+)?$/,Pa=/^(?:true|false)$/i;var tt=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rf={number:"number",bigint:"bigint",object:"date"};var xa=z("$ZodCheckGreaterThan",(e,t)=>{tt.init(e,t);let r=rf[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var ba=z("$ZodCheckNumberFormat",(e,t)=>{tt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=fa[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=o,u.maximum=i,r&&(u.pattern=_a)}),e._zod.check=s=>{let u=s.value;if(r){if(!Number.isInteger(u)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}u<o&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var Ta=z("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ca(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=ma(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Oo=z("$ZodCheckStringFormat",(e,t)=>{var r,n;tt.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=()=>{})}),Ia=z("$ZodCheckRegex",(e,t)=>{Oo.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 Sa={major:4,minor:3,patch:6};var fe=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sa;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=bt(s),f;for(let v of u){if(v._zod.def.when){if(!v._zod.def.when(s))continue}else if(d)continue;let y=s.issues.length,l=v._zod.check(s);if(l instanceof Promise&&c?.async===!1)throw new je;if(f||l instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await l,s.issues.length!==y&&(d||(d=bt(s,y)))});else{if(s.issues.length===y)continue;d||(d=bt(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,c)=>{if(bt(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=Jt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Xt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Vr=z("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ya(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}}),Ro=z("$ZodStringFormat",(e,t)=>{Oo.init(e,t),Vr.init(e,t)});var Ra=z("$ZodURL",(e,t)=>{Ro.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 zo=z("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??$o,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}}),za=z("$ZodNumberFormat",(e,t)=>{ba.init(e,t),zo.init(e,t)}),ko=z("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=Pa,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}}),ka=z("$ZodBigInt",(e,t)=>{fe.init(e,t),e._zod.pattern=va,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 Da=z("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r}),Ca=z("$ZodUnknown",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r});var Na=z("$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}}),Ua=z("$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 Aa(e,t,r){e.issues.length&&t.issues.push(...Qe(r,e.issues)),t.value[r]=e.value}a(Aa,"handleArrayResult");var Ma=z("$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=>Aa(d,r,s))):Aa(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Fr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Qe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Fr,"handlePropertyResult");function nf(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=da(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(nf,"normalizeDef");function of(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(l=>Fr(l,r,v,t,f))):Fr(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(of,"handleCatchall");var La=z("$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=Cr(()=>nf(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=Wt,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 l=v[y],m=l._zod.optout==="optional",_=l._zod.run({value:d[y],issues:[]},c);_ instanceof Promise?f.push(_.then(g=>Fr(g,u,y,d,m))):Fr(_,u,y,d,m)}return i?of(f,d,u,c,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function wa(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=>!bt(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=>et(s,n,Be())))}),t)}a(wa,"handleUnionResults");var Do=z("$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=>Nr(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=>wa(c,o,e,i)):wa(u,o,e,i)}});var ja=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Do.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=Cr(()=>{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(!Wt(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 Fa=z("$ZodRecord",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!la(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(...Qe(d,v.issues)),r.value[d]=v.value})):(f.issues.length&&r.issues.push(...Qe(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"&&$o.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=>et(v,n,Be())),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(...Qe(u,v.issues)),r.value[c.value]=v.value})):(f.issues.length&&r.issues.push(...Qe(u,f.issues)),r.value[c.value]=f.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Va=z("$ZodEnum",(e,t)=>{fe.init(e,t);let r=So(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>pa.has(typeof o)).map(o=>typeof o=="string"?xt(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Ba=z("$ZodLiteral",(e,t)=>{if(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"?xt(n):n?xt(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 Ha=z("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new kr(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 $a(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a($a,"handleOptionalResult");var Za=z("$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(`^(${Nr(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=>$a(i,r.value)):$a(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var qa=z("$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(`^(${Nr(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 Ga=z("$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=>jr(s,t.in,n)):jr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>jr(i,t.out,n)):jr(o,t.out,n)}});function jr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(jr,"handlePipeResult");var Wa=z("$ZodCustom",(e,t)=>{tt.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=>Oa(i,r,n,e));Oa(o,r,n,e)}});function Oa(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(wo(o))}}a(Oa,"handleRefineResult");var Ja;var Co=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 Xa(){return new Co}a(Xa,"registry");(Ja=globalThis).__zod_globalRegistry??(Ja.__zod_globalRegistry=Xa());var No=globalThis.__zod_globalRegistry;function Ya(e,t){return new e({type:"string",...ue(t)})}a(Ya,"_string");function Qa(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(Qa,"_coercedString");function es(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(es,"_url");function ts(e,t){return new e({type:"number",checks:[],...ue(t)})}a(ts,"_number");function rs(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(rs,"_coercedNumber");function ns(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}a(ns,"_int");function os(e,t){return new e({type:"boolean",...ue(t)})}a(os,"_boolean");function is(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(is,"_coercedBoolean");function as(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(as,"_coercedBigint");function ss(e){return new e({type:"any"})}a(ss,"_any");function us(e){return new e({type:"unknown"})}a(us,"_unknown");function cs(e,t){return new e({type:"void",...ue(t)})}a(cs,"_void");function ls(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(ls,"_coercedDate");function Br(e,t){return new xa({check:"greater_than",...ue(t),value:e,inclusive:!0})}a(Br,"_gte");function Ue(e,t){return new Ta({check:"min_length",...ue(t),minimum:e})}a(Ue,"_minLength");function rt(e,t){return new Ia({check:"string_format",format:"regex",...ue(t),pattern:e})}a(rt,"_regex");function ps(e,t,r){let n=ue(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(ps,"_custom");var _e=z("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)=>Mr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Jt(e,r,n),e.parseAsync=async(r,n)=>Lr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Xt(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)=>Ur(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Zr=z("ZodMiniString",(e,t)=>{Vr.init(e,t),_e.init(e,t)});function p(e){return Ya(Zr,e)}a(p,"string");var ds=z("ZodMiniStringFormat",(e,t)=>{Ro.init(e,t),Zr.init(e,t)});var vf=z("ZodMiniURL",(e,t)=>{Ra.init(e,t),ds.init(e,t)});function fs(e){return es(vf,e)}a(fs,"url");var qr=z("ZodMiniNumber",(e,t)=>{zo.init(e,t),_e.init(e,t)});function Se(e){return ts(qr,e)}a(Se,"number");var _f=z("ZodMiniNumberFormat",(e,t)=>{za.init(e,t),qr.init(e,t)});function ms(e){return ns(_f,e)}a(ms,"int");var Uo=z("ZodMiniBoolean",(e,t)=>{ko.init(e,t),_e.init(e,t)});function re(e){return os(Uo,e)}a(re,"boolean");var hs=z("ZodMiniBigInt",(e,t)=>{ka.init(e,t),_e.init(e,t)});var Pf=z("ZodMiniAny",(e,t)=>{Da.init(e,t),_e.init(e,t)});function Qt(){return ss(Pf)}a(Qt,"any");var xf=z("ZodMiniUnknown",(e,t)=>{Ca.init(e,t),_e.init(e,t)});function L(){return us(xf)}a(L,"unknown");var bf=z("ZodMiniVoid",(e,t)=>{Na.init(e,t),_e.init(e,t)});function gs(e){return cs(bf,e)}a(gs,"_void");var ys=z("ZodMiniDate",(e,t)=>{Ua.init(e,t),_e.init(e,t)});var Tf=z("ZodMiniArray",(e,t)=>{Ma.init(e,t),_e.init(e,t)});function B(e,t){return new Tf({type:"array",element:e,...ue(t)})}a(B,"array");var If=z("ZodMiniObject",(e,t)=>{La.init(e,t),_e.init(e,t),ve(e,"shape",()=>t.shape)});function h(e,t){let r={type:"object",shape:e??{},...ue(t)};return new If(r)}a(h,"object");var Ef=z("ZodMiniUnion",(e,t)=>{Do.init(e,t),_e.init(e,t)});function H(e,t){return new Ef({type:"union",options:e,...ue(t)})}a(H,"union");var Sf=z("ZodMiniDiscriminatedUnion",(e,t)=>{ja.init(e,t),_e.init(e,t)});function nt(e,t,r){return new Sf({type:"union",options:t,discriminator:e,...ue(r)})}a(nt,"discriminatedUnion");var Af=z("ZodMiniRecord",(e,t)=>{Fa.init(e,t),_e.init(e,t)});function j(e,t,r){return new Af({type:"record",keyType:e,valueType:t,...ue(r)})}a(j,"record");var wf=z("ZodMiniEnum",(e,t)=>{Va.init(e,t),_e.init(e,t),e.options=Object.values(t.entries)});function J(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new wf({type:"enum",entries:r,...ue(t)})}a(J,"_enum");var $f=z("ZodMiniLiteral",(e,t)=>{Ba.init(e,t),_e.init(e,t)});function C(e,t){return new $f({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a(C,"literal");var Of=z("ZodMiniTransform",(e,t)=>{Ha.init(e,t),_e.init(e,t)});function ot(e){return new Of({type:"transform",transform:e})}a(ot,"transform");var Rf=z("ZodMiniOptional",(e,t)=>{Za.init(e,t),_e.init(e,t)});function x(e){return new Rf({type:"optional",innerType:e})}a(x,"optional");var zf=z("ZodMiniNullable",(e,t)=>{qa.init(e,t),_e.init(e,t)});function er(e){return new zf({type:"nullable",innerType:e})}a(er,"nullable");var kf=z("ZodMiniPipe",(e,t)=>{Ga.init(e,t),_e.init(e,t)});function it(e,t){return new kf({type:"pipe",in:e,out:t})}a(it,"pipe");var Df=z("ZodMiniCustom",(e,t)=>{Wa.init(e,t),_e.init(e,t)});function Gr(e,t){return ps(Df,e??(()=>!0),t)}a(Gr,"custom");var tr={};To(tr,{bigint:()=>jf,boolean:()=>Lf,date:()=>Ff,number:()=>Mf,string:()=>Uf});function Uf(e){return Qa(Zr,e)}a(Uf,"string");function Mf(e){return rs(qr,e)}a(Mf,"number");function Lf(e){return is(Uo,e)}a(Lf,"boolean");function jf(e){return as(hs,e)}a(jf,"bigint");function Ff(e){return ls(ys,e)}a(Ff,"date");var Lo=h({retryOnFailure:h({defaultValue:x(re()),hide:x(re())}),continueOnFailure:h({defaultValue:x(re()),hide:x(re())})}),Mo=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 Mo(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:p(),description:x(p())}),W=a((e,t)=>h({type:C(t),required:re(),defaultValue:x(Qt())}),"TPropertyValue");var Re=h({...te.shape,...W(p(),"SHORT_TEXT").shape}),He=h({...te.shape,...W(p(),"LONG_TEXT").shape});var _s=h({label:p(),value:L()}),Wr=h({disabled:x(re()),placeholder:x(p()),options:B(_s)});var ze=h({...te.shape,options:Wr,...W(L(),"STATIC_DROPDOWN").shape}),Ze=h({...te.shape,options:Wr,...W(B(L()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var jo=h({...te.shape,...W(L(),"DROPDOWN").shape,refreshers:B(p())}),rr=h({...te.shape,...W(B(L()),"MULTI_SELECT_DROPDOWN").shape,refreshers:B(p())});var qe=h({...te.shape,...W(re(),"CHECKBOX").shape});var Ge=h({...te.shape,...W(Se(),"NUMBER").shape});var nr=h({...te.shape,streaming:x(re()),...W(L(),"FILE").shape});var or=h({...te.shape,...W(p(),"DATE_TIME").shape});var Ps=j(p(),H([Re,He,ze,rr,Ze,qe,Ge,nr,or])),ir=h({...te.shape,properties:Ps,...W(B(L()),"ARRAY").shape});var ar=h({...te.shape,...W(H([j(p(),L())]),"JSON").shape});var xs=H([Re,ze,ar,ir,Ze]),Bf=j(p(),xs),Fo=h({refreshers:B(p()),...te.shape,...W(L(),"DYNAMIC").shape});var Kr=h({...te.shape,...W(gs(),"MARKDOWN").shape});var sr=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(sr||{}),Tt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Tt||{}),It=(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))(It||{});var ur=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ur||{}),Vo="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||{}),cr=(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))(cr||{}),Hf=h({strategy:J(cr),paramName:x(p())}),lr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(lr||{});var Jr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Jr||{}),bs=h({status:x(Se()),body:x(L()),headers:x(j(p(),p()))}),Ts=h({type:C("DELAY"),resumeDateTime:p(),requestIdToReply:x(p()),handlerId:x(p()),streamStepProgress:x(J(Jr))}),Is=h({type:C("WEBHOOK"),requestId:p(),requestIdToReply:x(p()),response:bs,handlerId:x(p()),streamStepProgress:x(J(Jr))}),Zf=H([Ts,Is]);var qf=h({body:L(),rawBody:x(L()),headers:j(p(),p()),queryParams:j(p(),p())});function Pe(e){return e==null}a(Pe,"isNil");function pr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(pr,"isEmpty");function Xr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(Xr,"assertNotNullOrUndefined");var Bo=Y(require("crypto"),1);var Gf=128,ft,Et,Wf=a(e=>{!ft||ft.length<e?(ft=Buffer.allocUnsafe(e*Gf),Bo.default.randomFillSync(ft),Et=0):Et+e>ft.length&&(Bo.default.randomFillSync(ft),Et=0),Et+=e},"fillPool"),Kf=a(e=>(Wf(e|=0),ft.subarray(Et-e,Et)),"random"),Jf=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"),Ss=a((e,t=21)=>Jf(e,t,Kf),"customAlphabet");var Xf="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",As=21,$$=p().check(rt(new RegExp(`^[0-9a-zA-Z]{${As}}$`))),Yf=Ss(Xf,As);var at=it(ot(e=>e instanceof Date?e.toISOString():e),p()),De={id:p(),created:at,updated:at},le=a(e=>x(er(e)),"Nullable");function Ho(e){return x(er(J(e)))}a(Ho,"NullableEnum");var z$=it(ot(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),x(re())),Yr=a(e=>it(ot(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),x(B(e))),"OptionalArrayFromQuery");var C$=j(p(),L());var dr=(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))(dr||{});var G$=p().check(rt(/^#[0-9A-Fa-f]{6}$/));var K$=h({filename:p(),data:L(),type:C("file"),mimetype:x(p())});var Qf=Y($s());var rO=h({...De,name:p(),permissions:B(p()),platformId:le(p()),type:p(),userCount:x(Se())});var Os=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Os||{}),Zo=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Zo||{}),qo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(qo||{});var Go=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Go||{});var Wo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Wo||{});var em=h({mode:J(Os),value:L()}),tm=h({auth:x(p()),fields:j(p(),em)}),rm=h({pieceName:p(),pieceVersion:p(),actionName:p(),predefinedInput:x(tm)}),nm=h({type:C("PIECE"),toolName:p().check(Ue(1)),pieceMetadata:rm}),om=h({type:C("none")}),im=h({type:C("access_token"),accessToken:p()}),am=h({type:C("api_key"),apiKey:p(),apiKeyHeader:p()}),sm=h({type:C("headers"),headers:j(p(),p())}),um=nt("type",[om,im,am,sm]),Rs=h({type:C("FLOW"),toolName:p().check(Ue(1)),externalFlowId:p(),flowDisplayName:x(p())}),zs=h({type:C("MCP"),toolName:p().check(Ue(1)),serverUrl:fs(),protocol:J(qo),auth:um}),ks=h({type:C("KNOWLEDGE_BASE"),toolName:p().check(Ue(1)),sourceType:J(Zo),sourceId:p(),sourceName:p()}),cm=nt("type",[nm,Rs,zs,ks]),lm=h({displayName:p(),description:x(p()),type:J(Go)}),Ds=h({type:C("MARKDOWN"),markdown:p()}),St={type:C("TOOL_CALL"),input:le(j(p(),L())),output:x(L()),toolName:p(),status:J(Wo),toolCallId:p(),startTime:p(),endTime:x(p())},kO=h(St),Cs=nt("toolCallType",[h({...St,toolCallType:C("PIECE"),pieceName:p(),pieceVersion:p(),actionName:p()}),h({...St,toolCallType:C("FLOW"),displayName:p(),externalFlowId:p()}),h({...St,toolCallType:C("MCP"),displayName:p(),serverUrl:p()}),h({...St,toolCallType:C("KNOWLEDGE_BASE"),displayName:p(),sourceType:p()}),h({...St,toolCallType:C("UNKNOWN"),displayName:p()})]),pm=H([Ds,Cs]);var Ko=(r=>(r.IMAGE="image",r.TEXT="text",r))(Ko||{}),We=h({apiKey:p()}),dm=We,fm=h({apiKey:p(),apiKeyHash:p()}),mm=We,hm=We,gm=We,ym=We,vm=We,_m=We,Pm=We,js=h({accessKeyId:p().check(Ue(1)),secretAccessKey:p().check(Ue(1))}),xm=h({}),bm=h({}),Tm=h({}),Im=h({}),Em=h({}),Sm=h({}),Fs=h({modelId:p(),modelName:p(),modelType:J(Ko)}),Vs=h({apiKeyHeader:p(),baseUrl:p(),models:B(Fs),defaultHeaders:x(j(p(),p()))}),Bs=h({accountId:p(),gatewayId:p(),models:B(Fs),vertexProject:x(p()),vertexRegion:x(p())}),Hs=h({resourceName:p(),apiVersion:it(ot(e=>typeof e=="string"&&e.trim().length===0?void 0:e),x(p()))}),Zs=h({region:p().check(Ue(1))}),Am=H([dm,gm,ym,vm,_m,hm,mm,fm,js,Pm]),qs=H([Vs,Bs,Hs,Zs,xm,Tm,Im,Em,bm,Sm]),wm=h({id:p(),name:p(),type:J(Ko)}),$m=h({id:p(),name:p(),provider:J(dr),config:qs,enabledForChat:re()}),Om=h({provider:J(dr),config:qs,auth:Am,platformId:p()});var UO={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ns=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Rm=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],zm=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Us=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],km=["grok-4.20","grok-4.1-fast"],Dm={openai:Ns,anthropic:Rm,google:Us,activepieces:[...zm.map(e=>`anthropic/${e}`),...Ns.map(e=>`openai/${e}`),...Us.map(e=>`google/${e}`),...km.map(e=>`x-ai/${e}`)]};var Ms=128e3,Cm={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Nm({provider:e}){return e?Cm[e]??Ms:Ms}a(Nm,"getMaxContextTokens");var Ls={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Um={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Mm=new Set(["anthropic","mistral"]);function Fe(e){return{chatModels:Dm[e],maxContextTokens:Nm({provider:e}),defaultEmbeddingModel:Ls[e],supportsEmbedding:Ls[e]!==void 0,supportsImageGeneration:!Mm.has(e),webSearch:Um[e]}}a(Fe,"buildProviderCapabilities");var Lm={openai:Fe("openai"),anthropic:Fe("anthropic"),openrouter:Fe("openrouter"),azure:Fe("azure"),google:Fe("google"),"cloudflare-gateway":Fe("cloudflare-gateway"),custom:Fe("custom"),bedrock:Fe("bedrock"),mistral:Fe("mistral"),activepieces:Fe("activepieces")};var jm=h({base64Url:p(),fileName:p(),extension:x(p())}),Fm=h({mimeType:p(),url:p(),fileName:x(p())}),Jo=H([jm,Fm]);var Vm=H([h({type:C("file"),value:Jo}),h({type:C("markdown"),value:p(),files:x(B(Jo))})]),Bm=h({sessionId:p(),message:p(),files:x(B(p()))});var Ws=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ws||{}),Ks=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ks||{}),Xo=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Xo||{});var Hm=H([h({...De,name:p(),externalId:p(),type:C("STATIC_DROPDOWN"),tableId:p(),projectId:p(),data:h({options:B(h({value:p()}))})}),h({...De,name:p(),externalId:p(),type:H([C("TEXT"),C("NUMBER"),C("DATE")]),tableId:p(),projectId:p()})]),Zm=h({...De,name:p(),folderId:le(p()),projectId:p(),externalId:p(),status:Ho(Ks),trigger:Ho(Ws)}),qm=h({...De,tableId:p(),projectId:p(),cells:j(p(),h({updated:p(),created:p(),value:L(),fieldName:p()}))}),Gm=h({events:B(J(Xo)),webhookUrl:p(),flowId:p()}),Wm=h({fields:B(h({id:p(),name:p()})),rows:B(j(p(),p())),name:p()}),Km=h({projectId:p(),limit:x(tr.number()),cursor:x(p()),name:x(p()),externalIds:Yr(p()),folderId:x(p()),folderIds:Yr(p())}),Jm=h({records:B(B(h({fieldId:p(),value:Xs()}))),tableId:p()}),Xm=h({cells:x(B(h({fieldId:p(),value:Xs()}))),tableId:p(),agentUpdate:x(re())}),Js=nt("operator",[mt("eq"),mt("neq"),mt("gt"),mt("gte"),mt("lt"),mt("lte"),mt("co"),Gs("exists"),Gs("not_exists")]),Ym=h({tableId:p(),limit:x(tr.number()),cursor:x(p()),filters:Yr(Js)});function Xs(){return it(ot(e=>e==null?e:String(e)),er(p()))}a(Xs,"coerceToString");function mt(e){return h({fieldId:p(),operator:C(e),value:p()})}a(mt,"valueFilter");function Gs(e){return h({fieldId:p(),operator:C(e)})}a(Gs,"existenceFilter");var Qm=h({status:x(Se()),body:x(L()),headers:x(j(p(),p()))}),eh=h({...De,deleted:le(at),ownerId:p(),displayName:p(),platformId:p(),externalId:le(p())});var Ys=h({name:p(),description:x(p()),type:p(),required:re()}),th=h({pieceName:p(),triggerName:p(),input:h({toolName:p(),toolDescription:p(),inputSchema:B(Ys),returnsResponse:re()})});var Qs="^[0-9]+\\.[0-9]+\\.[0-9]+$",rR=new RegExp(Qs),nh="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",nR=p().check(rt(new RegExp(Qs))),oR=p().check(rt(new RegExp(nh))),oh=h({packageType:C("ARCHIVE"),pieceType:J(Tt),pieceName:p(),pieceVersion:p(),archiveId:p(),platformId:p()}),eu=h({packageType:C("REGISTRY"),pieceType:C("OFFICIAL"),pieceName:p(),pieceVersion:p()}),tu=h({packageType:C("REGISTRY"),pieceType:C("CUSTOM"),pieceName:p(),pieceVersion:p(),platformId:p()}),iR=H([eu,tu]),aR=H([oh,eu,tu]);var ih=nt("type",[h({type:C("CRON_EXPRESSION"),cronExpression:p(),timezone:p()}),h({type:C("INTERVAL"),intervalMs:ms().check(Br(6e4))})]),sR=h({...De,type:J(Ae),projectId:p(),flowId:p(),triggerName:p(),schedule:le(ih),flowVersionId:p(),pieceName:p(),pieceVersion:p(),deleted:le(p()),simulate:re()}),ru=(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))(ru||{}),nu=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(nu||{}),ou=(r=>(r.S3="S3",r.DB="DB",r))(ou||{}),uR=h({...De,projectId:le(p()),platformId:le(p()),type:J(ru),compression:J(nu),data:x(L()),location:J(ou),size:le(Se()),fileName:le(p()),s3Key:le(p()),metadata:le(j(p(),p()))}),iu=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(iu||{}),au=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(au||{}),cR=h({id:p(),email:p(),firstName:p(),status:J(au),externalId:le(p()),platformId:le(p()),platformRole:J(iu),lastName:p(),created:at,updated:at,lastActiveDate:le(at),imageUrl:le(p())});var Yo=h({...te.shape,...W(j(p(),L()),"OBJECT").shape});var lu=h({...te.shape,...W(p(),"COLOR").shape});var Qo=H([Re,He,Kr,qe,ze,Ze,jo,rr,Fo,Ge,ir,Yo,ar,or,nr,lu]),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 Ve=h({displayName:p(),description:x(p())});var pu=h({username:p(),password:p()}),ei=h({...Ve.shape,username:h({displayName:p(),description:x(p())}),password:h({displayName:p(),description:x(p())}),...W(pu,"BASIC_AUTH").shape});var ch=j(p(),H([Re,He,Ge,qe,ze])),ti=h({...Ve.shape,props:ch,...W(L(),"CUSTOM_AUTH").shape});var ht=h({...Ve.shape,...W(h({auth:p()}),"SECRET_TEXT").shape});var lh=j(p(),H([Re,He,ht,Ge,qe,ze,Ze,Kr])),du=h({...Ve.shape,props:lh,...W(L(),"OIDC").shape});var ri=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ri||{}),fu=H([Re,ht,ze]),mu=j(p(),fu),ph=h({props:x(j(p(),fu)),authUrl:p(),tokenUrl:p(),scope:B(p()),prompt:x(H([C("none"),C("consent"),C("login"),C("omit")])),pkce:x(re()),pkceMethod:x(H([C("plain"),C("S256")])),authorizationMethod:x(J(ri)),grantType:x(H([J(ur),C(Vo)])),extra:x(j(p(),p()))}),hu=h({access_token:p(),props:x(mu),data:j(p(),Qt())}),ni=h({...Ve.shape,...ph.shape,...W(hu,"OAUTH2").shape});var At=H([ei,ti,du,ni,ht]),fr="Connection",oi={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||fr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||fr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||fr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||fr}},None(){}};var Fz={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 dh=h({...te.shape,...W(L(),"CUSTOM").shape,code:p()});var fh=H([Qo,At]),ii=j(p(),fh),sk=j(p(),Qo);var gu=H([h({strategy:C("CRON"),cronExpression:p()}),h({strategy:C("NONE")})]),wt=class{constructor(t,r,n,o,i,s,u,c,d,f,v,y,l,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=l;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 wt(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 wt(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 wt(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 wt(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,Pe(e.sampleData)&&Pe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var yu="2",en="0.82.0";var ai=class{constructor(t,r,n,o,i,s,u,c,d=en,f,v="",y){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.deprecated=y;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:yu}),"getContextInfo");(!mh(d)||hh(d,en))&&(this.minimumSupportedRelease=en),i.forEach(l=>this._actions[l.name]=l),s.forEach(l=>this._triggers[l.name]=l)}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,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},vu=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 ai(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function mh(e){return/^\d+\.\d+\.\d+$/.test(e)}a(mh,"isValidSimpleSemver");function hh(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(hh,"isSemverLessThan");var gh=x(j(p(),j(p(),p()))),_u=h({id:x(p()),name:p(),displayName:p(),logoUrl:p(),description:p(),authors:B(p()),platformId:x(p()),directoryPath:x(p()),auth:x(H([At,B(At)])),version:p(),categories:x(B(J(It))),minimumSupportedRelease:x(p()),maximumSupportedRelease:x(p()),deprecated:x(re()),i18n:gh}),yh=J(["human","ai","both"]),Pu=h({description:x(p()),idempotent:x(re())}),xu=h({name:p(),displayName:p(),description:p(),props:ii,requireAuth:re(),errorHandlingOptions:x(Lo),outputSchema:x(Gr()),audience:x(yh),aiMetadata:x(Pu)}),bu=h({name:p(),displayName:p(),description:p(),props:ii,errorHandlingOptions:x(Lo),type:J(Ae),sampleData:L(),handshakeConfiguration:x(Gr()),renewConfiguration:x(gu),testStrategy:J(lr),outputSchema:x(Gr()),aiMetadata:x(Pu)}),vh=h({..._u.shape,actions:j(p(),xu),triggers:j(p(),bu)}),_h=h({..._u.shape,actions:Se(),triggers:Se(),suggestedActions:x(B(xu)),suggestedTriggers:x(B(bu))}),Tu=h({projectUsage:Se(),pieceType:J(Tt),packageType:J(sr),platformId:x(p()),archiveId:x(p())}),sD=h({...vh.shape,...Tu.shape}),uD=h({..._h.shape,...Tu.shape}),cD=h({name:p(),version:p()});var Ph=Y(require("path")),xh=Y(require("fs/promises"));var Au=require("node:stream");var tn=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"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var rn=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new si,r=new ui){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},si=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},ui=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 mr=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}}};function Iu({error:e,requestBody:t}){return e instanceof mr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(Iu,"toFailsafeOutput");var ci=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(ci||{});var nn=class extends tn{static{a(this,"FetchHttpClient")}constructor(t="",r=new rn){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:l,isStream:m}=bh(t.method)?Th(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},_=Eh({...i,...l}),g=await Ih(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 Eu(g,d),ge=new mr(t.body,{status:g.status,responseBody:Z});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ge),ge}let I=await Eu(g,d);return{status:g.status,headers:Sh(g.headers),body:I}}};function bh(e){return e!=="GET"&&e!=="HEAD"}a(bh,"acceptsRequestBody");function Th(e,t){if(wh(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Ah(e)){let n=new Au.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return 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(Th,"serializeBody");async function Eu(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}a(Eu,"parseResponseBody");async function Ih(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Su(n);continue}return o}catch(o){if(r=o,n<t){await Su(n);continue}throw o}throw r}a(Ih,"sendWithRetries");function Su(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(Su,"backoff");function Eh(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}a(Eh,"normalizeHeaders");function Sh(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(Sh,"toHttpHeaders");function Ah(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(Ah,"isNodeFormData");function wh(e){return e==null}a(wh,"isNil");var wu=new nn;var hy=Y(require("fs")),Dl=Y(kl());var gy={"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 yy(e){let t=e.split(";")[0].trim().toLowerCase();return gy[t]??""}a(yy,"contentTypeToExtension");var vy=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),_y=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 Cl({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 ${_y(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(ci).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:l,body:m,body_type:_,failsafe:g,timeout:P,response_is_binary:I,followRedirects:Z}=d.propsValue;Xr(f,"Method"),Xr(v,"URL");let ge=Pe(r)?{}:await r(d.auth,d.propsValue),Ee=v.url,Le=Ee.startsWith("http://")||Ee.startsWith("https://")?Ee:vy({baseUrl:t(d.auth),relativePath:Ee}),ne={method:f,url:Le,headers:{...y??{},...c==="headers"||!Pe(c)?ge:{}},queryParams:{...c==="queryParams"?ge:{},...l??{}},timeout:P?P*1e3:0,followRedirects:Z};if(I&&(ne.responseType="arraybuffer"),m)if(_&&_!=="none"){let K=m.data;if(_==="form_data"){let _t=K,lt=new Dl.default;for(let{fieldName:V,fieldType:w,textFieldValue:E,fileFieldValue:k}of _t)w==="text"&&!pr(E)?lt.append(V,E):w==="file"&&!pr(k)&&lt.append(V,k.data,{filename:k?.filename});ne.body=lt,ne.headers={...ne.headers,...lt.getHeaders()}}else ne.body=K}else _||(ne.body=m);try{let K=await wu.sendRequest(ne);return await Py(d.files,K.body,K.status,K.headers,I)}catch(K){if(g)return Iu({error:K,requestBody:ne.body});throw K}},"run")})}a(Cl,"createCustomApiCallAction");var Py=a(async(e,t,r,n,o)=>{let i;if(o&&xy(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=yy(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"),xy=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(Pe(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=[];Pe(u)||d==-1?f=c??[]:f=c?.slice(0,d)??[],Pe(o)||(f=f.slice(-o));let v=f?.[0]?.id;return Pe(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;Pe(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 by(s.map(u=>u.data))}};function by(e){return e.length<=5?e:e.slice(0,5)}a(by,"getFirstFiveOrAll");var vr="login.microsoftonline.com",Ul="login.microsoftonline.us",Nl={[vr]:"https://graph.microsoft.com",[Ul]:"https://graph.microsoft.us"},Ml=T.StaticDropdown({displayName:"Cloud Environment",description:"Select your Microsoft cloud environment.",required:!0,defaultValue:vr,options:{disabled:!1,options:[{label:"Commercial (Global)",value:vr},{label:"US Government (GCC High)",value:Ul}]}});function Ty(e){return e??vr}a(Ty,"resolveCloudHost");function S(e){let t=Ty(e);return Nl[t]??Nl[vr]}a(S,"getGraphBaseUrl");var Iy=`
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`,$=oi.OAuth2({description:Iy,props:{cloud:Ml},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 Xe=Y(se());var Qp=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=Xe.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=Xe.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:Qp({displayName:"Drive",refreshers:["siteId"]}),createDriveDropdown:Qp,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=Xe.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=Xe.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=Xe.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=Xe.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=Xe.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=Xe.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 ed=Y(se());var td=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=ed.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 rd=Y(se());var nd=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=rd.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 od=Y(se());var id=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=od.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 ad=Y(se());var sd=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 ad.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}).api(`/sites/${t}/lists/${r}/items/${n}`).delete()}});var ud=Y(se());var cd=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=ud.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 ld=Y(se());var pd=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=ld.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 dd=Y(se());var fd=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=dd.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 fo=Y(se());var md=2e3,H_=120;async function Z_(e){return new Promise(t=>setTimeout(t,e))}a(Z_,"delay");var hd=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=fo.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(fo.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 l=H_*1e3/md;for(;l>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 Z_(md),l--}throw new Error("Copy operation timed out after 120 seconds.")}});var Er=Y(se());var gd=2e3,q_=120;async function G_(e){return new Promise(t=>setTimeout(t,e))}a(G_,"delay");var yd=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=Er.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=Er.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(Er.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 l=q_*1e3/gd;for(;l>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 G_(gd),l--}throw new Error("Copy operation timed out after 120 seconds.")}});var ea=Y(se());var vd=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=ea.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=ea.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 ta=Y(se());var _d=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=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}/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=ta.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 Pd=Y(se());var xd=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=Pd.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 bd=Y(se());var Td=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=bd.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 mo=Y(se());var Id=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=mo.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=mo.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=mo.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 Ed=Y(se());var Sd=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=Ed.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 Sr=Y(se());var Ad="activepieces_sharepoint_trigger",wd=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=Sr.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=Sr.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:Ad});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=Sr.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===Ad);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Sr.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 Ar=Y(se());var $d="activepieces_sharepoint_subfolder_trigger",Od=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=Ar.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=Ar.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(l=>i.api("/subscriptions").post({changeType:"created",notificationUrl:e.webhookUrl,resource:`/sites/${t}/drive/items/${l.id}/children`,expirationDateTime:d.toISOString(),clientState:$d})),y=(await Promise.allSettled(f)).filter(l=>l.status==="fulfilled").map(l=>l.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=Ar.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===$d);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Ar.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 Rd=Y(se()),go=Y(Ht());var ho={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Rd.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,go.default)(f.createdDateTime);return(0,go.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,go.default)(f.createdDateTime).valueOf(),data:f}))},"items")},zd=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(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 kd=Y(se()),wr=Y(Ht());var vo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,listId:o}=t,i=e.props?.cloud,s=kd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=r===0?`$filter=createdDateTime gt ${(0,wr.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,wr.default)(f.createdDateTime);return(0,wr.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,wr.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Dd=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(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 oa=Y(se()),$r=Y(Ht());var _o={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=oa.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 l of v.value){if(!l.file)continue;let m=(0,$r.default)(l.lastModifiedDateTime).valueOf();if(s){d.push(l),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(l)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((l,m)=>{let _=(0,$r.default)(l.lastModifiedDateTime);return(0,$r.default)(m.lastModifiedDateTime).diff(_)}),d.map(l=>({epochMilliSeconds:(0,$r.default)(l.lastModifiedDateTime).valueOf(),data:l}))},"items")},Cd=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=oa.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(_o,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(_o,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(_o,e)},async run(e){return await ie.poll(_o,e)}});var ia=Y(se()),Or=Y(Ht());var Po={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=ia.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 l of v.value){if(!l.folder)continue;let m=(0,Or.default)(l.lastModifiedDateTime).valueOf();if(s){d.push(l),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(l)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((l,m)=>{let _=(0,Or.default)(l.lastModifiedDateTime);return(0,Or.default)(m.lastModifiedDateTime).diff(_)}),d.map(l=>({epochMilliSeconds:(0,Or.default)(l.lastModifiedDateTime).valueOf(),data:l}))},"items")},Nd=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=ia.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(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 Ud=Y(se()),Rr=Y(Ht());var xo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Ud.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,Rr.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,Rr.default)(f.lastModifiedDateTime);return(0,Rr.default)(v.lastModifiedDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,Rr.default)(f.lastModifiedDateTime).valueOf(),data:f}))},"items")},Md=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(xo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(xo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(xo,e)},async run(e){return await ie.poll(xo,e)}});var bo=Y(se());var Ld="activepieces_sharepoint_updated_list_item_trigger",jd=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=bo.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:Ld});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=bo.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===Ld);if(r.length===0)return[];let n=e.auth.props?.cloud,o=bo.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 W_=vu({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:[td,nd,id,pd,sd,cd,fd,Sd,hd,yd,Id,vd,_d,xd,Td,Cl({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:[wd,Od,Cd,Nd,Dd,jd,zd,Md]});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
+ */