@activepieces/piece-microsoft-sharepoint 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +5 -5
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var qd=Object.create;var Wt=Object.defineProperty;var Gd=Object.getOwnPropertyDescriptor;var Wd=Object.getOwnPropertyNames;var Kd=Object.getPrototypeOf,Jd=Object.prototype.hasOwnProperty;var a=(e,t)=>Wt(e,"name",{value:t,configurable:!0});var Xd=(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}},So=(e,t)=>{for(var r in t)Wt(e,r,{get:t[r],enumerable:!0})},ua=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wd(t))!Jd.call(e,o)&&o!==r&&Wt(e,o,{get:()=>t[o],enumerable:!(n=Gd(t,o))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?qd(Kd(e)):{},ua(t||!e||!e.__esModule?Wt(r,"default",{value:e,enumerable:!0}):r,e)),ce=e=>ua(Wt({},"__esModule",{value:!0}),e);var Rs=b((Os,tn)=>{(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,x=(l.match(u.zoneIndex)||[])[0],I,Z;for(x&&(x=x.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:x}}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 x=0,I;for(;g>0;){if(I=_-g,I<0&&(I=0),l[x]>>I!==m[x]>>I)return!1;g-=_,x+=1}return!0}a(d,"matchCIDR");function f(l){if(o.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}a(f,"parseIntAuto");function v(l,m){for(;l.length<m;)l=`0${l}`;return l}a(v,"padPart");let y={};y.IPv4=(function(){function l(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let _,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},x,I,Z;for(x=3;x>=0;x-=1)if(I=this.octets[x],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(),x=[],I=0;for(;I<4;)x.push(parseInt(_[I],10)|parseInt(g[I],10)^255),I++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(l){return this.parser(l)!==null},y.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(l){return!!(y.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(l){let m=l.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(l)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(l){let m,_,g,x,I;try{for(m=this.parseCIDR(l),g=m[0].toByteArray(),I=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<4;)x.push(parseInt(g[_],10)&parseInt(I[_],10)),_++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(l){let m=this.parser(l);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(l){let m;if(m=l.match(/^(.+)\/(\d+)$/)){let _=parseInt(m[2]);if(_>=0&&_<=32){let 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 x=m.slice(1,6),I=[];for(let Z=0;Z<x.length;Z++)_=x[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 x=[],I;for(I=0;I<=24;I+=8)x.push(g>>I&255);return x})().reverse()}else return(m=l.match(r.twoOctet))?(function(){let x=m.slice(1,4),I=[];if(g=f(x[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return I.push(f(x[0])),I.push(g>>16&255),I.push(g>>8&255),I.push(g&255),I})():(m=l.match(r.threeOctet))?(function(){let x=m.slice(1,5),I=[];if(g=f(x[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return I.push(f(x[0])),I.push(f(x[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,x;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(x=this.parts[g],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");_&&(this.zoneId=_)}return a(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(m,_){let 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},x,I;for(let Z=7;Z>=0;Z-=1)if(x=this.parts[Z],x in g){if(I=g[x],_&&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 x=0;x<g.length;x++)m=g[x],_.push(m>>8),_.push(m&255);return _},l.prototype.toFixedLengthString=function(){let m=(function(){let g=[];for(let x=0;x<this.parts.length;x++)g.push(v(this.parts[x].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 x=0;x<this.parts.length;x++)g.push(this.parts[x].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,x=-1,I;for(;I=m.exec(_);)I[0].length>x&&(g=I.index,x=I[0].length);return x<0?_:`${_.substring(0,g)}::${_.substring(g+x)}`},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(),x=[],I=0;for(;I<16;)x.push(parseInt(_[I],10)|parseInt(g[I],10)^255),I++;return new this(x)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},y.IPv6.isIPv6=function(l){return this.parser(l)!==null},y.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let m=this.parser(l);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(l){let m,_,g,x,I;try{for(m=this.parseCIDR(l),g=m[0].toByteArray(),I=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],_=0;_<16;)x.push(parseInt(g[_],10)&parseInt(I[_],10)),_++;return new this(x)}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,x,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(x=I[_],!(0<=x&&x<=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,x,I,Z;_==null&&(_="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(I=m[x],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 x}return _},typeof tn<"u"&&tn.exports?tn.exports=y:e.ipaddr=y})(Os)});var ku=b((jC,zu)=>{var Ru=require("stream").Stream,Dh=require("util");zu.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");Dh.inherits(Me,Ru);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=Ru.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 Uu=b((VC,Nu)=>{var Ch=require("util"),Cu=require("stream").Stream,Du=ku();Nu.exports=he;function he(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}a(he,"CombinedStream");Ch.inherits(he,Cu);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 Du)){var r=Du.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 Cu.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 Lu=b((HC,Mu)=>{"use strict";Mu.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 Vu=b($e=>{"use strict";var un=Lu(),Nh=require("path").extname,ju=/^\s*([^;\s]*)(?:;|\s|$)/,Uh=/^text\//i;$e.charset=Fu;$e.charsets={lookup:Fu};$e.contentType=Mh;$e.extension=Lh;$e.extensions=Object.create(null);$e.lookup=jh;$e.types=Object.create(null);Fh($e.extensions,$e.types);function Fu(e){if(!e||typeof e!="string")return!1;var t=ju.exec(e),r=t&&un[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Uh.test(t[1])?"UTF-8":!1}a(Fu,"charset");function Mh(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(Mh,"contentType");function Lh(e){if(!e||typeof e!="string")return!1;var t=ju.exec(e),r=t&&$e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Lh,"extension");function jh(e){if(!e||typeof e!="string")return!1;var t=Nh("x."+e).toLowerCase().substr(1);return t&&$e.types[t]||!1}a(jh,"lookup");function Fh(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(un).forEach(a(function(o){var i=un[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(un[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(Fh,"populateMaps")});var Hu=b((GC,Bu)=>{Bu.exports=Vh;function Vh(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(Vh,"defer")});var di=b((KC,qu)=>{var Zu=Hu();qu.exports=Bh;function Bh(e){var t=!1;return Zu(function(){t=!0}),a(function(n,o){t?e(n,o):Zu(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(Bh,"async")});var fi=b((XC,Gu)=>{Gu.exports=Hh;function Hh(e){Object.keys(e.jobs).forEach(Zh.bind(e)),e.jobs={}}a(Hh,"abort");function Zh(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(Zh,"clean")});var mi=b((QC,Ku)=>{var Wu=di(),qh=fi();Ku.exports=Gh;function Gh(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Wh(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?qh(r):r.results[o]=s,n(i,r.results))})}a(Gh,"iterate");function Wh(e,t,r,n){var o;return e.length==2?o=e(r,Wu(n)):o=e(r,t,Wu(n)),o}a(Wh,"runJob")});var hi=b((tN,Ju)=>{Ju.exports=Kh;function Kh(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(Kh,"state")});var gi=b((nN,Xu)=>{var Jh=fi(),Xh=di();Xu.exports=Yh;function Yh(e){Object.keys(this.jobs).length&&(this.index=this.size,Jh(this),Xh(e)(null,this.results))}a(Yh,"terminator")});var Qu=b((iN,Yu)=>{var Qh=mi(),eg=hi(),tg=gi();Yu.exports=rg;function rg(e,t,r){for(var n=eg(e);n.index<(n.keyedList||e).length;)Qh(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 tg.bind(n,r)}a(rg,"parallel")});var yi=b((sN,cn)=>{var ec=mi(),ng=hi(),og=gi();cn.exports=ig;cn.exports.ascending=tc;cn.exports.descending=ag;function ig(e,t,r,n){var o=ng(e,r);return ec(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){ec(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),og.bind(o,n)}a(ig,"serialOrdered");function tc(e,t){return e<t?-1:e>t?1:0}a(tc,"ascending");function ag(e,t){return-1*tc(e,t)}a(ag,"descending")});var nc=b((cN,rc)=>{var sg=yi();rc.exports=ug;function ug(e,t,r){return sg(e,t,null,r)}a(ug,"serial")});var ic=b((pN,oc)=>{oc.exports={parallel:Qu(),serial:nc(),serialOrdered:yi()}});var vi=b((dN,ac)=>{"use strict";ac.exports=Object});var uc=b((fN,sc)=>{"use strict";sc.exports=Error});var lc=b((mN,cc)=>{"use strict";cc.exports=EvalError});var dc=b((hN,pc)=>{"use strict";pc.exports=RangeError});var mc=b((gN,fc)=>{"use strict";fc.exports=ReferenceError});var gc=b((yN,hc)=>{"use strict";hc.exports=SyntaxError});var ln=b((vN,yc)=>{"use strict";yc.exports=TypeError});var _c=b((_N,vc)=>{"use strict";vc.exports=URIError});var xc=b((PN,Pc)=>{"use strict";Pc.exports=Math.abs});var Tc=b((xN,bc)=>{"use strict";bc.exports=Math.floor});var Ec=b((bN,Ic)=>{"use strict";Ic.exports=Math.max});var Ac=b((TN,Sc)=>{"use strict";Sc.exports=Math.min});var $c=b((IN,wc)=>{"use strict";wc.exports=Math.pow});var Rc=b((EN,Oc)=>{"use strict";Oc.exports=Math.round});var kc=b((SN,zc)=>{"use strict";zc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var Cc=b((wN,Dc)=>{"use strict";var cg=kc();Dc.exports=a(function(t){return cg(t)||t===0?t:t<0?-1:1},"sign")});var Uc=b((ON,Nc)=>{"use strict";Nc.exports=Object.getOwnPropertyDescriptor});var _i=b((RN,Mc)=>{"use strict";var pn=Uc();if(pn)try{pn([],"length")}catch{pn=null}Mc.exports=pn});var jc=b((zN,Lc)=>{"use strict";var dn=Object.defineProperty||!1;if(dn)try{dn({},"a",{value:1})}catch{dn=!1}Lc.exports=dn});var Pi=b((kN,Fc)=>{"use strict";Fc.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 Hc=b((CN,Bc)=>{"use strict";var Vc=typeof Symbol<"u"&&Symbol,lg=Pi();Bc.exports=a(function(){return typeof Vc!="function"||typeof Symbol!="function"||typeof Vc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:lg()},"hasNativeSymbols")});var xi=b((UN,Zc)=>{"use strict";Zc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var bi=b((MN,qc)=>{"use strict";var pg=vi();qc.exports=pg.getPrototypeOf||null});var Kc=b((LN,Wc)=>{"use strict";var dg="Function.prototype.bind called on incompatible ",fg=Object.prototype.toString,mg=Math.max,hg="[object Function]",Gc=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"),gg=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"),yg=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");Wc.exports=a(function(t){var r=this;if(typeof r!="function"||fg.apply(r)!==hg)throw new TypeError(dg+r);for(var n=gg(arguments,1),o,i=a(function(){if(this instanceof o){var f=r.apply(this,Gc(n,arguments));return Object(f)===f?f:this}return r.apply(t,Gc(n,arguments))},"binder"),s=mg(0,r.length-n.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(o=Function("binder","return function ("+yg(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 Ot=b((FN,Jc)=>{"use strict";var vg=Kc();Jc.exports=Function.prototype.bind||vg});var fn=b((VN,Xc)=>{"use strict";Xc.exports=Function.prototype.call});var Ti=b((BN,Yc)=>{"use strict";Yc.exports=Function.prototype.apply});var el=b((HN,Qc)=>{"use strict";Qc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var rl=b((ZN,tl)=>{"use strict";var _g=Ot(),Pg=Ti(),xg=fn(),bg=el();tl.exports=bg||_g.call(xg,Pg)});var ol=b((qN,nl)=>{"use strict";var Tg=Ot(),Ig=ln(),Eg=fn(),Sg=rl();nl.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new Ig("a function is required");return Sg(Tg,Eg,t)},"callBindBasic")});var ll=b((WN,cl)=>{"use strict";var Ag=ol(),il=_i(),sl;try{sl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ii=!!sl&&il&&il(Object.prototype,"__proto__"),ul=Object,al=ul.getPrototypeOf;cl.exports=Ii&&typeof Ii.get=="function"?Ag([Ii.get]):typeof al=="function"?a(function(t){return al(t==null?t:ul(t))},"getDunder"):!1});var hl=b((JN,ml)=>{"use strict";var pl=xi(),dl=bi(),fl=ll();ml.exports=pl?a(function(t){return pl(t)},"getProto"):dl?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return dl(t)},"getProto"):fl?a(function(t){return fl(t)},"getProto"):null});var Ei=b((YN,gl)=>{"use strict";var wg=Function.prototype.call,$g=Object.prototype.hasOwnProperty,Og=Ot();gl.exports=Og.call(wg,$g)});var Tl=b((QN,bl)=>{"use strict";var X,Rg=vi(),zg=uc(),kg=lc(),Dg=dc(),Cg=mc(),Dt=gc(),kt=ln(),Ng=_c(),Ug=xc(),Mg=Tc(),Lg=Ec(),jg=Ac(),Fg=$c(),Vg=Rc(),Bg=Cc(),Pl=Function,Si=a(function(e){try{return Pl('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),yr=_i(),Hg=jc(),Ai=a(function(){throw new kt},"throwTypeError"),Zg=yr?(function(){try{return arguments.callee,Ai}catch{try{return yr(arguments,"callee").get}catch{return Ai}}})():Ai,Rt=Hc()(),be=hl(),qg=bi(),Gg=xi(),xl=Ti(),vr=fn(),zt={},Wg=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%":Rt&&be?be([][Symbol.iterator]()):X,"%AsyncFromSyncIteratorPrototype%":X,"%AsyncFunction%":zt,"%AsyncGenerator%":zt,"%AsyncGeneratorFunction%":zt,"%AsyncIteratorPrototype%":zt,"%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%":zg,"%eval%":eval,"%EvalError%":kg,"%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%":Pl,"%GeneratorFunction%":zt,"%Int8Array%":typeof Int8Array>"u"?X:Int8Array,"%Int16Array%":typeof Int16Array>"u"?X:Int16Array,"%Int32Array%":typeof Int32Array>"u"?X:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Rt&&be?be(be([][Symbol.iterator]())):X,"%JSON%":typeof JSON=="object"?JSON:X,"%Map%":typeof Map>"u"?X:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Rt||!be?X:be(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Rg,"%Object.getOwnPropertyDescriptor%":yr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?X:Promise,"%Proxy%":typeof Proxy>"u"?X:Proxy,"%RangeError%":Dg,"%ReferenceError%":Cg,"%Reflect%":typeof Reflect>"u"?X:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?X:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Rt||!be?X:be(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?X:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Rt&&be?be(""[Symbol.iterator]()):X,"%Symbol%":Rt?Symbol:X,"%SyntaxError%":Dt,"%ThrowTypeError%":Zg,"%TypedArray%":Wg,"%TypeError%":kt,"%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%":Ng,"%WeakMap%":typeof WeakMap>"u"?X:WeakMap,"%WeakRef%":typeof WeakRef>"u"?X:WeakRef,"%WeakSet%":typeof WeakSet>"u"?X:WeakSet,"%Function.prototype.call%":vr,"%Function.prototype.apply%":xl,"%Object.defineProperty%":Hg,"%Object.getPrototypeOf%":qg,"%Math.abs%":Ug,"%Math.floor%":Mg,"%Math.max%":Lg,"%Math.min%":jg,"%Math.pow%":Fg,"%Math.round%":Vg,"%Math.sign%":Bg,"%Reflect.getPrototypeOf%":Gg};if(be)try{null.error}catch(e){yl=be(be(e)),gt["%Error.prototype%"]=yl}var yl,Kg=a(function e(t){var r;if(t==="%AsyncFunction%")r=Si("async function () {}");else if(t==="%GeneratorFunction%")r=Si("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Si("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"),vl={__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"]},_r=Ot(),mn=Ei(),Jg=_r.call(vr,Array.prototype.concat),Xg=_r.call(xl,Array.prototype.splice),_l=_r.call(vr,String.prototype.replace),hn=_r.call(vr,String.prototype.slice),Yg=_r.call(vr,RegExp.prototype.exec),Qg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ey=/\\(\\)?/g,ty=a(function(t){var r=hn(t,0,1),n=hn(t,-1);if(r==="%"&&n!=="%")throw new Dt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Dt("invalid intrinsic syntax, expected opening `%`");var o=[];return _l(t,Qg,function(i,s,u,c){o[o.length]=u?_l(c,ey,"$1"):s||i}),o},"stringToPath"),ry=a(function(t,r){var n=t,o;if(mn(vl,n)&&(o=vl[n],n="%"+o[0]+"%"),mn(gt,n)){var i=gt[n];if(i===zt&&(i=Kg(n)),typeof i>"u"&&!r)throw new kt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new Dt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");bl.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new kt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new kt('"allowMissing" argument must be a boolean');if(Yg(/^%?[^%]*%?$/,t)===null)throw new Dt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ty(t),o=n.length>0?n[0]:"",i=ry("%"+o+"%",r),s=i.name,u=i.value,c=!1,d=i.alias;d&&(o=d[0],Xg(n,Jg([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],l=hn(y,0,1),m=hn(y,-1);if((l==='"'||l==="'"||l==="`"||m==='"'||m==="'"||m==="`")&&l!==m)throw new Dt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(c=!0),o+="."+y,s="%"+o+"%",mn(gt,s))u=gt[s];else if(u!=null){if(!(y in u)){if(!r)throw new kt("base intrinsic for "+t+" exists, but the property is not available.");return}if(yr&&f+1>=n.length){var _=yr(u,y);v=!!_,v&&"get"in _&&!("originalValue"in _.get)?u=_.get:u=u[y]}else v=mn(u,y),u=u[y];v&&!c&&(gt[s]=u)}}return u},"GetIntrinsic")});var El=b((t0,Il)=>{"use strict";var ny=Pi();Il.exports=a(function(){return ny()&&!!Symbol.toStringTag},"hasToStringTagShams")});var wl=b((n0,Al)=>{"use strict";var oy=Tl(),Sl=oy("%Object.defineProperty%",!0),iy=El()(),ay=Ei(),sy=ln(),gn=iy?Symbol.toStringTag:null;Al.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 sy("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");gn&&(n||!ay(t,gn))&&(Sl?Sl(t,gn,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[gn]=r)},"setToStringTag")});var Ol=b((i0,$l)=>{"use strict";var uy=Function.prototype.call,cy=Object.prototype.hasOwnProperty,ly=Ot();$l.exports=ly.call(uy,cy)});var zl=b((a0,Rl)=>{"use strict";Rl.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Cl=b((s0,Dl)=>{"use strict";var Ri=Uu(),py=require("util"),wi=require("path"),dy=require("http"),fy=require("https"),my=require("url").parse,hy=require("fs"),gy=require("stream").Stream,yy=require("crypto"),$i=Vu(),vy=ic(),_y=wl(),ut=Ol(),Oi=zl();function kl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(kl,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Ri.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(Q,"FormData");py.inherits(Q,Ri);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=Ri.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&&ut(t,"httpVersion"))&&!(t instanceof gy))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){ut(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):hy.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ut(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ut(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="'+kl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Oi(s,r.header);var u;for(var c in s)if(ut(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=wi.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=wi.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ut(e,"httpVersion")&&(r=wi.basename(e.client._httpMessage.path||"")),r)return'filename="'+kl(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=$i.lookup(e.name)),!r&&e&&e.path&&(r=$i.lookup(e.path)),!r&&e&&e.readable&&ut(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=$i.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)ut(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="--------------------------"+yy.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}vy.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=my(e),n=Oi({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Oi(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=fy.request(n):r=dy.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]"};_y(Q.prototype,"FormData");Dl.exports=Q});var pe={};So(pe,{__addDisposableResource:()=>dp,__assign:()=>yn,__asyncDelegator:()=>op,__asyncGenerator:()=>np,__asyncValues:()=>ip,__await:()=>Ct,__awaiter:()=>Xl,__classPrivateFieldGet:()=>cp,__classPrivateFieldIn:()=>pp,__classPrivateFieldSet:()=>lp,__createBinding:()=>_n,__decorate:()=>Hl,__disposeResources:()=>fp,__esDecorate:()=>ql,__exportStar:()=>Ql,__extends:()=>Vl,__generator:()=>Yl,__importDefault:()=>up,__importStar:()=>sp,__makeTemplateObject:()=>ap,__metadata:()=>Jl,__param:()=>Zl,__propKey:()=>Wl,__read:()=>Di,__rest:()=>Bl,__rewriteRelativeImportExtension:()=>mp,__runInitializers:()=>Gl,__setFunctionName:()=>Kl,__spread:()=>ep,__spreadArray:()=>rp,__spreadArrays:()=>tp,__values:()=>vn,default:()=>ky});function Vl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");zi(e,t);function r(){this.constructor=e}a(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Bl(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Hl(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function Zl(e,t){return function(r,n){t(r,n,e)}}function ql(e,t,r,n,o,i){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}a(s,"accept");for(var u=n.kind,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(x){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(x||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 Gl(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 Wl(e){return typeof e=="symbol"?e:"".concat(e)}function Kl(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 Jl(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Xl(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 Yl(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 Ql(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&_n(t,e,r)}function vn(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 Di(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 ep(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Di(arguments[t]));return e}function tp(){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 rp(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 Ct(e){return this instanceof Ct?(this.v=e,this):new Ct(e)}function np(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,x){i.push([l,_,g,x])>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 Ct?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 op(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:Ct(e[o](s)),done:!1}:i?i(s):s}:i}}function ip(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 vn=="function"?vn(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 ap(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function sp(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=ki(e),n=0;n<r.length;n++)r[n]!=="default"&&_n(t,e,r[n]);return Ry(t,e),t}function up(e){return e&&e.__esModule?e:{default:e}}function cp(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 lp(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 pp(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 dp(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 fp(e){function t(i){e.error=e.hasError?new zy(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 mp(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 zi,yn,_n,Ry,ki,zy,ky,de=Xd(()=>{zi=a(function(e,t){return zi=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])},zi(e,t)},"extendStatics");a(Vl,"__extends");yn=a(function(){return yn=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"),yn.apply(this,arguments)},"__assign");a(Bl,"__rest");a(Hl,"__decorate");a(Zl,"__param");a(ql,"__esDecorate");a(Gl,"__runInitializers");a(Wl,"__propKey");a(Kl,"__setFunctionName");a(Jl,"__metadata");a(Xl,"__awaiter");a(Yl,"__generator");_n=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(Ql,"__exportStar");a(vn,"__values");a(Di,"__read");a(ep,"__spread");a(tp,"__spreadArrays");a(rp,"__spreadArray");a(Ct,"__await");a(np,"__asyncGenerator");a(op,"__asyncDelegator");a(ip,"__asyncValues");a(ap,"__makeTemplateObject");Ry=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},ki=a(function(e){return ki=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},ki(e)},"ownKeys");a(sp,"__importStar");a(up,"__importDefault");a(cp,"__classPrivateFieldGet");a(lp,"__classPrivateFieldSet");a(pp,"__classPrivateFieldIn");a(dp,"__addDisposableResource");zy=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(fp,"__disposeResources");a(mp,"__rewriteRelativeImportExtension");ky={__extends:Vl,__assign:yn,__rest:Bl,__decorate:Hl,__param:Zl,__esDecorate:ql,__runInitializers:Gl,__propKey:Wl,__setFunctionName:Kl,__metadata:Jl,__awaiter:Xl,__generator:Yl,__createBinding:_n,__exportStar:Ql,__values:vn,__read:Di,__spread:ep,__spreadArrays:tp,__spreadArray:rp,__await:Ct,__asyncGenerator:np,__asyncDelegator:op,__asyncValues:ip,__makeTemplateObject:ap,__importStar:sp,__importDefault:up,__classPrivateFieldGet:cp,__classPrivateFieldSet:lp,__classPrivateFieldIn:pp,__addDisposableResource:dp,__disposeResources:fp,__rewriteRelativeImportExtension:mp}});var xr=b(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.RequestMethod=void 0;var hp;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(hp||(Pn.RequestMethod=hp={}))});var gp=b(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.BatchRequestContent=void 0;var Nt=(de(),ce(pe)),Ci=xr(),Dy=(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 Nt.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Nt.__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===Ci.RequestMethod.PATCH||t.method===Ci.RequestMethod.POST||t.method===Ci.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 Nt.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c,d;return Nt.__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 Nt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Nt.__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:
|
|
1
|
+
"use strict";var ef=Object.create;var Wt=Object.defineProperty;var tf=Object.getOwnPropertyDescriptor;var rf=Object.getOwnPropertyNames;var nf=Object.getPrototypeOf,of=Object.prototype.hasOwnProperty;var a=(e,t)=>Wt(e,"name",{value:t,configurable:!0});var af=(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}},So=(e,t)=>{for(var r in t)Wt(e,r,{get:t[r],enumerable:!0})},pa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rf(t))!of.call(e,o)&&o!==r&&Wt(e,o,{get:()=>t[o],enumerable:!(n=tf(t,o))||n.enumerable});return e};var Q=(e,t,r)=>(r=e!=null?ef(nf(e)):{},pa(t||!e||!e.__esModule?Wt(r,"default",{value:e,enumerable:!0}):r,e)),ce=e=>pa(Wt({},"__esModule",{value:!0}),e);var Ns=b((Cs,tn)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function c(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let P=0,h=-1,x=(p.match(u.zoneIndex)||[])[0],E,q;for(x&&(x=x.substring(1),p=p.replace(/%.+$/,""));(h=p.indexOf(":",h+1))>=0;)P++;if(p.substr(0,2)==="::"&&P--,p.substr(-2,2)==="::"&&P--,P>m)return null;for(q=m-P,E=":";q--;)E+="0:";return p=p.replace("::",E),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=(function(){let he=p.split(":"),we=[];for(let De=0;De<he.length;De++)we.push(parseInt(he[De],16));return we})(),{parts:m,zoneId:x}}a(c,"expandIPv6");function d(p,m,P,h){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,E;for(;h>0;){if(E=P-h,E<0&&(E=0),p[x]>>E!==m[x]>>E)return!1;h-=P,x+=1}return!0}a(d,"matchCIDR");function f(p){if(o.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}a(f,"parseIntAuto");function v(p,m){for(;p.length<m;)p=`0${p}`;return p}a(v,"padPart");let y={};y.IPv4=(function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let P,h;for(P=0;P<m.length;P++)if(h=m[P],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return a(p,"IPv4"),p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]],as112:[[new p([192,175,48,0]),24],[new p([192,31,196,0]),24]],amt:[[new p([192,52,193,0]),24]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,P){let h;if(P===void 0&&(h=m,m=h[0],P=h[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,m.octets,8,P)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,P=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,E,q;for(x=3;x>=0;x-=1)if(E=this.octets[x],E in h){if(q=h[E],P&&q!==0)return null;q!==8&&(P=!0),m+=q}else return null;return 32-m},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p})(),y.IPv4.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),P=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],E=0;for(;E<4;)x.push(parseInt(P[E],10)|parseInt(h[E],10)^255),E++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(p){return this.parser(p)!==null},y.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(p){try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(p){return!!(y.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(p){let m=p.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(p)||!m?!1:y.IPv4.isValidFourPartDecimal(m[1])},y.IPv4.networkAddressFromCIDR=function(p){let m,P,h,x,E;try{for(m=this.parseCIDR(p),h=m[0].toByteArray(),E=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],P=0;P<4;)x.push(parseInt(h[P],10)&parseInt(E[P],10)),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(p){let m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},y.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){let P=parseInt(m[2]);if(P>=0&&P<=32){let h=[this.parse(m[1]),P];return Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(p){let m,P,h;if(m=p.match(r.fourOctet))return(function(){let x=m.slice(1,6),E=[];for(let q=0;q<x.length;q++)P=x[q],E.push(f(P));return E})();if(m=p.match(r.longValue)){if(h=f(m[1]),h>4294967295||h<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],E;for(E=0;E<=24;E+=8)x.push(h>>E&255);return x})().reverse()}else return(m=p.match(r.twoOctet))?(function(){let x=m.slice(1,4),E=[];if(h=f(x[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return E.push(f(x[0])),E.push(h>>16&255),E.push(h>>8&255),E.push(h&255),E})():(m=p.match(r.threeOctet))?(function(){let x=m.slice(1,5),E=[];if(h=f(x[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return E.push(f(x[0])),E.push(f(x[1])),E.push(h>>8&255),E.push(h&255),E})():null},y.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],P=0,h=Math.floor(p/8);for(;P<h;)m[P]=255,P++;return h<4&&(m[h]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},y.IPv6=(function(){function p(m,P){let h,x;if(m.length===16)for(this.parts=[],h=0;h<=14;h+=2)this.parts.push(m[h]<<8|m[h+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(h=0;h<this.parts.length;h++)if(x=this.parts[h],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");P&&(this.zoneId=P)}return a(p,"IPv6"),p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],discard:[new p([256,0,0,0,0,0,0,0]),64],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[[new p([8193,4,274,0,0,0,0,0]),48],[new p([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new p([8193,48,0,0,0,0,0,0]),28],reserved:[[new p([8193,0,0,0,0,0,0,0]),23],[new p([8193,3512,0,0,0,0,0,0]),32]]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,P){let h;if(P===void 0&&(h=m,m=h[0],P=h[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,m.parts,16,P)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,P=!1,h={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,E;for(let q=7;q>=0;q-=1)if(x=this.parts[q],x in h){if(E=h[x],P&&E!==0)return null;E!==16&&(P=!0),m+=E}else return null;return 128-m},p.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m,P=[],h=this.parts;for(let x=0;x<h.length;x++)m=h[x],P.push(m>>8),P.push(m&255);return P},p.prototype.toFixedLengthString=function(){let m=(function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(v(this.parts[x].toString(16),4));return h}).call(this).join(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),m+P},p.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),P=m[0],h=m[1];return new y.IPv4([P>>8,P&255,h>>8,h&255])},p.prototype.toNormalizedString=function(){let m=(function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(this.parts[x].toString(16));return h}).call(this).join(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),m+P},p.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,P=this.toNormalizedString(),h=0,x=-1,E;for(;E=m.exec(P);)E[0].length>x&&(h=E.index,x=E[0].length);return x<0?P:`${P.substring(0,h)}::${P.substring(h+x)}`},p.prototype.toString=function(){return this.toRFC5952String()},p})(),y.IPv6.broadcastAddressFromCIDR=function(p){try{let m=this.parseCIDR(p),P=m[0].toByteArray(),h=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],E=0;for(;E<16;)x.push(parseInt(P[E],10)|parseInt(h[E],10)^255),E++;return new this(x)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},y.IPv6.isIPv6=function(p){return this.parser(p)!==null},y.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{let m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{return this.parseCIDR(p),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(p){let m,P,h,x,E;try{for(m=this.parseCIDR(p),h=m[0].toByteArray(),E=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),x=[],P=0;P<16;)x.push(parseInt(h[P],10)&parseInt(E[P],10)),P++;return new this(x)}catch(q){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${q})`)}},y.IPv6.parse=function(p){let m=this.parser(p);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},y.IPv6.parseCIDR=function(p){let m,P,h;if((P=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(P[2]),m>=0&&m<=128))return h=[this.parse(P[1]),m],Object.defineProperty(h,"toString",{value:a(function(){return this.join("/")},"value")}),h;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(p){let m,P,h,x,E,q;if(h=p.match(u.deprecatedTransitional))return this.parser(`::ffff:${h[1]}`);if(u.native.test(p))return c(p,8);if((h=p.match(u.transitional))&&(q=h[6]||"",m=h[1],h[1].endsWith("::")||(m=m.slice(0,-1)),m=c(m+q,6),m.parts)){for(E=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],P=0;P<E.length;P++)if(x=E[P],!(0<=x&&x<=255))return null;return m.parts.push(E[0]<<8|E[1]),m.parts.push(E[2]<<8|E[3]),{parts:m.parts,zoneId:m.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P=0,h=Math.floor(p/8);for(;P<h;)m[P]=255,P++;return h<16&&(m[h]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},y.fromByteArray=function(p){let m=p.length;if(m===4)return new y.IPv4(p);if(m===16)return new y.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(p){return y.IPv6.isValid(p)||y.IPv4.isValid(p)},y.isValidCIDR=function(p){return y.IPv6.isValidCIDR(p)||y.IPv4.isValidCIDR(p)},y.parse=function(p){if(y.IPv6.isValid(p))return y.IPv6.parse(p);if(y.IPv4.isValid(p))return y.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(p){try{return y.IPv6.parseCIDR(p)}catch{try{return y.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(p){let m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},y.subnetMatch=function(p,m,P){let h,x,E,q;P==null&&(P="unicast");for(x in m)if(Object.prototype.hasOwnProperty.call(m,x)){for(E=m[x],E[0]&&!(E[0]instanceof Array)&&(E=[E]),h=0;h<E.length;h++)if(q=E[h],p.kind()===q[0].kind()&&p.match.apply(p,q))return x}return P},typeof tn<"u"&&tn.exports?tn.exports=y:e.ipaddr=y})(Cs)});var Fu=b((dN,ju)=>{var Lu=require("stream").Stream,qh=require("util");ju.exports=Fe;function Fe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(Fe,"DelayedStream");qh.inherits(Fe,Lu);Fe.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(Fe.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});Fe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Fe.prototype.resume=function(){this._released||this.release(),this.source.resume()};Fe.prototype.pause=function(){this.source.pause()};Fe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};Fe.prototype.pipe=function(){var e=Lu.prototype.pipe.apply(this,arguments);return this.resume(),e};Fe.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)};Fe.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 Zu=b((mN,Hu)=>{var Gh=require("util"),Bu=require("stream").Stream,Vu=Fu();Hu.exports=me;function me(){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(me,"CombinedStream");Gh.inherits(me,Bu);me.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};me.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};me.prototype.append=function(e){var t=me.isStreamLike(e);if(t){if(!(e instanceof Vu)){var r=Vu.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};me.prototype.pipe=function(e,t){return Bu.prototype.pipe.call(this,e,t),this.resume(),e};me.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}};me.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=me.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};me.prototype._pipeNext=function(e){this._currentStream=e;var t=me.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()};me.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};me.prototype.write=function(e){this.emit("data",e)};me.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};me.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")};me.prototype.end=function(){this._reset(),this.emit("end")};me.prototype.destroy=function(){this._reset(),this.emit("close")};me.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};me.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};me.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)};me.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Gu=b((gN,qu)=>{"use strict";qu.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 Xu=b(Re=>{"use strict";var un=Gu(),Wh=require("path").extname,Wu=/^\s*([^;\s]*)(?:;|\s|$)/,Kh=/^text\//i;Re.charset=Ku;Re.charsets={lookup:Ku};Re.contentType=Xh;Re.extension=Jh;Re.extensions=Object.create(null);Re.lookup=Yh;Re.types=Object.create(null);Qh(Re.extensions,Re.types);function Ku(e){if(!e||typeof e!="string")return!1;var t=Wu.exec(e),r=t&&un[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Kh.test(t[1])?"UTF-8":!1}a(Ku,"charset");function Xh(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}a(Xh,"contentType");function Jh(e){if(!e||typeof e!="string")return!1;var t=Wu.exec(e),r=t&&Re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}a(Jh,"extension");function Yh(e){if(!e||typeof e!="string")return!1;var t=Wh("x."+e).toLowerCase().substr(1);return t&&Re.types[t]||!1}a(Yh,"lookup");function Qh(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(un).forEach(a(function(o){var i=un[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(un[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(Qh,"populateMaps")});var Yu=b((PN,Ju)=>{Ju.exports=eg;function eg(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(eg,"defer")});var mi=b((xN,ec)=>{var Qu=Yu();ec.exports=tg;function tg(e){var t=!1;return Qu(function(){t=!0}),a(function(n,o){t?e(n,o):Qu(a(function(){e(n,o)},"nextTick_callback"))},"async_callback")}a(tg,"async")});var hi=b((TN,tc)=>{tc.exports=rg;function rg(e){Object.keys(e.jobs).forEach(ng.bind(e)),e.jobs={}}a(rg,"abort");function ng(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(ng,"clean")});var gi=b((IN,nc)=>{var rc=mi(),og=hi();nc.exports=ig;function ig(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=ag(t,o,e[o],function(i,s){o in r.jobs&&(delete r.jobs[o],i?og(r):r.results[o]=s,n(i,r.results))})}a(ig,"iterate");function ag(e,t,r,n){var o;return e.length==2?o=e(r,rc(n)):o=e(r,t,rc(n)),o}a(ag,"runJob")});var yi=b((AN,oc)=>{oc.exports=sg;function sg(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(sg,"state")});var vi=b(($N,ic)=>{var ug=hi(),cg=mi();ic.exports=lg;function lg(e){Object.keys(this.jobs).length&&(this.index=this.size,ug(this),cg(e)(null,this.results))}a(lg,"terminator")});var sc=b((RN,ac)=>{var pg=gi(),dg=yi(),fg=vi();ac.exports=mg;function mg(e,t,r){for(var n=dg(e);n.index<(n.keyedList||e).length;)pg(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 fg.bind(n,r)}a(mg,"parallel")});var Pi=b((DN,cn)=>{var uc=gi(),hg=yi(),gg=vi();cn.exports=yg;cn.exports.ascending=cc;cn.exports.descending=vg;function yg(e,t,r,n){var o=hg(e,r);return uc(e,t,o,a(function i(s,u){if(s){n(s,u);return}if(o.index++,o.index<(o.keyedList||e).length){uc(e,t,o,i);return}n(null,o.results)},"iteratorHandler")),gg.bind(o,n)}a(yg,"serialOrdered");function cc(e,t){return e<t?-1:e>t?1:0}a(cc,"ascending");function vg(e,t){return-1*cc(e,t)}a(vg,"descending")});var pc=b((CN,lc)=>{var Pg=Pi();lc.exports=_g;function _g(e,t,r){return Pg(e,t,null,r)}a(_g,"serial")});var fc=b((UN,dc)=>{dc.exports={parallel:sc(),serial:pc(),serialOrdered:Pi()}});var _i=b((MN,mc)=>{"use strict";mc.exports=Object});var gc=b((LN,hc)=>{"use strict";hc.exports=Error});var vc=b((jN,yc)=>{"use strict";yc.exports=EvalError});var _c=b((FN,Pc)=>{"use strict";Pc.exports=RangeError});var bc=b((VN,xc)=>{"use strict";xc.exports=ReferenceError});var Ec=b((BN,Tc)=>{"use strict";Tc.exports=SyntaxError});var ln=b((HN,Ic)=>{"use strict";Ic.exports=TypeError});var Ac=b((ZN,Sc)=>{"use strict";Sc.exports=URIError});var $c=b((qN,wc)=>{"use strict";wc.exports=Math.abs});var Rc=b((GN,Oc)=>{"use strict";Oc.exports=Math.floor});var Dc=b((WN,zc)=>{"use strict";zc.exports=Math.max});var Cc=b((KN,kc)=>{"use strict";kc.exports=Math.min});var Uc=b((XN,Nc)=>{"use strict";Nc.exports=Math.pow});var Lc=b((JN,Mc)=>{"use strict";Mc.exports=Math.round});var Fc=b((YN,jc)=>{"use strict";jc.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var Bc=b((e0,Vc)=>{"use strict";var xg=Fc();Vc.exports=a(function(t){return xg(t)||t===0?t:t<0?-1:1},"sign")});var Zc=b((r0,Hc)=>{"use strict";Hc.exports=Object.getOwnPropertyDescriptor});var xi=b((n0,qc)=>{"use strict";var pn=Zc();if(pn)try{pn([],"length")}catch{pn=null}qc.exports=pn});var Wc=b((o0,Gc)=>{"use strict";var dn=Object.defineProperty||!1;if(dn)try{dn({},"a",{value:1})}catch{dn=!1}Gc.exports=dn});var bi=b((i0,Kc)=>{"use strict";Kc.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 Yc=b((s0,Jc)=>{"use strict";var Xc=typeof Symbol<"u"&&Symbol,bg=bi();Jc.exports=a(function(){return typeof Xc!="function"||typeof Symbol!="function"||typeof Xc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bg()},"hasNativeSymbols")});var Ti=b((c0,Qc)=>{"use strict";Qc.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ei=b((l0,el)=>{"use strict";var Tg=_i();el.exports=Tg.getPrototypeOf||null});var nl=b((p0,rl)=>{"use strict";var Eg="Function.prototype.bind called on incompatible ",Ig=Object.prototype.toString,Sg=Math.max,Ag="[object Function]",tl=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"),wg=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"),$g=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");rl.exports=a(function(t){var r=this;if(typeof r!="function"||Ig.apply(r)!==Ag)throw new TypeError(Eg+r);for(var n=wg(arguments,1),o,i=a(function(){if(this instanceof o){var f=r.apply(this,tl(n,arguments));return Object(f)===f?f:this}return r.apply(t,tl(n,arguments))},"binder"),s=Sg(0,r.length-n.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(o=Function("binder","return function ("+$g(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 Ot=b((f0,ol)=>{"use strict";var Og=nl();ol.exports=Function.prototype.bind||Og});var fn=b((m0,il)=>{"use strict";il.exports=Function.prototype.call});var Ii=b((h0,al)=>{"use strict";al.exports=Function.prototype.apply});var ul=b((g0,sl)=>{"use strict";sl.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ll=b((y0,cl)=>{"use strict";var Rg=Ot(),zg=Ii(),Dg=fn(),kg=ul();cl.exports=kg||Rg.call(Dg,zg)});var dl=b((v0,pl)=>{"use strict";var Cg=Ot(),Ng=ln(),Ug=fn(),Mg=ll();pl.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new Ng("a function is required");return Mg(Cg,Ug,t)},"callBindBasic")});var vl=b((_0,yl)=>{"use strict";var Lg=dl(),fl=xi(),hl;try{hl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Si=!!hl&&fl&&fl(Object.prototype,"__proto__"),gl=Object,ml=gl.getPrototypeOf;yl.exports=Si&&typeof Si.get=="function"?Lg([Si.get]):typeof ml=="function"?a(function(t){return ml(t==null?t:gl(t))},"getDunder"):!1});var Tl=b((b0,bl)=>{"use strict";var Pl=Ti(),_l=Ei(),xl=vl();bl.exports=Pl?a(function(t){return Pl(t)},"getProto"):_l?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return _l(t)},"getProto"):xl?a(function(t){return xl(t)},"getProto"):null});var Ai=b((E0,El)=>{"use strict";var jg=Function.prototype.call,Fg=Object.prototype.hasOwnProperty,Vg=Ot();El.exports=Vg.call(jg,Fg)});var Rl=b((I0,Ol)=>{"use strict";var J,Bg=_i(),Hg=gc(),Zg=vc(),qg=_c(),Gg=bc(),kt=Ec(),Dt=ln(),Wg=Ac(),Kg=$c(),Xg=Rc(),Jg=Dc(),Yg=Cc(),Qg=Uc(),ey=Lc(),ty=Bc(),wl=Function,wi=a(function(e){try{return wl('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),gr=xi(),ry=Wc(),$i=a(function(){throw new Dt},"throwTypeError"),ny=gr?(function(){try{return arguments.callee,$i}catch{try{return gr(arguments,"callee").get}catch{return $i}}})():$i,Rt=Yc()(),Te=Tl(),oy=Ei(),iy=Ti(),$l=Ii(),yr=fn(),zt={},ay=typeof Uint8Array>"u"||!Te?J:Te(Uint8Array),gt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":Rt&&Te?Te([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":zt,"%AsyncGenerator%":zt,"%AsyncGeneratorFunction%":zt,"%AsyncIteratorPrototype%":zt,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Hg,"%eval%":eval,"%EvalError%":Zg,"%Float16Array%":typeof Float16Array>"u"?J:Float16Array,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":wl,"%GeneratorFunction%":zt,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Rt&&Te?Te(Te([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Rt||!Te?J:Te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Bg,"%Object.getOwnPropertyDescriptor%":gr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":qg,"%ReferenceError%":Gg,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Rt||!Te?J:Te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Rt&&Te?Te(""[Symbol.iterator]()):J,"%Symbol%":Rt?Symbol:J,"%SyntaxError%":kt,"%ThrowTypeError%":ny,"%TypedArray%":ay,"%TypeError%":Dt,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":Wg,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet,"%Function.prototype.call%":yr,"%Function.prototype.apply%":$l,"%Object.defineProperty%":ry,"%Object.getPrototypeOf%":oy,"%Math.abs%":Kg,"%Math.floor%":Xg,"%Math.max%":Jg,"%Math.min%":Yg,"%Math.pow%":Qg,"%Math.round%":ey,"%Math.sign%":ty,"%Reflect.getPrototypeOf%":iy};if(Te)try{null.error}catch(e){Il=Te(Te(e)),gt["%Error.prototype%"]=Il}var Il,sy=a(function e(t){var r;if(t==="%AsyncFunction%")r=wi("async function () {}");else if(t==="%GeneratorFunction%")r=wi("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=wi("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Te&&(r=Te(o.prototype))}return gt[t]=r,r},"doEval"),Sl={__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"]},vr=Ot(),mn=Ai(),uy=vr.call(yr,Array.prototype.concat),cy=vr.call($l,Array.prototype.splice),Al=vr.call(yr,String.prototype.replace),hn=vr.call(yr,String.prototype.slice),ly=vr.call(yr,RegExp.prototype.exec),py=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dy=/\\(\\)?/g,fy=a(function(t){var r=hn(t,0,1),n=hn(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 Al(t,py,function(i,s,u,c){o[o.length]=u?Al(c,dy,"$1"):s||i}),o},"stringToPath"),my=a(function(t,r){var n=t,o;if(mn(Sl,n)&&(o=Sl[n],n="%"+o[0]+"%"),mn(gt,n)){var i=gt[n];if(i===zt&&(i=sy(n)),typeof i>"u"&&!r)throw new Dt("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");Ol.exports=a(function(t,r){if(typeof t!="string"||t.length===0)throw new Dt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Dt('"allowMissing" argument must be a boolean');if(ly(/^%?[^%]*%?$/,t)===null)throw new kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fy(t),o=n.length>0?n[0]:"",i=my("%"+o+"%",r),s=i.name,u=i.value,c=!1,d=i.alias;d&&(o=d[0],cy(n,uy([0,1],d)));for(var f=1,v=!0;f<n.length;f+=1){var y=n[f],p=hn(y,0,1),m=hn(y,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new kt("property names with quotes must have matching quotes");if((y==="constructor"||!v)&&(c=!0),o+="."+y,s="%"+o+"%",mn(gt,s))u=gt[s];else if(u!=null){if(!(y in u)){if(!r)throw new Dt("base intrinsic for "+t+" exists, but the property is not available.");return}if(gr&&f+1>=n.length){var P=gr(u,y);v=!!P,v&&"get"in P&&!("originalValue"in P.get)?u=P.get:u=u[y]}else v=mn(u,y),u=u[y];v&&!c&&(gt[s]=u)}}return u},"GetIntrinsic")});var Dl=b((A0,zl)=>{"use strict";var hy=bi();zl.exports=a(function(){return hy()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Nl=b(($0,Cl)=>{"use strict";var gy=Rl(),kl=gy("%Object.defineProperty%",!0),yy=Dl()(),vy=Ai(),Py=ln(),gn=yy?Symbol.toStringTag:null;Cl.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 Py("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");gn&&(n||!vy(t,gn))&&(kl?kl(t,gn,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[gn]=r)},"setToStringTag")});var Ml=b((R0,Ul)=>{"use strict";var _y=Function.prototype.call,xy=Object.prototype.hasOwnProperty,by=Ot();Ul.exports=by.call(_y,xy)});var jl=b((z0,Ll)=>{"use strict";Ll.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Bl=b((D0,Vl)=>{"use strict";var Di=Zu(),Ty=require("util"),Oi=require("path"),Ey=require("http"),Iy=require("https"),Sy=require("url").parse,Ay=require("fs"),wy=require("stream").Stream,$y=require("crypto"),Ri=Xu(),Oy=fc(),Ry=Nl(),ct=Ml(),zi=jl();function Fl(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(Fl,"escapeHeaderParam");function te(e){if(!(this instanceof te))return new te(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Di.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(te,"FormData");Ty.inherits(te,Di);te.LINE_BREAK=`\r
|
|
2
|
+
`;te.DEFAULT_CONTENT_TYPE="application/octet-stream";te.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Di.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)};te.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)+te.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ct(t,"httpVersion"))&&!(t instanceof wy))&&(r.knownLength||this._valuesToMeasure.push(t))};te.prototype._lengthRetriever=function(e,t){ct(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ay.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):ct(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ct(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};te.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="'+Fl(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&zi(s,r.header);var u;for(var c in s)if(ct(s,c)){if(u=s[c],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=c+": "+u.join("; ")+te.LINE_BREAK)}return"--"+this.getBoundary()+te.LINE_BREAK+i+te.LINE_BREAK};te.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Oi.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Oi.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ct(e,"httpVersion")&&(r=Oi.basename(e.client._httpMessage.path||"")),r)return'filename="'+Fl(r)+'"'};te.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Ri.lookup(e.name)),!r&&e&&e.path&&(r=Ri.lookup(e.path)),!r&&e&&e.readable&&ct(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Ri.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=te.DEFAULT_CONTENT_TYPE),r};te.prototype._multiPartFooter=function(){return function(e){var t=te.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};te.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+te.LINE_BREAK};te.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ct(e,t)&&(r[t.toLowerCase()]=e[t]);return r};te.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};te.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};te.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(te.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};te.prototype._generateBoundary=function(){this._boundary="--------------------------"+$y.randomBytes(12).toString("hex")};te.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};te.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};te.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}Oy.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};te.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Sy(e),n=zi({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=zi(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Iy.request(n):r=Ey.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};te.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};te.prototype.toString=function(){return"[object FormData]"};Ry(te.prototype,"FormData");Vl.exports=te});var pe={};So(pe,{__addDisposableResource:()=>_p,__assign:()=>yn,__asyncDelegator:()=>dp,__asyncGenerator:()=>pp,__asyncValues:()=>fp,__await:()=>Ct,__awaiter:()=>ip,__classPrivateFieldGet:()=>yp,__classPrivateFieldIn:()=>Pp,__classPrivateFieldSet:()=>vp,__createBinding:()=>Pn,__decorate:()=>Yl,__disposeResources:()=>xp,__esDecorate:()=>ep,__exportStar:()=>sp,__extends:()=>Xl,__generator:()=>ap,__importDefault:()=>gp,__importStar:()=>hp,__makeTemplateObject:()=>mp,__metadata:()=>op,__param:()=>Ql,__propKey:()=>rp,__read:()=>Ui,__rest:()=>Jl,__rewriteRelativeImportExtension:()=>bp,__runInitializers:()=>tp,__setFunctionName:()=>np,__spread:()=>up,__spreadArray:()=>lp,__spreadArrays:()=>cp,__values:()=>vn,default:()=>qy});function Xl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ci(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 Yl(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 Ql(e,t){return function(r,n){t(r,n,e)}}function ep(e,t,r,n,o,i){function s(x){if(x!==void 0&&typeof x!="function")throw new TypeError("Function expected");return x}a(s,"accept");for(var u=n.kind,c=u==="getter"?"get":u==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,f=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),v,y=!1,p=r.length-1;p>=0;p--){var m={};for(var P in n)m[P]=P==="access"?{}:n[P];for(var P in n.access)m.access[P]=n.access[P];m.addInitializer=function(x){if(y)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(x||null))};var h=(0,r[p])(u==="accessor"?{get:f.get,set:f.set}:f[c],m);if(u==="accessor"){if(h===void 0)continue;if(h===null||typeof h!="object")throw new TypeError("Object expected");(v=s(h.get))&&(f.get=v),(v=s(h.set))&&(f.set=v),(v=s(h.init))&&o.unshift(v)}else(v=s(h))&&(u==="field"?o.unshift(v):f[c]=v)}d&&Object.defineProperty(d,n.name,f),y=!0}function tp(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 rp(e){return typeof e=="symbol"?e:"".concat(e)}function np(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 op(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function ip(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 ap(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 sp(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Pn(t,e,r)}function vn(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 Ui(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 up(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ui(arguments[t]));return e}function cp(){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 lp(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 Ct(e){return this instanceof Ct?(this.v=e,this):new Ct(e)}function pp(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(p){return function(m){return Promise.resolve(m).then(p,v)}}function u(p,m){n[p]&&(o[p]=function(P){return new Promise(function(h,x){i.push([p,P,h,x])>1||c(p,P)})},m&&(o[p]=m(o[p])))}function c(p,m){try{d(n[p](m))}catch(P){y(i[0][3],P)}}function d(p){p.value instanceof Ct?Promise.resolve(p.value.v).then(f,v):y(i[0][2],p)}function f(p){c("next",p)}function v(p){c("throw",p)}function y(p,m){p(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function dp(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:Ct(e[o](s)),done:!1}:i?i(s):s}:i}}function fp(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 vn=="function"?vn(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 mp(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function hp(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Ni(e),n=0;n<r.length;n++)r[n]!=="default"&&Pn(t,e,r[n]);return Hy(t,e),t}function gp(e){return e&&e.__esModule?e:{default:e}}function yp(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 vp(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 Pp(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 _p(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 xp(e){function t(i){e.error=e.hasError?new Zy(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 bp(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 Ci,yn,Pn,Hy,Ni,Zy,qy,de=af(()=>{Ci=a(function(e,t){return Ci=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])},Ci(e,t)},"extendStatics");a(Xl,"__extends");yn=a(function(){return yn=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"),yn.apply(this,arguments)},"__assign");a(Jl,"__rest");a(Yl,"__decorate");a(Ql,"__param");a(ep,"__esDecorate");a(tp,"__runInitializers");a(rp,"__propKey");a(np,"__setFunctionName");a(op,"__metadata");a(ip,"__awaiter");a(ap,"__generator");Pn=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(sp,"__exportStar");a(vn,"__values");a(Ui,"__read");a(up,"__spread");a(cp,"__spreadArrays");a(lp,"__spreadArray");a(Ct,"__await");a(pp,"__asyncGenerator");a(dp,"__asyncDelegator");a(fp,"__asyncValues");a(mp,"__makeTemplateObject");Hy=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Ni=a(function(e){return Ni=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Ni(e)},"ownKeys");a(hp,"__importStar");a(gp,"__importDefault");a(yp,"__classPrivateFieldGet");a(vp,"__classPrivateFieldSet");a(Pp,"__classPrivateFieldIn");a(_p,"__addDisposableResource");Zy=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(xp,"__disposeResources");a(bp,"__rewriteRelativeImportExtension");qy={__extends:Xl,__assign:yn,__rest:Jl,__decorate:Yl,__param:Ql,__esDecorate:ep,__runInitializers:tp,__propKey:rp,__setFunctionName:np,__metadata:op,__awaiter:ip,__generator:ap,__createBinding:Pn,__exportStar:sp,__values:vn,__read:Ui,__spread:up,__spreadArrays:cp,__spreadArray:lp,__await:Ct,__asyncGenerator:pp,__asyncDelegator:dp,__asyncValues:fp,__makeTemplateObject:mp,__importStar:hp,__importDefault:gp,__classPrivateFieldGet:yp,__classPrivateFieldSet:vp,__classPrivateFieldIn:Pp,__addDisposableResource:_p,__disposeResources:xp,__rewriteRelativeImportExtension:bp}});var _r=b(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.RequestMethod=void 0;var Tp;(function(e){e.GET="GET",e.PATCH="PATCH",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"})(Tp||(_n.RequestMethod=Tp={}))});var Ep=b(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.BatchRequestContent=void 0;var Nt=(de(),ce(pe)),Mi=_r(),Gy=(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 Nt.__awaiter(this,void 0,void 0,function(){var r,n,o,i;return Nt.__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===Mi.RequestMethod.PATCH||t.method===Mi.RequestMethod.POST||t.method===Mi.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 Nt.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c,d;return Nt.__generator(this,function(f){switch(f.label){case 0:r=!1,f.label=1;case 1:return f.trys.push([1,3,,4]),o=t.clone(),[4,o.json()];case 2:return n=f.sent(),r=!0,[3,4];case 3:return i=f.sent(),[3,4];case 4:if(r)return[3,12];f.label=5;case 5:return f.trys.push([5,11,,12]),typeof Blob<"u"?[4,t.blob()]:[3,8];case 6:return s=f.sent(),u=new FileReader,[4,new Promise(function(v){u.addEventListener("load",function(){var y=u.result,p=new RegExp("^s*data:(.+?/.+?(;.+?=.+?)*)?(;base64)?,(.*)s*$"),m=p.exec(y);v(m[4])},!1),u.readAsDataURL(s)})];case 7:return n=f.sent(),[3,10];case 8:return typeof Buffer<"u"?[4,t.buffer()]:[3,10];case 9:c=f.sent(),n=c.toString("base64"),f.label=10;case 10:return r=!0,[3,12];case 11:return d=f.sent(),[3,12];case 12:return[2,n]}})})},e.prototype.addRequest=function(t){var r=e.requestLimit;if(t.id===""){var n=new Error("Id for a request is empty, Please provide an unique id");throw n.name="Empty Id For Request",n}if(this.requests.size===r){var n=new Error("Maximum requests limit exceeded, Max allowed number of requests are ".concat(r));throw n.name="Limit Exceeded Error",n}if(this.requests.has(t.id)){var n=new Error("Adding request with duplicate id ".concat(t.id,", Make the id of the requests unique"));throw n.name="Duplicate RequestId Error",n}return this.requests.set(t.id,t),t.id},e.prototype.removeRequest=function(t){for(var r=this.requests.delete(t),n=this.requests.entries(),o=n.next();!o.done;){var i=o.value[1].dependsOn;if(typeof i<"u"){var s=i.indexOf(t);s!==-1&&i.splice(s,1),i.length===0&&delete o.value[1].dependsOn}o=n.next()}return r},e.prototype.getContent=function(){return Nt.__awaiter(this,void 0,void 0,function(){var t,r,n,o,u,u,i,s,u;return Nt.__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
3
|
1. Parallel - no individual request states a dependency in the dependsOn property.
|
|
4
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})();xn.BatchRequestContent=Dy});var yp=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BatchResponseContent=void 0;var Cy=(de(),ce(pe)),Ny=(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 Cy.__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})();bn.BatchResponseContent=Ny});var Ni=b(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.GRAPH_URLS=ct.GRAPH_BASE_URL=ct.GRAPH_API_VERSION=void 0;ct.GRAPH_API_VERSION="v1.0";ct.GRAPH_BASE_URL="https://graph.microsoft.com/";ct.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(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.GraphClientError=void 0;var Uy=(de(),ce(pe)),My=(function(e){Uy.__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);Tn.GraphClientError=My});var In=b(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.isCustomHost=Ce.isGraphURL=Ce.serializeContent=Ce.urlJoin=Ce.oDataQueryNames=void 0;var Ly=Ni(),jy=Ke();Ce.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var Fy=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=Fy;var Vy=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=Vy;var By=a(function(e){return vp(e)},"isGraphURL");Ce.isGraphURL=By;var Hy=a(function(e,t){return t.forEach(function(r){return Zy(r)}),vp(e,t)},"isCustomHost");Ce.isCustomHost=Hy;var vp=a(function(e,t){if(t===void 0&&(t=Ly.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"),Zy=a(function(e){if(e.indexOf("/")!==-1)throw new jy.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 lt=b(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.MiddlewareControl=void 0;var qy=(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})();En.MiddlewareControl=qy});var Ut=b(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.cloneRequestWithNewUrl=Ne.appendRequestHeader=Ne.setRequestHeader=Ne.getRequestHeader=Ne.generateUUID=void 0;var _p=(de(),ce(pe)),Gy=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=Gy;var Wy=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=Wy;var Ky=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=Ky;var Jy=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=Jy;var Xy=a(function(e,t){return _p.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,c,d,f,v,y,l,m;return _p.__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=Xy});var Ui=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.AuthenticationHandlerOptions=void 0;var Yy=(function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e})();Sn.AuthenticationHandlerOptions=Yy});var Lt=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.TelemetryHandlerOptions=Mt.FeatureUsageFlag=void 0;var Pp=lt(),Mi;(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"})(Mi||(Mt.FeatureUsageFlag=Mi={}));var Qy=(function(){function e(){this.featureUsage=Mi.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof Pp.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new Pp.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})();Mt.TelemetryHandlerOptions=Qy});var wn=b(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.AuthenticationHandler=void 0;var xp=(de(),ce(pe)),bp=In(),ev=lt(),tv=Ut(),rv=Ui(),Tp=Lt(),nv=(function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return xp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return xp.__generator(this,function(c){switch(c.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,bp.isGraphURL)(r)||t.customHosts&&(0,bp.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof ev.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(rv.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,tv.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),Tp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Tp.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})();An.AuthenticationHandler=nv});var On=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.HTTPMessageHandler=void 0;var Ip=(de(),ce(pe)),ov=(function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return Ip.__awaiter(this,void 0,void 0,function(){var r;return Ip.__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})();$n.HTTPMessageHandler=ov});var br=b(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RetryHandlerOptions=void 0;var iv=(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})();Rn.RetryHandlerOptions=iv});var kn=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.RetryHandler=void 0;var jt=(de(),ce(pe)),Li=xr(),av=lt(),Ep=Ut(),Sp=br(),Ap=Lt(),sv=(function(){function e(t){t===void 0&&(t=new Sp.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===Li.RequestMethod.PUT||n===Li.RequestMethod.PATCH||n===Li.RequestMethod.POST;if(o){var i=(0,Ep.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 jt.__awaiter(this,void 0,void 0,function(){var r;return jt.__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 av.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new Sp.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return jt.__awaiter(this,void 0,void 0,function(){var o;return jt.__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,Ep.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 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),Ap.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Ap.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})();zn.RetryHandler=sv});var Tr=b(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.RedirectHandlerOptions=void 0;var uv=(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})();Dn.RedirectHandlerOptions=uv});var Nn=b(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.RedirectHandler=void 0;var Ft=(de(),ce(pe)),cv=xr(),lv=lt(),pv=Ut(),ji=Tr(),wp=Lt(),dv=(function(){function e(t){t===void 0&&(t=new ji.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 Ft.__awaiter(this,void 0,void 0,function(){var n,o;return Ft.__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,pv.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 lv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(ji.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new ji.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return Ft.__awaiter(this,void 0,void 0,function(){var o,i;return Ft.__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=cv.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 Ft.__awaiter(this,void 0,void 0,function(){var r,n;return Ft.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,wp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,wp.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})();Cn.RedirectHandler=dv});var $p=b(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.PACKAGE_VERSION=void 0;Un.PACKAGE_VERSION="3.0.7"});var jn=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.TelemetryHandler=void 0;var Op=(de(),ce(pe)),Rp=In(),fv=$p(),mv=lt(),Mn=Ut(),hv=Lt(),gv=(function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return Op.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return Op.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Rp.isGraphURL)(r)||t.customHosts&&(0,Rp.isCustomHost)(r,t.customHosts)?(n=(0,Mn.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,Mn.generateUUID)(),(0,Mn.setRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER,n)),o="".concat(e.PRODUCT_NAME,"/").concat(fv.PACKAGE_VERSION),i=void 0,t.middlewareControl instanceof mv.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(hv.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,Mn.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})();Ln.TelemetryHandler=gv});var zp=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.MiddlewareFactory=void 0;var yv=wn(),vv=On(),_v=Tr(),Pv=br(),xv=Nn(),bv=kn(),Tv=jn(),Iv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Ev=(function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new yv.AuthenticationHandler(t),o=new bv.RetryHandler(new Pv.RetryHandlerOptions),i=new Tv.TelemetryHandler,s=new vv.HTTPMessageHandler;if(r.push(n),r.push(o),Iv()){var u=new xv.RedirectHandler(new _v.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e})();Fn.MiddlewareFactory=Ev});var Bn=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ChaosStrategy=void 0;var kp;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(kp||(Vn.ChaosStrategy=kp={}))});var Fi=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ChaosHandlerOptions=void 0;var Sv=Bn(),Av=(function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=Sv.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})();Hn.ChaosHandlerOptions=Av});var Dp=b(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.httpStatusCode=Vt.methodStatusCode=void 0;Vt.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]};Vt.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 Up=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ChaosHandler=void 0;var Zn=(de(),ce(pe)),wv=lt(),$v=Ut(),Cp=Dp(),Vi=Fi(),Np=Bn(),Ov=(function(){function e(t,r){t===void 0&&(t=new Vi.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=Cp.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,$v.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 Zn.__awaiter(this,void 0,void 0,function(){return Zn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===Np.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=Cp.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===Np.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 wv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Vi.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Vi.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Zn.__awaiter(this,void 0,void 0,function(){var r;return Zn.__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})();qn.ChaosHandler=Ov});var Ir=b(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ResponseType=void 0;var Mp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(Mp||(Gn.ResponseType=Mp={}))});var Hi=b(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.GraphResponseHandler=Bt.DocumentType=void 0;var Wn=(de(),ce(pe)),yt=Ir(),Bi;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(Bi||(Bt.DocumentType=Bi={}));var Kn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Kn||(Kn={}));var Jn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Jn||(Jn={}));var Rv=(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 Wn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Wn.__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,Bi.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(Jn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Jn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Kn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Kn.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 Wn.__awaiter(this,void 0,void 0,function(){var o;return Wn.__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})();Bt.GraphResponseHandler=Rv});var Zi=b(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.Range=void 0;var zv=(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})();Xn.Range=zv});var qi=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.UploadResult=void 0;var kv=(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})();Yn.UploadResult=kv});var Wi=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.LargeFileUploadTask=void 0;var Oe=(de(),ce(pe)),Gi=Ke(),Dv=Hi(),Lp=Ir(),Qn=Zi(),Cv=qi(),Nv=(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 Gi.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 Qn.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 Qn.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 Qn.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 Qn.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 Gi.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 Gi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,Dv.GraphResponseHandler.getResponse(i)];case 4:return s=c.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,Cv.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(Lp.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(Lp.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})();eo.LargeFileUploadTask=Nv});var Ki=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.FileUpload=void 0;var Uv=Ke(),Mv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Uv.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})();to.FileUpload=Mv});var Ji=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.getValidRangeSize=void 0;var Lv=5*1024*1024,jv=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),Fv=a(function(e){e===void 0&&(e=Lv);var t=60*1024*1024;return e>t&&(e=t),jv(e)},"getValidRangeSize");ro.getValidRangeSize=Fv});var Fp=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.OneDriveLargeFileUploadTask=void 0;var Je=(de(),ce(pe)),jp=Ke(),Vv=Ki(),Bv=Wi(),Hv=Ji(),Zv=(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 jp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new Vv.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 jp.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,Hv.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})(Bv.LargeFileUploadTask);no.OneDriveLargeFileUploadTask=Zv});var Bp=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.StreamUpload=void 0;var Vp=(de(),ce(pe)),Er=Ke(),qv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Er.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 Vp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c;return Vp.__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 Er.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 Er.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 Er.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 Er.GraphClientError("Error encountered while reading the stream during the upload"))})})},e})();oo.StreamUpload=qv});var Hp=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.PageIterator=void 0;var Ht=(de(),ce(pe)),Gv=(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 Ht.__awaiter(this,void 0,void 0,function(){var t,r;return Ht.__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 Ht.__awaiter(this,void 0,void 0,function(){var t;return Ht.__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 Ht.__awaiter(this,void 0,void 0,function(){return Ht.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e})();io.PageIterator=Gv});var Xi=b(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CustomAuthenticationProvider=void 0;var ao=(de(),ce(pe)),Zp=Ke(),Wv=(function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return ao.__awaiter(this,void 0,void 0,function(){var t=this;return ao.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return ao.__awaiter(t,void 0,void 0,function(){var u,c;return ao.__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 Zp.GraphClientError(u)),[4,Zp.GraphClientError.setGraphClientError(i)];case 2:c=d.sent(),o(c),d.label=3;case 3:return[2]}})})})})]})})},e})();so.CustomAuthenticationProvider=Wv});var Yi=b(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.GraphError=void 0;var Kv=(de(),ce(pe)),Jv=(function(e){Kv.__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);uo.GraphError=Jv});var Gp=b(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.GraphErrorHandler=void 0;var qp=(de(),ce(pe)),Qi=Yi(),Xv=(function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new Qi.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 Qi.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),qp.__awaiter(this,void 0,void 0,function(){var i;return qp.__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 Qi.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e})();co.GraphErrorHandler=Xv});var ea=b(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.GraphRequest=void 0;var ae=(de(),ce(pe)),Yv=Ke(),Qv=Gp(),Sr=In(),e_=Hi(),t_=lt(),vt=xr(),r_=Ir(),n_=(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,Sr.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(Sr.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 t_.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,e_.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=l.sent(),[2,d];case 4:if(f=l.sent(),f instanceof Yv.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,Qv.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,Sr.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,Sr.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,Sr.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(r_.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})();lo.GraphRequest=n_});var ta=b(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.HTTPClient=void 0;var Wp=(de(),ce(pe)),o_=(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 Wp.__awaiter(this,void 0,void 0,function(){var r;return Wp.__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})();po.HTTPClient=o_});var Jp=b(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.HTTPClientFactory=void 0;var i_=(de(),ce(pe)),Kp=ta(),a_=wn(),s_=On(),u_=Tr(),c_=br(),l_=Nn(),p_=kn(),d_=jn(),f_=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),m_=(function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new a_.AuthenticationHandler(t),n=new p_.RetryHandler(new c_.RetryHandlerOptions),o=new d_.TelemetryHandler,i=new s_.HTTPMessageHandler;if(r.setNext(n),f_()){var s=new l_.RedirectHandler(new u_.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(Kp.HTTPClient.bind.apply(Kp.HTTPClient,i_.__spreadArray([void 0],t,!1)))},e})();fo.HTTPClientFactory=m_});var Xp=b(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.validatePolyFilling=void 0;var h_=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");mo.validatePolyFilling=h_});var ed=b(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Client=void 0;var g_=(de(),ce(pe)),Yp=Ni(),y_=Xi(),v_=ea(),Qp=ta(),__=Jp(),P_=Xp(),x_=(function(){function e(t){this.config={baseUrl:Yp.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:Yp.GRAPH_API_VERSION},(0,P_.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=__.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(Qp.HTTPClient.bind.apply(Qp.HTTPClient,g_.__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 y_.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new v_.GraphRequest(this.httpClient,this.config,t)},e})();ho.Client=x_});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 b_=gp();Object.defineProperty(R,"BatchRequestContent",{enumerable:!0,get:a(function(){return b_.BatchRequestContent},"get")});var T_=yp();Object.defineProperty(R,"BatchResponseContent",{enumerable:!0,get:a(function(){return T_.BatchResponseContent},"get")});var I_=wn();Object.defineProperty(R,"AuthenticationHandler",{enumerable:!0,get:a(function(){return I_.AuthenticationHandler},"get")});var E_=On();Object.defineProperty(R,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return E_.HTTPMessageHandler},"get")});var S_=kn();Object.defineProperty(R,"RetryHandler",{enumerable:!0,get:a(function(){return S_.RetryHandler},"get")});var A_=Nn();Object.defineProperty(R,"RedirectHandler",{enumerable:!0,get:a(function(){return A_.RedirectHandler},"get")});var w_=jn();Object.defineProperty(R,"TelemetryHandler",{enumerable:!0,get:a(function(){return w_.TelemetryHandler},"get")});var $_=zp();Object.defineProperty(R,"MiddlewareFactory",{enumerable:!0,get:a(function(){return $_.MiddlewareFactory},"get")});var O_=Ui();Object.defineProperty(R,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return O_.AuthenticationHandlerOptions},"get")});var R_=br();Object.defineProperty(R,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return R_.RetryHandlerOptions},"get")});var z_=Tr();Object.defineProperty(R,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return z_.RedirectHandlerOptions},"get")});var td=Lt();Object.defineProperty(R,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return td.FeatureUsageFlag},"get")});Object.defineProperty(R,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return td.TelemetryHandlerOptions},"get")});var k_=Fi();Object.defineProperty(R,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return k_.ChaosHandlerOptions},"get")});var D_=Bn();Object.defineProperty(R,"ChaosStrategy",{enumerable:!0,get:a(function(){return D_.ChaosStrategy},"get")});var C_=Up();Object.defineProperty(R,"ChaosHandler",{enumerable:!0,get:a(function(){return C_.ChaosHandler},"get")});var N_=Wi();Object.defineProperty(R,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return N_.LargeFileUploadTask},"get")});var U_=Fp();Object.defineProperty(R,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return U_.OneDriveLargeFileUploadTask},"get")});var M_=Ji();Object.defineProperty(R,"getValidRangeSize",{enumerable:!0,get:a(function(){return M_.getValidRangeSize},"get")});var L_=Bp();Object.defineProperty(R,"StreamUpload",{enumerable:!0,get:a(function(){return L_.StreamUpload},"get")});var j_=Ki();Object.defineProperty(R,"FileUpload",{enumerable:!0,get:a(function(){return j_.FileUpload},"get")});var F_=qi();Object.defineProperty(R,"UploadResult",{enumerable:!0,get:a(function(){return F_.UploadResult},"get")});var V_=Zi();Object.defineProperty(R,"Range",{enumerable:!0,get:a(function(){return V_.Range},"get")});var B_=Hp();Object.defineProperty(R,"PageIterator",{enumerable:!0,get:a(function(){return B_.PageIterator},"get")});var H_=ed();Object.defineProperty(R,"Client",{enumerable:!0,get:a(function(){return H_.Client},"get")});var Z_=Xi();Object.defineProperty(R,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return Z_.CustomAuthenticationProvider},"get")});var q_=Yi();Object.defineProperty(R,"GraphError",{enumerable:!0,get:a(function(){return q_.GraphError},"get")});var G_=Ke();Object.defineProperty(R,"GraphClientError",{enumerable:!0,get:a(function(){return G_.GraphClientError},"get")});var W_=ea();Object.defineProperty(R,"GraphRequest",{enumerable:!0,get:a(function(){return W_.GraphRequest},"get")});var K_=Ir();Object.defineProperty(R,"ResponseType",{enumerable:!0,get:a(function(){return K_.ResponseType},"get")})});var Zt=b((oa,ia)=>{(function(e,t){typeof oa=="object"&&typeof ia<"u"?ia.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(oa,(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")},x=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:x,z:a(function(V){var w=-V.utcOffset(),E=Math.abs(w),k=Math.floor(E/60),O=E%60;return(w<=0?"+":"-")+x(k,2,"0")+":"+x(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(ft,we){var Ye=K.w(O.$u?Date.UTC(O.$y,we,ft):new Date(O.$y,we,ft),O);return q?Ye:Ye.endOf(u)},"l"),ye=a(function(ft,we){return K.w(O.toDate()[ft].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 dt=this.$locale().weekStart||0,qt=(xe<dt?xe+7:xe)-dt;return oe(q?ke-qt:ke+(6-qt),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,dt=a(function(we,Ye,Gt,Dr){return we&&(we[Ye]||we(k,q))||Gt[Ye].slice(0,Dr)},"h"),qt=a(function(we){return K.s(oe%12||12,we,"0")},"d"),ft=Pt||function(we,Ye,Gt){var Dr=we<12?"AM":"PM";return Gt?Dr.toLowerCase():Dr};return q.replace(_,(function(we,Ye){return Ye||(function(Gt){switch(Gt){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 dt(O.monthsShort,xe,ke,3);case"MMMM":return dt(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 dt(O.weekdaysMin,k.$W,Te,2);case"ddd":return dt(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 qt(1);case"hh":return qt(2);case"a":return ft(oe,ye,!0);case"A":return ft(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})(),pt=_t.prototype;return ne.prototype=pt,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach((function(V){pt[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 oP={};So(oP,{microsoftSharePoint:()=>nP});module.exports=ce(oP);var Yd=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.")}},Cr=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ao={};function Be(e){return e&&Object.assign(Ao,e),Ao}a(Be,"config");function $o(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($o,"getEnumValues");function la(e,t){return typeof t=="bigint"?t.toString():t}a(la,"jsonStringifyReplacer");function Ur(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ur,"cached");function pa(e){return e==null}a(pa,"nullish");function Mr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Mr,"cleanRegex");var ca=Symbol("evaluating");function _e(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ca)return n===void 0&&(n=ca,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(_e,"defineLazy");var Oo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Kt,"isObject");var Qd=Ur(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function da(e){if(Kt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Kt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(da,"isPlainObject");var fa=new Set(["string","number","symbol"]);function xt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(xt,"escapeRegex");function Lr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Lr,"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 ma(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(ma,"optionalKeys");var ha={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 Nr(e){return typeof e=="string"?e:e?.message}a(Nr,"unwrapMessage");function et(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Nr(e.inst?._zod.def?.error?.(e))??Nr(t?.error?.(e))??Nr(r.customError?.(e))??Nr(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 ga(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(ga,"getLengthableOrigin");function Ro(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(Ro,"issue");var ya=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,la,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),va=z("$ZodError",ya),Jt=z("$ZodError",ya,{Parent:Error});var tf=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 Oo(u,o?.callee),u}return s.value},"_parse"),jr=tf(Jt),rf=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 Oo(u,o?.callee),u}return s.value},"_parseAsync"),Fr=rf(Jt),nf=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??va)(i.issues.map(s=>et(s,o,Be())))}:{success:!0,data:i.value}},"_safeParse"),Xt=nf(Jt),of=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"),Yt=of(Jt);var af="(?:(?:\\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])))",sf=new RegExp(`^${af}$`);var _a=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Pa=/^-?\d+n?$/,xa=/^-?\d+$/,zo=/^-?\d+(?:\.\d+)?$/,ba=/^(?: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=[])}),uf={number:"number",bigint:"bigint",object:"date"};var Ta=z("$ZodCheckGreaterThan",(e,t)=>{tt.init(e,t);let r=uf[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 Ia=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]=ha[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=xa)}),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 Ea=z("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!pa(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=ga(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var ko=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=()=>{})}),Sa=z("$ZodCheckRegex",(e,t)=>{ko.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 wa={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=wa;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)}}_e(e,"~standard",()=>({validate:a(o=>{try{let i=Xt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Yt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Hr=z("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_a(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}}),Do=z("$ZodStringFormat",(e,t)=>{ko.init(e,t),Hr.init(e,t)});var ka=z("$ZodURL",(e,t)=>{Do.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 Co=z("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??zo,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}}),Da=z("$ZodNumberFormat",(e,t)=>{Ia.init(e,t),Co.init(e,t)}),No=z("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=ba,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}}),Ca=z("$ZodBigInt",(e,t)=>{fe.init(e,t),e._zod.pattern=Pa,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 Na=z("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r}),Ua=z("$ZodUnknown",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r});var Ma=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}}),La=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 $a(e,t,r){e.issues.length&&t.issues.push(...Qe(r,e.issues)),t.value[r]=e.value}a($a,"handleArrayResult");var ja=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=>$a(d,r,s))):$a(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Br(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(Br,"handlePropertyResult");function cf(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=ma(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(cf,"normalizeDef");function lf(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=>Br(l,r,v,t,f))):Br(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(lf,"handleCatchall");var Fa=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=Ur(()=>cf(t));_e(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=Kt,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=>Br(g,u,y,d,m))):Br(_,u,y,d,m)}return i?lf(f,d,u,c,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function Oa(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(Oa,"handleUnionResults");var Uo=z("$ZodUnion",(e,t)=>{fe.init(e,t),_e(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),_e(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),_e(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),_e(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=>Mr(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=>Oa(c,o,e,i)):Oa(u,o,e,i)}});var Va=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Uo.init(e,t);let r=e._zod.parse;_e(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=Ur(()=>{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(!Kt(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 Ba=z("$ZodRecord",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!da(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"&&zo.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 Ha=z("$ZodEnum",(e,t)=>{fe.init(e,t);let r=$o(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>fa.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}}),Za=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 qa=z("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Cr(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 Ra(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(Ra,"handleOptionalResult");var Ga=z("$ZodOptional",(e,t)=>{fe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_e(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(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=>Ra(i,r.value)):Ra(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Wa=z("$ZodNullable",(e,t)=>{fe.init(e,t),_e(e._zod,"optin",()=>t.innerType._zod.optin),_e(e._zod,"optout",()=>t.innerType._zod.optout),_e(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(r.source)}|null)$`):void 0}),_e(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 Ka=z("$ZodPipe",(e,t)=>{fe.init(e,t),_e(e._zod,"values",()=>t.in._zod.values),_e(e._zod,"optin",()=>t.in._zod.optin),_e(e._zod,"optout",()=>t.out._zod.optout),_e(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=>Vr(s,t.in,n)):Vr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Vr(i,t.out,n)):Vr(o,t.out,n)}});function Vr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(Vr,"handlePipeResult");var Ja=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=>za(i,r,n,e));za(o,r,n,e)}});function za(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(Ro(o))}}a(za,"handleRefineResult");var Ya;var Mo=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 Qa(){return new Mo}a(Qa,"registry");(Ya=globalThis).__zod_globalRegistry??(Ya.__zod_globalRegistry=Qa());var Lo=globalThis.__zod_globalRegistry;function es(e,t){return new e({type:"string",...ue(t)})}a(es,"_string");function ts(e,t){return new e({type:"string",coerce:!0,...ue(t)})}a(ts,"_coercedString");function rs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}a(rs,"_url");function ns(e,t){return new e({type:"number",checks:[],...ue(t)})}a(ns,"_number");function os(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}a(os,"_coercedNumber");function is(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}a(is,"_int");function as(e,t){return new e({type:"boolean",...ue(t)})}a(as,"_boolean");function ss(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}a(ss,"_coercedBoolean");function us(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}a(us,"_coercedBigint");function cs(e){return new e({type:"any"})}a(cs,"_any");function ls(e){return new e({type:"unknown"})}a(ls,"_unknown");function ps(e,t){return new e({type:"void",...ue(t)})}a(ps,"_void");function ds(e,t){return new e({type:"date",coerce:!0,...ue(t)})}a(ds,"_coercedDate");function Zr(e,t){return new Ta({check:"greater_than",...ue(t),value:e,inclusive:!0})}a(Zr,"_gte");function Ue(e,t){return new Ea({check:"min_length",...ue(t),minimum:e})}a(Ue,"_minLength");function rt(e,t){return new Sa({check:"string_format",format:"regex",...ue(t),pattern:e})}a(rt,"_regex");function fs(e,t,r){let n=ue(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(fs,"_custom");var Pe=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)=>jr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Xt(e,r,n),e.parseAsync=async(r,n)=>Fr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Yt(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)=>Lr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Gr=z("ZodMiniString",(e,t)=>{Hr.init(e,t),Pe.init(e,t)});function p(e){return es(Gr,e)}a(p,"string");var ms=z("ZodMiniStringFormat",(e,t)=>{Do.init(e,t),Gr.init(e,t)});var Tf=z("ZodMiniURL",(e,t)=>{ka.init(e,t),ms.init(e,t)});function hs(e){return rs(Tf,e)}a(hs,"url");var Wr=z("ZodMiniNumber",(e,t)=>{Co.init(e,t),Pe.init(e,t)});function Se(e){return ns(Wr,e)}a(Se,"number");var If=z("ZodMiniNumberFormat",(e,t)=>{Da.init(e,t),Wr.init(e,t)});function gs(e){return is(If,e)}a(gs,"int");var jo=z("ZodMiniBoolean",(e,t)=>{No.init(e,t),Pe.init(e,t)});function ee(e){return as(jo,e)}a(ee,"boolean");var ys=z("ZodMiniBigInt",(e,t)=>{Ca.init(e,t),Pe.init(e,t)});var Ef=z("ZodMiniAny",(e,t)=>{Na.init(e,t),Pe.init(e,t)});function er(){return cs(Ef)}a(er,"any");var Sf=z("ZodMiniUnknown",(e,t)=>{Ua.init(e,t),Pe.init(e,t)});function L(){return ls(Sf)}a(L,"unknown");var Af=z("ZodMiniVoid",(e,t)=>{Ma.init(e,t),Pe.init(e,t)});function vs(e){return ps(Af,e)}a(vs,"_void");var _s=z("ZodMiniDate",(e,t)=>{La.init(e,t),Pe.init(e,t)});var wf=z("ZodMiniArray",(e,t)=>{ja.init(e,t),Pe.init(e,t)});function B(e,t){return new wf({type:"array",element:e,...ue(t)})}a(B,"array");var $f=z("ZodMiniObject",(e,t)=>{Fa.init(e,t),Pe.init(e,t),_e(e,"shape",()=>t.shape)});function h(e,t){let r={type:"object",shape:e??{},...ue(t)};return new $f(r)}a(h,"object");var Of=z("ZodMiniUnion",(e,t)=>{Uo.init(e,t),Pe.init(e,t)});function H(e,t){return new Of({type:"union",options:e,...ue(t)})}a(H,"union");var Rf=z("ZodMiniDiscriminatedUnion",(e,t)=>{Va.init(e,t),Pe.init(e,t)});function nt(e,t,r){return new Rf({type:"union",options:t,discriminator:e,...ue(r)})}a(nt,"discriminatedUnion");var zf=z("ZodMiniRecord",(e,t)=>{Ba.init(e,t),Pe.init(e,t)});function j(e,t,r){return new zf({type:"record",keyType:e,valueType:t,...ue(r)})}a(j,"record");var kf=z("ZodMiniEnum",(e,t)=>{Ha.init(e,t),Pe.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 kf({type:"enum",entries:r,...ue(t)})}a(J,"_enum");var Df=z("ZodMiniLiteral",(e,t)=>{Za.init(e,t),Pe.init(e,t)});function C(e,t){return new Df({type:"literal",values:Array.isArray(e)?e:[e],...ue(t)})}a(C,"literal");var Cf=z("ZodMiniTransform",(e,t)=>{qa.init(e,t),Pe.init(e,t)});function ot(e){return new Cf({type:"transform",transform:e})}a(ot,"transform");var Nf=z("ZodMiniOptional",(e,t)=>{Ga.init(e,t),Pe.init(e,t)});function P(e){return new Nf({type:"optional",innerType:e})}a(P,"optional");var Uf=z("ZodMiniNullable",(e,t)=>{Wa.init(e,t),Pe.init(e,t)});function tr(e){return new Uf({type:"nullable",innerType:e})}a(tr,"nullable");var Mf=z("ZodMiniPipe",(e,t)=>{Ka.init(e,t),Pe.init(e,t)});function it(e,t){return new Mf({type:"pipe",in:e,out:t})}a(it,"pipe");var Lf=z("ZodMiniCustom",(e,t)=>{Ja.init(e,t),Pe.init(e,t)});function Kr(e,t){return fs(Lf,e??(()=>!0),t)}a(Kr,"custom");var rr={};So(rr,{bigint:()=>Zf,boolean:()=>Hf,date:()=>qf,number:()=>Bf,string:()=>Vf});function Vf(e){return ts(Gr,e)}a(Vf,"string");function Bf(e){return os(Wr,e)}a(Bf,"number");function Hf(e){return ss(jo,e)}a(Hf,"boolean");function Zf(e){return us(ys,e)}a(Zf,"bigint");function qf(e){return ds(_s,e)}a(qf,"date");var Vo=h({retryOnFailure:h({defaultValue:P(ee()),hide:P(ee())}),continueOnFailure:h({defaultValue:P(ee()),hide:P(ee())})}),Fo=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")}},te=a(e=>new Fo(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 re=h({displayName:p(),description:P(p())}),W=a((e,t)=>h({type:C(t),required:ee(),defaultValue:P(er())}),"TPropertyValue");var Re=h({...re.shape,...W(p(),"SHORT_TEXT").shape}),He=h({...re.shape,...W(p(),"LONG_TEXT").shape});var xs=h({label:p(),value:L()}),Jr=h({disabled:P(ee()),placeholder:P(p()),options:B(xs)});var ze=h({...re.shape,options:Jr,...W(L(),"STATIC_DROPDOWN").shape}),Ze=h({...re.shape,options:Jr,...W(B(L()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Bo=h({...re.shape,...W(L(),"DROPDOWN").shape,refreshers:B(p())}),nr=h({...re.shape,...W(B(L()),"MULTI_SELECT_DROPDOWN").shape,refreshers:B(p())});var qe=h({...re.shape,...W(ee(),"CHECKBOX").shape});var Ge=h({...re.shape,...W(Se(),"NUMBER").shape});var or=h({...re.shape,streaming:P(ee()),...W(L(),"FILE").shape});var ir=h({...re.shape,...W(p(),"DATE_TIME").shape});var bs=j(p(),H([Re,He,ze,nr,Ze,qe,Ge,or,ir])),ar=h({...re.shape,properties:bs,...W(B(L()),"ARRAY").shape});var sr=h({...re.shape,...W(H([j(p(),L())]),"JSON").shape});var Ts=H([Re,ze,sr,ar,Ze]),Wf=j(p(),Ts),Ho=h({refreshers:B(p()),...re.shape,...W(L(),"DYNAMIC").shape});var Xr=h({...re.shape,...W(vs(),"MARKDOWN").shape});var ur=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ur||{}),Tt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Tt||{}),It=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(It||{});var cr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(cr||{}),Zo="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||{}),lr=(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))(lr||{}),Kf=h({strategy:J(lr),paramName:P(p())}),pr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(pr||{});var Yr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Yr||{}),Is=h({status:P(Se()),body:P(L()),headers:P(j(p(),p()))}),Es=h({type:C("DELAY"),resumeDateTime:p(),requestIdToReply:P(p()),handlerId:P(p()),streamStepProgress:P(J(Yr))}),Ss=h({type:C("WEBHOOK"),requestId:p(),requestIdToReply:P(p()),response:Is,handlerId:P(p()),streamStepProgress:P(J(Yr))}),Jf=H([Es,Ss]);var Xf=h({body:L(),rawBody:P(L()),headers:j(p(),p()),queryParams:j(p(),p())});function ve(e){return e==null}a(ve,"isNil");function dr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(dr,"isEmpty");function Qr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(Qr,"assertNotNullOrUndefined");var qo=Y(require("crypto"),1);var Yf=128,at,Et,Qf=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!at||at.length<e?(at=Buffer.allocUnsafe(e*Yf),qo.default.randomFillSync(at),Et=0):Et+e>at.length&&(qo.default.randomFillSync(at),Et=0)}catch(t){throw at=void 0,t}Et+=e},"fillPool"),em=a(e=>(Qf(e|=0),at.subarray(Et-e,Et)),"random"),tm=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)=>{if(i<=0)return"";let s="";for(;;){let u=r(o),c=o;for(;c--;)if(s+=e[u[c]&n]||"",s.length===i)return s}}},"customRandom"),ws=a((e,t=21)=>tm(e,t,em),"customAlphabet");var rm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",$s=21,M$=p().check(rt(new RegExp(`^[0-9a-zA-Z]{${$s}}$`))),nm=ws(rm,$s);var st=it(ot(e=>e instanceof Date?e.toISOString():e),p()),De={id:p(),created:st,updated:st},le=a(e=>P(tr(e)),"Nullable");function Go(e){return P(tr(J(e)))}a(Go,"NullableEnum");var F$=it(ot(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),P(ee())),en=a(e=>it(ot(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),P(B(e))),"OptionalArrayFromQuery");var H$=j(p(),L());var fr=(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))(fr||{});var rO=p().check(rt(/^#[0-9A-Fa-f]{6}$/));var oO=h({filename:p(),data:L(),type:C("file"),mimetype:P(p())});var om=Y(Rs());var pO=h({...De,name:p(),permissions:B(p()),platformId:le(p()),type:p(),userCount:P(Se())});var zs=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(zs||{}),Wo=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Wo||{}),Ko=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ko||{});var Jo=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Jo||{});var Xo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Xo||{});var im=h({mode:J(zs),value:L()}),am=h({auth:P(p()),fields:j(p(),im)}),sm=h({pieceName:p(),pieceVersion:p(),actionName:p(),predefinedInput:P(am)}),um=h({type:C("PIECE"),toolName:p().check(Ue(1)),pieceMetadata:sm}),cm=h({type:C("none")}),lm=h({type:C("access_token"),accessToken:p()}),pm=h({type:C("api_key"),apiKey:p(),apiKeyHeader:p()}),dm=h({type:C("headers"),headers:j(p(),p())}),fm=nt("type",[cm,lm,pm,dm]),ks=h({type:C("FLOW"),toolName:p().check(Ue(1)),externalFlowId:p(),flowDisplayName:P(p())}),Ds=h({type:C("MCP"),toolName:p().check(Ue(1)),serverUrl:hs(),protocol:J(Ko),auth:fm}),Cs=h({type:C("KNOWLEDGE_BASE"),toolName:p().check(Ue(1)),sourceType:J(Wo),sourceId:p(),sourceName:p()}),mm=nt("type",[um,ks,Ds,Cs]),hm=h({displayName:p(),description:P(p()),type:J(Jo)}),Ns=h({type:C("MARKDOWN"),markdown:p()}),St={type:C("TOOL_CALL"),input:le(j(p(),L())),output:P(L()),toolName:p(),status:J(Xo),toolCallId:p(),startTime:p(),endTime:P(p())},VO=h(St),Us=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()})]),gm=H([Ns,Us]);var Yo=(r=>(r.IMAGE="image",r.TEXT="text",r))(Yo||{}),We=h({apiKey:p()}),ym=We,vm=h({apiKey:p(),apiKeyHash:p()}),_m=We,Pm=We,xm=We,bm=We,Tm=We,Im=We,Em=We,Vs=h({accessKeyId:p().check(Ue(1)),secretAccessKey:p().check(Ue(1))}),Sm=h({}),Am=h({}),wm=h({}),$m=h({}),Om=h({}),Rm=h({}),Bs=h({modelId:p(),modelName:p(),modelType:J(Yo)}),Hs=h({apiKeyHeader:p(),baseUrl:p(),models:B(Bs),defaultHeaders:P(j(p(),p()))}),Zs=h({accountId:p(),gatewayId:p(),models:B(Bs),vertexProject:P(p()),vertexRegion:P(p())}),qs=h({resourceName:p(),apiVersion:it(ot(e=>typeof e=="string"&&e.trim().length===0?void 0:e),P(p()))}),Gs=h({region:p().check(Ue(1))}),zm=H([ym,xm,bm,Tm,Im,Pm,_m,vm,Vs,Em]),Ws=H([Hs,Zs,qs,Gs,Sm,wm,$m,Om,Am,Rm]),km=h({id:p(),name:p(),type:J(Yo)}),Dm=h({id:p(),name:p(),provider:J(fr),config:Ws,enabledForChat:ee()}),Cm=h({provider:J(fr),config:Ws,auth:zm,platformId:p()});var qO={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ms=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Nm=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Um=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ls=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Mm=["grok-4.20","grok-4.1-fast"],Lm={openai:Ms,anthropic:Nm,google:Ls,activepieces:[...Um.map(e=>`anthropic/${e}`),...Ms.map(e=>`openai/${e}`),...Ls.map(e=>`google/${e}`),...Mm.map(e=>`x-ai/${e}`)]};var js=128e3,jm={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Fm({provider:e}){return e?jm[e]??js:js}a(Fm,"getMaxContextTokens");var Fs={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"},Vm={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Bm=new Set(["anthropic","mistral"]);function Fe(e){return{chatModels:Lm[e],maxContextTokens:Fm({provider:e}),defaultEmbeddingModel:Fs[e],supportsEmbedding:Fs[e]!==void 0,supportsImageGeneration:!Bm.has(e),webSearch:Vm[e]}}a(Fe,"buildProviderCapabilities");var Hm={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 Zm=h({base64Url:p(),fileName:p(),extension:P(p())}),qm=h({mimeType:p(),url:p(),fileName:P(p())}),Qo=H([Zm,qm]);var Gm=H([h({type:C("file"),value:Qo}),h({type:C("markdown"),value:p(),files:P(B(Qo))})]),Wm=h({sessionId:p(),message:p(),files:P(B(p()))});var Js=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Js||{}),Xs=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Xs||{}),ei=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(ei||{});var Km=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()})]),Jm=h({...De,name:p(),folderId:le(p()),projectId:p(),externalId:p(),status:Go(Xs),trigger:Go(Js)}),Xm=h({...De,tableId:p(),projectId:p(),cells:j(p(),h({updated:p(),created:p(),value:L(),fieldName:p()}))}),Ym=h({events:B(J(ei)),webhookUrl:p(),flowId:p()}),Qm=h({fields:B(h({id:p(),name:p()})),rows:B(j(p(),p())),name:p()}),eh=h({projectId:p(),limit:P(rr.number()),cursor:P(p()),name:P(p()),externalIds:en(p()),folderId:P(p()),folderIds:en(p())}),th=h({records:B(B(h({fieldId:p(),value:Qs()}))),tableId:p()}),rh=h({cells:P(B(h({fieldId:p(),value:Qs()}))),tableId:p(),agentUpdate:P(ee())}),Ys=nt("operator",[mt("eq"),mt("neq"),mt("gt"),mt("gte"),mt("lt"),mt("lte"),mt("co"),Ks("exists"),Ks("not_exists")]),nh=h({tableId:p(),limit:P(rr.number()),cursor:P(p()),filters:en(Ys)});function Qs(){return it(ot(e=>e==null?e:String(e)),tr(p()))}a(Qs,"coerceToString");function mt(e){return h({fieldId:p(),operator:C(e),value:p()})}a(mt,"valueFilter");function Ks(e){return h({fieldId:p(),operator:C(e)})}a(Ks,"existenceFilter");var oh=h({status:P(Se()),body:P(L()),headers:P(j(p(),p()))}),ih=h({...De,deleted:le(st),ownerId:p(),displayName:p(),platformId:p(),externalId:le(p())});var eu=h({name:p(),description:P(p()),type:p(),required:ee()}),ah=h({pieceName:p(),triggerName:p(),input:h({toolName:p(),toolDescription:p(),inputSchema:B(eu),returnsResponse:ee()})});var tu="^[0-9]+\\.[0-9]+\\.[0-9]+$",pR=new RegExp(tu),uh="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",dR=p().check(rt(new RegExp(tu))),fR=p().check(rt(new RegExp(uh))),ch=h({packageType:C("ARCHIVE"),pieceType:J(Tt),pieceName:p(),pieceVersion:p(),archiveId:p(),platformId:p()}),ru=h({packageType:C("REGISTRY"),pieceType:C("OFFICIAL"),pieceName:p(),pieceVersion:p()}),nu=h({packageType:C("REGISTRY"),pieceType:C("CUSTOM"),pieceName:p(),pieceVersion:p(),platformId:p()}),mR=H([ru,nu]),hR=H([ch,ru,nu]);var lh=nt("type",[h({type:C("CRON_EXPRESSION"),cronExpression:p(),timezone:p()}),h({type:C("INTERVAL"),intervalMs:gs().check(Zr(6e4))})]),gR=h({...De,type:J(Ae),projectId:p(),flowId:p(),triggerName:p(),schedule:le(lh),flowVersionId:p(),pieceName:p(),pieceVersion:p(),deleted:le(p()),simulate:ee()}),ou=(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))(ou||{}),iu=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(iu||{}),au=(r=>(r.S3="S3",r.DB="DB",r))(au||{}),yR=h({...De,projectId:le(p()),platformId:le(p()),type:J(ou),compression:J(iu),data:P(L()),location:J(au),size:le(Se()),fileName:le(p()),s3Key:le(p()),metadata:le(j(p(),p()))}),su=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(su||{}),uu=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(uu||{}),vR=h({id:p(),email:p(),firstName:p(),status:J(uu),externalId:le(p()),platformId:le(p()),platformRole:J(su),lastName:p(),created:st,updated:st,lastActiveDate:le(st),imageUrl:le(p())});var ti=h({...re.shape,...W(j(p(),L()),"OBJECT").shape});var du=h({...re.shape,...W(p(),"COLOR").shape});var ri=H([Re,He,Xr,qe,ze,Ze,Bo,nr,Ho,Ge,ar,ti,sr,ir,or,du]),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:P(p()),hasConnectionIdentifier:P(ee())});var fu=h({username:p(),password:p()}),ni=h({...Ve.shape,username:h({displayName:p(),description:P(p())}),password:h({displayName:p(),description:P(p())}),...W(fu,"BASIC_AUTH").shape});var mh=j(p(),H([Re,He,Ge,qe,ze])),oi=h({...Ve.shape,props:mh,...W(L(),"CUSTOM_AUTH").shape});var ht=h({...Ve.shape,...W(h({auth:p()}),"SECRET_TEXT").shape});var hh=j(p(),H([Re,He,ht,Ge,qe,ze,Ze,Xr])),mu=h({...Ve.shape,props:hh,...W(L(),"OIDC").shape});var ii=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ii||{}),hu=H([Re,ht,ze]),gu=j(p(),hu),gh=h({props:P(j(p(),hu)),authUrl:p(),tokenUrl:p(),scope:B(p()),prompt:P(H([C("none"),C("consent"),C("login"),C("omit")])),pkce:P(ee()),pkceMethod:P(H([C("plain"),C("S256")])),authorizationMethod:P(J(ii)),grantType:P(H([J(cr),C(Zo)])),extra:P(j(p(),p()))}),yu=h({access_token:p(),props:P(gu),data:j(p(),er())}),ai=h({...Ve.shape,...gh.shape,...W(yu,"OAUTH2").shape});var At=H([ni,oi,mu,ai,ht]),mr="Connection",si={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||mr}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||mr,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||mr}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||mr}},None(){}};var Jz={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 yh=h({...re.shape,...W(L(),"CUSTOM").shape,code:p()});var vh=H([ri,At]),ui=j(p(),vh),gk=j(p(),ri);var vu=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,x,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=x;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,ve(e.sampleData)&&ve(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var _u="2",rn="0.82.0";var ci=class{constructor(t,r,n,o,i,s,u,c,d=rn,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:_u}),"getContextInfo");(!Ph(d)||xh(d,rn))&&(this.minimumSupportedRelease=rn),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:_h(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}},xu=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 ci(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 _h(e){if(e!==void 0)return Array.isArray(e)?e.map(Pu):Pu(e)}a(_h,"withConnectionIdentifierFlag");function Pu(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(Pu,"flagConnectionIdentifier");function Ph(e){return/^\d+\.\d+\.\d+$/.test(e)}a(Ph,"isValidSimpleSemver");function xh(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(xh,"isSemverLessThan");var bh=P(j(p(),j(p(),p()))),bu=h({id:P(p()),name:p(),displayName:p(),logoUrl:p(),description:p(),authors:B(p()),platformId:P(p()),directoryPath:P(p()),auth:P(H([At,B(At)])),version:p(),categories:P(B(J(It))),minimumSupportedRelease:P(p()),maximumSupportedRelease:P(p()),deprecated:P(ee()),i18n:bh}),Th=J(["human","ai","both"]),Tu=h({description:P(p()),idempotent:P(ee())}),Iu=h({name:p(),displayName:p(),description:p(),props:ui,requireAuth:ee(),errorHandlingOptions:P(Vo),outputSchema:P(Kr()),audience:P(Th),aiMetadata:P(Tu)}),Eu=h({name:p(),displayName:p(),description:p(),props:ui,errorHandlingOptions:P(Vo),type:J(Ae),sampleData:L(),handshakeConfiguration:P(Kr()),renewConfiguration:P(vu),testStrategy:J(pr),outputSchema:P(Kr()),aiMetadata:P(Tu)}),Ih=h({...bu.shape,actions:j(p(),Iu),triggers:j(p(),Eu)}),Eh=h({...bu.shape,actions:Se(),triggers:Se(),suggestedActions:P(B(Iu)),suggestedTriggers:P(B(Eu))}),Su=h({projectUsage:Se(),pieceType:J(Tt),packageType:J(ur),platformId:P(p()),archiveId:P(p())}),gD=h({...Ih.shape,...Su.shape}),yD=h({...Eh.shape,...Su.shape}),vD=h({name:p(),version:p()});var Sh=Y(require("path")),Ah=Y(require("fs/promises"));var $t=require("node:stream");var nn=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 on=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new li,r=new pi){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},li=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},pi=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 hr=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 Au({error:e,requestBody:t}){return e instanceof hr?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(Au,"toFailsafeOutput");var an=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(an||{});var sn=class extends nn{static{a(this,"FetchHttpClient")}constructor(t="",r=new on){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}=wh(t.method)?$h(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},_=Rh({...i,...l}),g=await Oh(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)}},m?0:v),x=f?300:400;if(g.status<200||g.status>=x){let Z=await wu(g,d==="stream"?"text":d),ge=new hr(t.body,{status:g.status,responseBody:Z});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ge),ge}let I=await wu(g,d);return{status:g.status,headers:zh(g.headers),body:I}}};function wh(e){return e!=="GET"&&e!=="HEAD"}a(wh,"acceptsRequestBody");function $h(e,t){if(Ou(e))return{body:void 0,extraHeaders:{},isStream:!1};if(kh(e)){let n=new $t.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof $t.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a($h,"serializeBody");async function wu(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ou(e.body)?$t.Readable.from([]):$t.Readable.fromWeb(e.body);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(wu,"parseResponseBody");async function Oh(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await $u(n);continue}return o}catch(o){if(r=o,n<t){await $u(n);continue}throw o}throw r}a(Oh,"sendWithRetries");function $u(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a($u,"backoff");function Rh(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(Rh,"normalizeHeaders");function zh(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(zh,"toHttpHeaders");function kh(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(kh,"isNodeFormData");function Ou(e){return e==null}a(Ou,"isNil");var gr=new sn;var Py=Y(require("fs")),Nl=Y(Cl());var xy={"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 by(e){let t=e.split(";")[0].trim().toLowerCase();return xy[t]??""}a(by,"contentTypeToExtension");var Ty=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Iy=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 Ul({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:c="headers"}){return te({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 ${
|
|
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})();xn.BatchRequestContent=Gy});var Ip=b(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BatchResponseContent=void 0;var Wy=(de(),ce(pe)),Ky=(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 Wy.__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})();bn.BatchResponseContent=Ky});var Li=b(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.GRAPH_URLS=lt.GRAPH_BASE_URL=lt.GRAPH_API_VERSION=void 0;lt.GRAPH_API_VERSION="v1.0";lt.GRAPH_BASE_URL="https://graph.microsoft.com/";lt.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 Xe=b(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.GraphClientError=void 0;var Xy=(de(),ce(pe)),Jy=(function(e){Xy.__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);Tn.GraphClientError=Jy});var En=b(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.isCustomHost=Me.isGraphURL=Me.serializeContent=Me.urlJoin=Me.oDataQueryNames=void 0;var Yy=Li(),Qy=Xe();Me.oDataQueryNames=["$select","$expand","$orderby","$filter","$top","$skip","$skipToken","$count"];var ev=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");Me.urlJoin=ev;var tv=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");Me.serializeContent=tv;var rv=a(function(e){return Sp(e)},"isGraphURL");Me.isGraphURL=rv;var nv=a(function(e,t){return t.forEach(function(r){return ov(r)}),Sp(e,t)},"isCustomHost");Me.isCustomHost=nv;var Sp=a(function(e,t){if(t===void 0&&(t=Yy.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"),ov=a(function(e){if(e.indexOf("/")!==-1)throw new Qy.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 pt=b(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MiddlewareControl=void 0;var iv=(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})();In.MiddlewareControl=iv});var Ut=b(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.cloneRequestWithNewUrl=Le.appendRequestHeader=Le.setRequestHeader=Le.getRequestHeader=Le.generateUUID=void 0;var Ap=(de(),ce(pe)),av=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");Le.generateUUID=av;var sv=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");Le.getRequestHeader=sv;var uv=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");Le.setRequestHeader=uv;var cv=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");Le.appendRequestHeader=cv;var lv=a(function(e,t){return Ap.__awaiter(void 0,void 0,void 0,function(){var r,n,o,i,s,u,c,d,f,v,y,p,m;return Ap.__generator(this,function(P){switch(P.label){case 0:return t.headers.get("Content-Type")?[4,t.blob()]:[3,2];case 1:return n=P.sent(),[3,4];case 2:return[4,Promise.resolve(void 0)];case 3:n=P.sent(),P.label=4;case 4:return r=n,o=t.method,i=t.headers,s=t.referrer,u=t.referrerPolicy,c=t.mode,d=t.credentials,f=t.cache,v=t.redirect,y=t.integrity,p=t.keepalive,m=t.signal,[2,new Request(e,{method:o,headers:i,body:r,referrer:s,referrerPolicy:u,mode:c,credentials:d,cache:f,redirect:v,integrity:y,keepalive:p,signal:m})]}})})},"cloneRequestWithNewUrl");Le.cloneRequestWithNewUrl=lv});var ji=b(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.AuthenticationHandlerOptions=void 0;var pv=(function(){function e(t,r){this.authenticationProvider=t,this.authenticationProviderOptions=r}return a(e,"AuthenticationHandlerOptions"),e})();Sn.AuthenticationHandlerOptions=pv});var Lt=b(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.TelemetryHandlerOptions=Mt.FeatureUsageFlag=void 0;var wp=pt(),Fi;(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"})(Fi||(Mt.FeatureUsageFlag=Fi={}));var dv=(function(){function e(){this.featureUsage=Fi.NONE}return a(e,"TelemetryHandlerOptions"),e.updateFeatureUsageFlag=function(t,r){var n;t.middlewareControl instanceof wp.MiddlewareControl?n=t.middlewareControl.getMiddlewareOptions(e):t.middlewareControl=new wp.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})();Mt.TelemetryHandlerOptions=dv});var wn=b(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.AuthenticationHandler=void 0;var $p=(de(),ce(pe)),Op=En(),fv=pt(),mv=Ut(),hv=ji(),Rp=Lt(),gv=(function(){function e(t){this.authenticationProvider=t}return a(e,"AuthenticationHandler"),e.prototype.execute=function(t){return $p.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u;return $p.__generator(this,function(c){switch(c.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Op.isGraphURL)(r)||t.customHosts&&(0,Op.isCustomHost)(r,t.customHosts)?(n=void 0,t.middlewareControl instanceof fv.MiddlewareControl&&(n=t.middlewareControl.getMiddlewareOptions(hv.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,mv.appendRequestHeader)(t.request,t.options,e.AUTHORIZATION_HEADER,u),Rp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Rp.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})();An.AuthenticationHandler=gv});var On=b($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.HTTPMessageHandler=void 0;var zp=(de(),ce(pe)),yv=(function(){function e(){}return a(e,"HTTPMessageHandler"),e.prototype.execute=function(t){return zp.__awaiter(this,void 0,void 0,function(){var r;return zp.__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})();$n.HTTPMessageHandler=yv});var xr=b(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.RetryHandlerOptions=void 0;var vv=(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})();Rn.RetryHandlerOptions=vv});var Dn=b(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.RetryHandler=void 0;var jt=(de(),ce(pe)),Vi=_r(),Pv=pt(),Dp=Ut(),kp=xr(),Cp=Lt(),_v=(function(){function e(t){t===void 0&&(t=new kp.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===Vi.RequestMethod.PUT||n===Vi.RequestMethod.PATCH||n===Vi.RequestMethod.POST;if(o){var i=(0,Dp.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 jt.__awaiter(this,void 0,void 0,function(){var r;return jt.__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 Pv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(this.options.constructor)),typeof r>"u"&&(r=Object.assign(new kp.RetryHandlerOptions,this.options)),r},e.prototype.executeWithRetry=function(t,r,n){return jt.__awaiter(this,void 0,void 0,function(){var o;return jt.__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,Dp.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 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),Cp.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Cp.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})();zn.RetryHandler=_v});var br=b(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.RedirectHandlerOptions=void 0;var xv=(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})();kn.RedirectHandlerOptions=xv});var Nn=b(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.RedirectHandler=void 0;var Ft=(de(),ce(pe)),bv=_r(),Tv=pt(),Ev=Ut(),Bi=br(),Np=Lt(),Iv=(function(){function e(t){t===void 0&&(t=new Bi.RedirectHandlerOptions),this.options=t}return a(e,"RedirectHandler"),e.prototype.isRedirect=function(t){return e.REDIRECT_STATUS_CODES.indexOf(t.status)!==-1},e.prototype.hasLocationHeader=function(t){return t.headers.has(e.LOCATION_HEADER)},e.prototype.getLocationHeader=function(t){return t.headers.get(e.LOCATION_HEADER)},e.prototype.isRelativeURL=function(t){return t.indexOf("://")===-1},e.prototype.shouldDropAuthorizationHeader=function(t,r){var n=/^[A-Za-z].+?:\/\/.+?(?=\/|$)/,o=n.exec(t),i,s;o!==null&&(i=o[0]);var u=n.exec(r);return u!==null&&(s=u[0]),typeof i<"u"&&typeof s<"u"&&i!==s},e.prototype.updateRequestUrl=function(t,r){return Ft.__awaiter(this,void 0,void 0,function(){var n,o;return Ft.__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,Ev.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 Tv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Bi.RedirectHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Bi.RedirectHandlerOptions,this.options)),r},e.prototype.executeWithRedirect=function(t,r,n){return Ft.__awaiter(this,void 0,void 0,function(){var o,i;return Ft.__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=bv.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 Ft.__awaiter(this,void 0,void 0,function(){var r,n;return Ft.__generator(this,function(o){switch(o.label){case 0:return r=0,n=this.getOptions(t),t.options.redirect=e.MANUAL_REDIRECT,Np.TelemetryHandlerOptions.updateFeatureUsageFlag(t,Np.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})();Cn.RedirectHandler=Iv});var Up=b(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.PACKAGE_VERSION=void 0;Un.PACKAGE_VERSION="3.0.7"});var jn=b(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.TelemetryHandler=void 0;var Mp=(de(),ce(pe)),Lp=En(),Sv=Up(),Av=pt(),Mn=Ut(),wv=Lt(),$v=(function(){function e(){}return a(e,"TelemetryHandler"),e.prototype.execute=function(t){return Mp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s;return Mp.__generator(this,function(u){switch(u.label){case 0:return r=typeof t.request=="string"?t.request:t.request.url,(0,Lp.isGraphURL)(r)||t.customHosts&&(0,Lp.isCustomHost)(r,t.customHosts)?(n=(0,Mn.getRequestHeader)(t.request,t.options,e.CLIENT_REQUEST_ID_HEADER),n||(n=(0,Mn.generateUUID)(),(0,Mn.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 Av.MiddlewareControl&&(i=t.middlewareControl.getMiddlewareOptions(wv.TelemetryHandlerOptions)),i&&(s=i.getFeatureUsage(),o+=" (".concat(e.FEATURE_USAGE_STRING,"=").concat(s,")")),(0,Mn.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})();Ln.TelemetryHandler=$v});var jp=b(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.MiddlewareFactory=void 0;var Ov=wn(),Rv=On(),zv=br(),Dv=xr(),kv=Nn(),Cv=Dn(),Nv=jn(),Uv=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),Mv=(function(){function e(){}return a(e,"MiddlewareFactory"),e.getDefaultMiddlewareChain=function(t){var r=[],n=new Ov.AuthenticationHandler(t),o=new Cv.RetryHandler(new Dv.RetryHandlerOptions),i=new Nv.TelemetryHandler,s=new Rv.HTTPMessageHandler;if(r.push(n),r.push(o),Uv()){var u=new kv.RedirectHandler(new zv.RedirectHandlerOptions);r.push(u)}return r.push(i),r.push(s),r},e})();Fn.MiddlewareFactory=Mv});var Bn=b(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ChaosStrategy=void 0;var Fp;(function(e){e[e.MANUAL=0]="MANUAL",e[e.RANDOM=1]="RANDOM"})(Fp||(Vn.ChaosStrategy=Fp={}))});var Hi=b(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ChaosHandlerOptions=void 0;var Lv=Bn(),jv=(function(){function e(t,r,n,o,i,s){if(t===void 0&&(t=Lv.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})();Hn.ChaosHandlerOptions=jv});var Vp=b(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.httpStatusCode=Vt.methodStatusCode=void 0;Vt.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]};Vt.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 Zp=b(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ChaosHandler=void 0;var Zn=(de(),ce(pe)),Fv=pt(),Vv=Ut(),Bp=Vp(),Zi=Hi(),Hp=Bn(),Bv=(function(){function e(t,r){t===void 0&&(t=new Zi.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=Bp.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,Vv.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 Zn.__awaiter(this,void 0,void 0,function(){return Zn.__generator(this,function(n){switch(n.label){case 0:return this.setStatusCode(t,r.request,r.options.method),t.chaosStrategy===Hp.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=Bp.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===Hp.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 Fv.MiddlewareControl&&(r=t.middlewareControl.getMiddlewareOptions(Zi.ChaosHandlerOptions)),typeof r>"u"&&(r=Object.assign(new Zi.ChaosHandlerOptions,this.options)),r},e.prototype.execute=function(t){return Zn.__awaiter(this,void 0,void 0,function(){var r;return Zn.__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})();qn.ChaosHandler=Bv});var Tr=b(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ResponseType=void 0;var qp;(function(e){e.ARRAYBUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.RAW="raw",e.STREAM="stream",e.TEXT="text"})(qp||(Gn.ResponseType=qp={}))});var Gi=b(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.GraphResponseHandler=Bt.DocumentType=void 0;var Wn=(de(),ce(pe)),yt=Tr(),qi;(function(e){e.TEXT_HTML="text/html",e.TEXT_XML="text/xml",e.APPLICATION_XML="application/xml",e.APPLICATION_XHTML="application/xhtml+xml"})(qi||(Bt.DocumentType=qi={}));var Kn;(function(e){e.TEXT_PLAIN="text/plain",e.APPLICATION_JSON="application/json"})(Kn||(Kn={}));var Xn;(function(e){e.DOCUMENT="^(text\\/(html|xml))|(application\\/(xml|xhtml\\+xml))$",e.IMAGE="^image\\/.+"})(Xn||(Xn={}));var Hv=(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 Wn.__awaiter(this,void 0,void 0,function(){var n,o,i,s;return Wn.__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,qi.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(Xn.DOCUMENT).test(s)?[4,e.parseDocumentResponse(t,s)]:[3,15]);case 14:return n=u.sent(),[3,21];case 15:return new RegExp(Xn.IMAGE).test(s)?(n=t.blob(),[3,21]):[3,16];case 16:return s!==Kn.TEXT_PLAIN?[3,18]:[4,t.text()];case 17:return n=u.sent(),[3,21];case 18:return s!==Kn.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 Wn.__awaiter(this,void 0,void 0,function(){var o;return Wn.__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})();Bt.GraphResponseHandler=Hv});var Wi=b(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Range=void 0;var Zv=(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})();Jn.Range=Zv});var Ki=b(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.UploadResult=void 0;var qv=(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})();Yn.UploadResult=qv});var Ji=b(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.LargeFileUploadTask=void 0;var ze=(de(),ce(pe)),Xi=Xe(),Gv=Gi(),Gp=Tr(),Qn=Wi(),Wv=Ki(),Kv=(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 Xi.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 Qn.Range(0,this.options.rangeSize-1)}return a(e,"LargeFileUploadTask"),e.createUploadSession=function(t,r,n,o){return o===void 0&&(o={}),ze.__awaiter(this,void 0,void 0,function(){var i,s;return ze.__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 Qn.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 Qn.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 Qn.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 Xi.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 ze.__awaiter(this,void 0,void 0,function(){var t,r,n,o,i,s,u;return ze.__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 Xi.GraphClientError("Something went wrong! Large file upload slice response is null.");return[4,Gv.GraphResponseHandler.getResponse(i)];case 4:return s=c.sent(),i.status===201||i.status===200&&s.id?(this.reportProgress(t,r),[2,Wv.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 ze.__awaiter(this,void 0,void 0,function(){return ze.__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 ze.__awaiter(this,void 0,void 0,function(){return ze.__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(Gp.ResponseType.RAW).put(t)];case 1:return[2,o.sent()]}})})},e.prototype.cancel=function(){return ze.__awaiter(this,void 0,void 0,function(){var t;return ze.__generator(this,function(r){switch(r.label){case 0:return[4,this.client.api(this.uploadSession.url).responseType(Gp.ResponseType.RAW).delete()];case 1:return t=r.sent(),t.status===204&&(this.uploadSession.isCancelled=!0),[2,t]}})})},e.prototype.getStatus=function(){return ze.__awaiter(this,void 0,void 0,function(){var t;return ze.__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 ze.__awaiter(this,void 0,void 0,function(){return ze.__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})();eo.LargeFileUploadTask=Kv});var Yi=b(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.FileUpload=void 0;var Xv=Xe(),Jv=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Xv.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})();to.FileUpload=Jv});var Qi=b(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.getValidRangeSize=void 0;var Yv=5*1024*1024,Qv=a(function(e){return e>320*1024&&(e=Math.floor(e/(320*1024))*320*1024),e},"roundTo320KB"),eP=a(function(e){e===void 0&&(e=Yv);var t=60*1024*1024;return e>t&&(e=t),Qv(e)},"getValidRangeSize");ro.getValidRangeSize=eP});var Kp=b(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.OneDriveLargeFileUploadTask=void 0;var Je=(de(),ce(pe)),Wp=Xe(),tP=Yi(),rP=Ji(),nP=Qi(),oP=(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 Wp.GraphClientError("Please provide the Graph client instance, file object and OneDriveLargeFileUploadOptions value");return i=o.fileName,s=t.getFileInfo(n,i),u=new tP.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 Wp.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,nP.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})(rP.LargeFileUploadTask);no.OneDriveLargeFileUploadTask=oP});var Jp=b(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.StreamUpload=void 0;var Xp=(de(),ce(pe)),Er=Xe(),iP=(function(){function e(t,r,n){if(this.content=t,this.name=r,this.size=n,!t||!r||!n)throw new Er.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 Xp.__awaiter(this,void 0,void 0,function(){var r,n,o,i,s,u,c;return Xp.__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 Er.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 Er.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 Er.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 Er.GraphClientError("Error encountered while reading the stream during the upload"))})})},e})();oo.StreamUpload=iP});var Yp=b(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.PageIterator=void 0;var Ht=(de(),ce(pe)),aP=(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 Ht.__awaiter(this,void 0,void 0,function(){var t,r;return Ht.__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 Ht.__awaiter(this,void 0,void 0,function(){var t;return Ht.__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 Ht.__awaiter(this,void 0,void 0,function(){return Ht.__generator(this,function(t){return[2,this.iterate()]})})},e.prototype.isComplete=function(){return this.complete},e})();io.PageIterator=aP});var ea=b(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CustomAuthenticationProvider=void 0;var ao=(de(),ce(pe)),Qp=Xe(),sP=(function(){function e(t){this.provider=t}return a(e,"CustomAuthenticationProvider"),e.prototype.getAccessToken=function(){return ao.__awaiter(this,void 0,void 0,function(){var t=this;return ao.__generator(this,function(r){return[2,new Promise(function(n,o){t.provider(function(i,s){return ao.__awaiter(t,void 0,void 0,function(){var u,c;return ao.__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 Qp.GraphClientError(u)),[4,Qp.GraphClientError.setGraphClientError(i)];case 2:c=d.sent(),o(c),d.label=3;case 3:return[2]}})})})})]})})},e})();so.CustomAuthenticationProvider=sP});var ta=b(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.GraphError=void 0;var uP=(de(),ce(pe)),cP=(function(e){uP.__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);uo.GraphError=cP});var td=b(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.GraphErrorHandler=void 0;var ed=(de(),ce(pe)),ra=ta(),lP=(function(){function e(){}return a(e,"GraphErrorHandler"),e.constructError=function(t,r,n){var o=new ra.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 ra.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),ed.__awaiter(this,void 0,void 0,function(){var i;return ed.__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 ra.GraphError(r),i.body=t),typeof n=="function")n(i,null);else return[2,i];return[2]})})},e})();co.GraphErrorHandler=lP});var na=b(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.GraphRequest=void 0;var ie=(de(),ce(pe)),pP=Xe(),dP=td(),Ir=En(),fP=Gi(),mP=pt(),vt=_r(),hP=Tr(),gP=(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=ie.__assign({},t.headers);if(this.config.fetchOptions!==void 0){var n=ie.__assign({},this.config.fetchOptions);Object.assign(t,n),typeof this.config.fetchOptions.headers!==void 0&&(t.headers=ie.__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 ie.__awaiter(this,void 0,void 0,function(){var i,s,u,c,d,f,v,y;return ie.__generator(this,function(p){switch(p.label){case 0:s=new mP.MiddlewareControl(this._middlewareOptions),this.updateRequestOptions(r),u=(o=this.config)===null||o===void 0?void 0:o.customHosts,p.label=1;case 1:return p.trys.push([1,4,,6]),[4,this.httpClient.sendRequest({request:t,options:r,middlewareControl:s,customHosts:u})];case 2:return c=p.sent(),i=c.response,[4,fP.GraphResponseHandler.getResponse(i,this._responseType,n)];case 3:return d=p.sent(),[2,d];case 4:if(f=p.sent(),f instanceof pP.GraphClientError)throw f;return v=void 0,i&&(v=i.status),[4,dP.GraphErrorHandler.getError(f,v,n,i)];case 5:throw y=p.sent(),y;case 6:return[2]}})})},e.prototype.setHeaderContentType=function(){if(!this._headers){this.header("Content-Type","application/json");return}for(var t=Object.keys(this._headers),r=0,n=t;r<n.length;r++){var o=n[r];if(o.toLowerCase()==="content-type")return}this.header("Content-Type","application/json")},e.prototype.header=function(t,r){return this._headers[t]=r,this},e.prototype.headers=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._headers[r]=t[r]);return this},e.prototype.option=function(t,r){return this._options[t]=r,this},e.prototype.options=function(t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(this._options[r]=t[r]);return this},e.prototype.middlewareOptions=function(t){return this._middlewareOptions=t,this},e.prototype.version=function(t){return this.urlComponents.version=t,this},e.prototype.responseType=function(t){return this._responseType=t,this},e.prototype.select=function(t){return this.addCsvQueryParameter("$select",t,arguments),this},e.prototype.expand=function(t){return this.addCsvQueryParameter("$expand",t,arguments),this},e.prototype.orderby=function(t){return this.addCsvQueryParameter("$orderby",t,arguments),this},e.prototype.filter=function(t){return this.urlComponents.oDataQueryParams.$filter=t,this},e.prototype.search=function(t){return this.urlComponents.oDataQueryParams.$search=t,this},e.prototype.top=function(t){return this.urlComponents.oDataQueryParams.$top=t,this},e.prototype.skip=function(t){return this.urlComponents.oDataQueryParams.$skip=t,this},e.prototype.skipToken=function(t){return this.urlComponents.oDataQueryParams.$skipToken=t,this},e.prototype.count=function(t){return t===void 0&&(t=!0),this.urlComponents.oDataQueryParams.$count=t.toString(),this},e.prototype.query=function(t){return this.parseQueryParameter(t)},e.prototype.get=function(t){return ie.__awaiter(this,void 0,void 0,function(){var r,n,o;return ie.__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 ie.__awaiter(this,void 0,void 0,function(){var n,o,i;return ie.__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 ie.__awaiter(this,void 0,void 0,function(){return ie.__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 ie.__awaiter(this,void 0,void 0,function(){var n,o;return ie.__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 ie.__awaiter(this,void 0,void 0,function(){var n,o;return ie.__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 ie.__awaiter(this,void 0,void 0,function(){return ie.__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 ie.__awaiter(this,void 0,void 0,function(){var r,n;return ie.__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 ie.__awaiter(this,void 0,void 0,function(){return ie.__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 ie.__awaiter(this,void 0,void 0,function(){var r,n;return ie.__generator(this,function(o){switch(o.label){case 0:return r=this.buildFullUrl(),n={method:vt.RequestMethod.GET},this.responseType(hP.ResponseType.STREAM),[4,this.send(r,n,t)];case 1:return[2,o.sent()]}})})},e.prototype.putStream=function(t,r){return ie.__awaiter(this,void 0,void 0,function(){var n,o;return ie.__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})();lo.GraphRequest=gP});var oa=b(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.HTTPClient=void 0;var rd=(de(),ce(pe)),yP=(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 rd.__awaiter(this,void 0,void 0,function(){var r;return rd.__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})();po.HTTPClient=yP});var od=b(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.HTTPClientFactory=void 0;var vP=(de(),ce(pe)),nd=oa(),PP=wn(),_P=On(),xP=br(),bP=xr(),TP=Nn(),EP=Dn(),IP=jn(),SP=a(function(){return typeof process=="object"&&typeof require=="function"},"isNodeEnvironment"),AP=(function(){function e(){}return a(e,"HTTPClientFactory"),e.createWithAuthenticationProvider=function(t){var r=new PP.AuthenticationHandler(t),n=new EP.RetryHandler(new bP.RetryHandlerOptions),o=new IP.TelemetryHandler,i=new _P.HTTPMessageHandler;if(r.setNext(n),SP()){var s=new TP.RedirectHandler(new xP.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(nd.HTTPClient.bind.apply(nd.HTTPClient,vP.__spreadArray([void 0],t,!1)))},e})();fo.HTTPClientFactory=AP});var id=b(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.validatePolyFilling=void 0;var wP=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");mo.validatePolyFilling=wP});var ud=b(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Client=void 0;var $P=(de(),ce(pe)),ad=Li(),OP=ea(),RP=na(),sd=oa(),zP=od(),DP=id(),kP=(function(){function e(t){this.config={baseUrl:ad.GRAPH_BASE_URL,debugLogging:!1,defaultVersion:ad.GRAPH_API_VERSION},(0,DP.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=zP.HTTPClientFactory.createWithAuthenticationProvider(t.authProvider);else if(t.middleware!==void 0)n=new(sd.HTTPClient.bind.apply(sd.HTTPClient,$P.__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 OP.CustomAuthenticationProvider(t[n]):t[n]);return e.initWithMiddleware(r)},e.initWithMiddleware=function(t){return new e(t)},e.prototype.api=function(t){return new RP.GraphRequest(this.httpClient,this.config,t)},e})();ho.Client=kP});var ae=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 CP=Ep();Object.defineProperty(R,"BatchRequestContent",{enumerable:!0,get:a(function(){return CP.BatchRequestContent},"get")});var NP=Ip();Object.defineProperty(R,"BatchResponseContent",{enumerable:!0,get:a(function(){return NP.BatchResponseContent},"get")});var UP=wn();Object.defineProperty(R,"AuthenticationHandler",{enumerable:!0,get:a(function(){return UP.AuthenticationHandler},"get")});var MP=On();Object.defineProperty(R,"HTTPMessageHandler",{enumerable:!0,get:a(function(){return MP.HTTPMessageHandler},"get")});var LP=Dn();Object.defineProperty(R,"RetryHandler",{enumerable:!0,get:a(function(){return LP.RetryHandler},"get")});var jP=Nn();Object.defineProperty(R,"RedirectHandler",{enumerable:!0,get:a(function(){return jP.RedirectHandler},"get")});var FP=jn();Object.defineProperty(R,"TelemetryHandler",{enumerable:!0,get:a(function(){return FP.TelemetryHandler},"get")});var VP=jp();Object.defineProperty(R,"MiddlewareFactory",{enumerable:!0,get:a(function(){return VP.MiddlewareFactory},"get")});var BP=ji();Object.defineProperty(R,"AuthenticationHandlerOptions",{enumerable:!0,get:a(function(){return BP.AuthenticationHandlerOptions},"get")});var HP=xr();Object.defineProperty(R,"RetryHandlerOptions",{enumerable:!0,get:a(function(){return HP.RetryHandlerOptions},"get")});var ZP=br();Object.defineProperty(R,"RedirectHandlerOptions",{enumerable:!0,get:a(function(){return ZP.RedirectHandlerOptions},"get")});var cd=Lt();Object.defineProperty(R,"FeatureUsageFlag",{enumerable:!0,get:a(function(){return cd.FeatureUsageFlag},"get")});Object.defineProperty(R,"TelemetryHandlerOptions",{enumerable:!0,get:a(function(){return cd.TelemetryHandlerOptions},"get")});var qP=Hi();Object.defineProperty(R,"ChaosHandlerOptions",{enumerable:!0,get:a(function(){return qP.ChaosHandlerOptions},"get")});var GP=Bn();Object.defineProperty(R,"ChaosStrategy",{enumerable:!0,get:a(function(){return GP.ChaosStrategy},"get")});var WP=Zp();Object.defineProperty(R,"ChaosHandler",{enumerable:!0,get:a(function(){return WP.ChaosHandler},"get")});var KP=Ji();Object.defineProperty(R,"LargeFileUploadTask",{enumerable:!0,get:a(function(){return KP.LargeFileUploadTask},"get")});var XP=Kp();Object.defineProperty(R,"OneDriveLargeFileUploadTask",{enumerable:!0,get:a(function(){return XP.OneDriveLargeFileUploadTask},"get")});var JP=Qi();Object.defineProperty(R,"getValidRangeSize",{enumerable:!0,get:a(function(){return JP.getValidRangeSize},"get")});var YP=Jp();Object.defineProperty(R,"StreamUpload",{enumerable:!0,get:a(function(){return YP.StreamUpload},"get")});var QP=Yi();Object.defineProperty(R,"FileUpload",{enumerable:!0,get:a(function(){return QP.FileUpload},"get")});var e_=Ki();Object.defineProperty(R,"UploadResult",{enumerable:!0,get:a(function(){return e_.UploadResult},"get")});var t_=Wi();Object.defineProperty(R,"Range",{enumerable:!0,get:a(function(){return t_.Range},"get")});var r_=Yp();Object.defineProperty(R,"PageIterator",{enumerable:!0,get:a(function(){return r_.PageIterator},"get")});var n_=ud();Object.defineProperty(R,"Client",{enumerable:!0,get:a(function(){return n_.Client},"get")});var o_=ea();Object.defineProperty(R,"CustomAuthenticationProvider",{enumerable:!0,get:a(function(){return o_.CustomAuthenticationProvider},"get")});var i_=ta();Object.defineProperty(R,"GraphError",{enumerable:!0,get:a(function(){return i_.GraphError},"get")});var a_=Xe();Object.defineProperty(R,"GraphClientError",{enumerable:!0,get:a(function(){return a_.GraphClientError},"get")});var s_=na();Object.defineProperty(R,"GraphRequest",{enumerable:!0,get:a(function(){return s_.GraphRequest},"get")});var u_=Tr();Object.defineProperty(R,"ResponseType",{enumerable:!0,get:a(function(){return u_.ResponseType},"get")})});var Zt=b((sa,ua)=>{(function(e,t){typeof sa=="object"&&typeof ua<"u"?ua.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(sa,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",s="hour",u="day",c="week",d="month",f="quarter",v="year",y="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,P=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(L){var $=["th","st","nd","rd"],I=L%100;return"["+L+($[(I-20)%10]||$[I]||$[0])+"]"},"ordinal")},x=a(function(L,$,I){var D=String(L);return!D||D.length>=$?L:""+Array($+1-D.length).join(I)+L},"m"),E={s:x,z:a(function(L){var $=-L.utcOffset(),I=Math.abs($),D=Math.floor(I/60),w=I%60;return($<=0?"+":"-")+x(D,2,"0")+":"+x(w,2,"0")},"z"),m:a(function L($,I){if($.date()<I.date())return-L(I,$);var D=12*(I.year()-$.year())+(I.month()-$.month()),w=$.clone().add(D,d),W=I-w<0,K=$.clone().add(D+(W?-1:1),d);return+(-(D+(I-w)/(W?w-K:K-w))||0)},"t"),a:a(function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},"a"),p:a(function(L){return{M:d,y:v,w:c,d:u,D:y,h:s,m:i,s:o,ms:n,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(L){return L===void 0},"u")},q="en",he={};he[q]=h;var we=a(function(L){return L instanceof $e},"p"),De=a(function L($,I,D){var w;if(!$)return q;if(typeof $=="string"){var W=$.toLowerCase();he[W]&&(w=W),I&&(he[W]=I,w=W);var K=$.split("-");if(!w&&K.length>1)return L(K[0])}else{var ne=$.name;he[ne]=$,w=ne}return!D&&w&&(q=w),w||!D&&q},"t"),ve=a(function(L,$){if(we(L))return L.clone();var I=typeof $=="object"?$:{};return I.date=L,I.args=arguments,new $e(I)},"w"),X=E;X.l=De,X.i=we,X.w=function(L,$){return ve(L,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var $e=(function(){function L(I){this.$L=De(I.locale,null,!0),this.parse(I)}a(L,"M");var $=L.prototype;return $.parse=function(I){this.$d=(function(D){var w=D.date,W=D.utc;if(w===null)return new Date(NaN);if(X.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var K=w.match(m);if(K){var ne=K[2]-1||0,ge=(K[7]||"0").substring(0,3);return W?new Date(Date.UTC(K[1],ne,K[3]||1,K[4]||0,K[5]||0,K[6]||0,ge)):new Date(K[1],ne,K[3]||1,K[4]||0,K[5]||0,K[6]||0,ge)}}return new Date(w)})(I),this.$x=I.x||{},this.init()},$.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},$.$utils=function(){return X},$.isValid=function(){return this.$d.toString()!==p},$.isSame=function(I,D){var w=ve(I);return this.startOf(D)<=w&&w<=this.endOf(D)},$.isAfter=function(I,D){return ve(I)<this.startOf(D)},$.isBefore=function(I,D){return this.endOf(D)<ve(I)},$.$g=function(I,D,w){return X.u(I)?this[D]:this.set(w,I)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(I,D){var w=this,W=!!X.u(D)||D,K=X.p(I),ne=a(function(ft,Oe){var Qe=X.w(w.$u?Date.UTC(w.$y,Oe,ft):new Date(w.$y,Oe,ft),w);return W?Qe:Qe.endOf(u)},"l"),ge=a(function(ft,Oe){return X.w(w.toDate()[ft].apply(w.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(Oe)),w)},"$"),xe=this.$W,Ee=this.$M,Ne=this.$D,Pt="set"+(this.$u?"UTC":"");switch(K){case v:return W?ne(1,0):ne(31,11);case d:return W?ne(1,Ee):ne(0,Ee+1);case c:var dt=this.$locale().weekStart||0,qt=(xe<dt?xe+7:xe)-dt;return ne(W?Ne-qt:Ne+(6-qt),Ee);case u:case y:return ge(Pt+"Hours",0);case s:return ge(Pt+"Minutes",1);case i:return ge(Pt+"Seconds",2);case o:return ge(Pt+"Milliseconds",3);default:return this.clone()}},$.endOf=function(I){return this.startOf(I,!1)},$.$set=function(I,D){var w,W=X.p(I),K="set"+(this.$u?"UTC":""),ne=(w={},w[u]=K+"Date",w[y]=K+"Date",w[d]=K+"Month",w[v]=K+"FullYear",w[s]=K+"Hours",w[i]=K+"Minutes",w[o]=K+"Seconds",w[n]=K+"Milliseconds",w)[W],ge=W===u?this.$D+(D-this.$W):D;if(W===d||W===v){var xe=this.clone().set(y,1);xe.$d[ne](ge),xe.init(),this.$d=xe.set(y,Math.min(this.$D,xe.daysInMonth())).$d}else ne&&this.$d[ne](ge);return this.init(),this},$.set=function(I,D){return this.clone().$set(I,D)},$.get=function(I){return this[X.p(I)]()},$.add=function(I,D){var w,W=this;I=Number(I);var K=X.p(D),ne=a(function(Ee){var Ne=ve(W);return X.w(Ne.date(Ne.date()+Math.round(Ee*I)),W)},"y");if(K===d)return this.set(d,this.$M+I);if(K===v)return this.set(v,this.$y+I);if(K===u)return ne(1);if(K===c)return ne(7);var ge=(w={},w[i]=t,w[s]=r,w[o]=e,w)[K]||1,xe=this.$d.getTime()+I*ge;return X.w(xe,this)},$.subtract=function(I,D){return this.add(-1*I,D)},$.format=function(I){var D=this,w=this.$locale();if(!this.isValid())return w.invalidDate||p;var W=I||"YYYY-MM-DDTHH:mm:ssZ",K=X.z(this),ne=this.$H,ge=this.$m,xe=this.$M,Ee=w.weekdays,Ne=w.months,Pt=w.meridiem,dt=a(function(Oe,Qe,Gt,kr){return Oe&&(Oe[Qe]||Oe(D,W))||Gt[Qe].slice(0,kr)},"h"),qt=a(function(Oe){return X.s(ne%12||12,Oe,"0")},"d"),ft=Pt||function(Oe,Qe,Gt){var kr=Oe<12?"AM":"PM";return Gt?kr.toLowerCase():kr};return W.replace(P,(function(Oe,Qe){return Qe||(function(Gt){switch(Gt){case"YY":return String(D.$y).slice(-2);case"YYYY":return X.s(D.$y,4,"0");case"M":return xe+1;case"MM":return X.s(xe+1,2,"0");case"MMM":return dt(w.monthsShort,xe,Ne,3);case"MMMM":return dt(Ne,xe);case"D":return D.$D;case"DD":return X.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return dt(w.weekdaysMin,D.$W,Ee,2);case"ddd":return dt(w.weekdaysShort,D.$W,Ee,3);case"dddd":return Ee[D.$W];case"H":return String(ne);case"HH":return X.s(ne,2,"0");case"h":return qt(1);case"hh":return qt(2);case"a":return ft(ne,ge,!0);case"A":return ft(ne,ge,!1);case"m":return String(ge);case"mm":return X.s(ge,2,"0");case"s":return String(D.$s);case"ss":return X.s(D.$s,2,"0");case"SSS":return X.s(D.$ms,3,"0");case"Z":return K}return null})(Oe)||K.replace(":","")}))},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(I,D,w){var W,K=this,ne=X.p(D),ge=ve(I),xe=(ge.utcOffset()-this.utcOffset())*t,Ee=this-ge,Ne=a(function(){return X.m(K,ge)},"D");switch(ne){case v:W=Ne()/12;break;case d:W=Ne();break;case f:W=Ne()/3;break;case c:W=(Ee-xe)/6048e5;break;case u:W=(Ee-xe)/864e5;break;case s:W=Ee/r;break;case i:W=Ee/t;break;case o:W=Ee/e;break;default:W=Ee}return w?W:X.a(W)},$.daysInMonth=function(){return this.endOf(d).$D},$.$locale=function(){return he[this.$L]},$.locale=function(I,D){if(!I)return this.$L;var w=this.clone(),W=De(I,D,!0);return W&&(w.$L=W),w},$.clone=function(){return X.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},L})(),Dr=$e.prototype;return ve.prototype=Dr,[["$ms",n],["$s",o],["$m",i],["$H",s],["$W",u],["$M",d],["$y",v],["$D",y]].forEach((function(L){Dr[L[1]]=function($){return this.$g($,L[0],L[1])}})),ve.extend=function(L,$){return L.$i||(L($,$e,ve),L.$i=!0),ve},ve.locale=De,ve.isDayjs=we,ve.unix=function(L){return ve(1e3*L)},ve.en=he[q],ve.Ls=he,ve.p={},ve}))});var y_={};So(y_,{microsoftSharePoint:()=>g_});module.exports=ce(y_);var sf=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 Ve=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cr=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ao={};function He(e){return e&&Object.assign(Ao,e),Ao}a(He,"config");function $o(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($o,"getEnumValues");function fa(e,t){return typeof t=="bigint"?t.toString():t}a(fa,"jsonStringifyReplacer");function Ur(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Ur,"cached");function ma(e){return e==null}a(ma,"nullish");function Mr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}a(Mr,"cleanRegex");var da=Symbol("evaluating");function Pe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==da)return n===void 0&&(n=da,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}a(Pe,"defineLazy");var Oo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(Kt,"isObject");var uf=Ur(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ha(e){if(Kt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Kt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(ha,"isPlainObject");var ga=new Set(["string","number","symbol"]);function _t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(_t,"escapeRegex");function Lr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}a(Lr,"clone");function se(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(se,"normalizeParams");function ya(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(ya,"optionalKeys");var va={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 xt(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(xt,"aborted");function et(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}a(et,"prefixIssues");function Nr(e){return typeof e=="string"?e:e?.message}a(Nr,"unwrapMessage");function tt(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Nr(e.inst?._zod.def?.error?.(e))??Nr(t?.error?.(e))??Nr(r.customError?.(e))??Nr(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}a(tt,"finalizeIssue");function Pa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Pa,"getLengthableOrigin");function Ro(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}a(Ro,"issue");var _a=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,fa,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),xa=z("$ZodError",_a),Xt=z("$ZodError",_a,{Parent:Error});var lf=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 Ve;if(s.issues.length){let u=new(o?.Err??e)(s.issues.map(c=>tt(c,i,He())));throw Oo(u,o?.callee),u}return s.value},"_parse"),jr=lf(Xt),pf=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=>tt(c,i,He())));throw Oo(u,o?.callee),u}return s.value},"_parseAsync"),Fr=pf(Xt),df=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 Ve;return i.issues.length?{success:!1,error:new(e??xa)(i.issues.map(s=>tt(s,o,He())))}:{success:!0,data:i.value}},"_safeParse"),Jt=df(Xt),ff=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=>tt(s,o,He())))}:{success:!0,data:i.value}},"_safeParseAsync"),Yt=ff(Xt);var mf="(?:(?:\\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])))",hf=new RegExp(`^${mf}$`);var ba=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Ta=/^-?\d+n?$/,Ea=/^-?\d+$/,zo=/^-?\d+(?:\.\d+)?$/,Ia=/^(?:true|false)$/i;var rt=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),gf={number:"number",bigint:"bigint",object:"date"};var Sa=z("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);let r=gf[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 Aa=z("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=va[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=Ea)}),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 wa=z("$ZodCheckMinLength",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!ma(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=Pa(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Do=z("$ZodCheckStringFormat",(e,t)=>{var r,n;rt.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=()=>{})}),$a=z("$ZodCheckRegex",(e,t)=>{Do.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 Ra={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=Ra;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=xt(s),f;for(let v of u){if(v._zod.def.when){if(!v._zod.def.when(s))continue}else if(d)continue;let y=s.issues.length,p=v._zod.check(s);if(p instanceof Promise&&c?.async===!1)throw new Ve;if(f||p instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await p,s.issues.length!==y&&(d||(d=xt(s,y)))});else{if(s.issues.length===y)continue;d||(d=xt(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,c)=>{if(xt(s))return s.aborted=!0,s;let d=o(u,n,c);if(d instanceof Promise){if(c.async===!1)throw new Ve;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 Ve;return c.then(d=>o(d,n,u))}return o(c,n,u)}}Pe(e,"~standard",()=>({validate:a(o=>{try{let i=Jt(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Yt(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Hr=z("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ba(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}}),ko=z("$ZodStringFormat",(e,t)=>{Do.init(e,t),Hr.init(e,t)});var Na=z("$ZodURL",(e,t)=>{ko.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 Co=z("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??zo,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}}),Ua=z("$ZodNumberFormat",(e,t)=>{Aa.init(e,t),Co.init(e,t)}),No=z("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=Ia,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}}),Ma=z("$ZodBigInt",(e,t)=>{fe.init(e,t),e._zod.pattern=Ta,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 La=z("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r}),ja=z("$ZodUnknown",(e,t)=>{fe.init(e,t),e._zod.parse=r=>r});var Fa=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}}),Va=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 za(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues)),t.value[r]=e.value}a(za,"handleArrayResult");var Ba=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=>za(d,r,s))):za(c,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Br(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...et(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}a(Br,"handlePropertyResult");function yf(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=ya(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}a(yf,"normalizeDef");function vf(e,t,r,n,o,i){let s=[],u=o.keySet,c=o.catchall._zod,d=c.def.type,f=c.optout==="optional";for(let v in t){if(u.has(v))continue;if(d==="never"){s.push(v);continue}let y=c.run({value:t[v],issues:[]},n);y instanceof Promise?e.push(y.then(p=>Br(p,r,v,t,f))):Br(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(vf,"handleCatchall");var Ha=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=Ur(()=>yf(t));Pe(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=Kt,i=t.catchall,s;e._zod.parse=(u,c)=>{s??(s=n.value);let d=u.value;if(!o(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value={};let f=[],v=s.shape;for(let y of s.keys){let p=v[y],m=p._zod.optout==="optional",P=p._zod.run({value:d[y],issues:[]},c);P instanceof Promise?f.push(P.then(h=>Br(h,u,y,d,m))):Br(P,u,y,d,m)}return i?vf(f,d,u,c,n.value,e):f.length?Promise.all(f).then(()=>u):u}});function Da(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=>!xt(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=>tt(s,n,He())))}),t)}a(Da,"handleUnionResults");var Uo=z("$ZodUnion",(e,t)=>{fe.init(e,t),Pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Pe(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=>Mr(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=>Da(c,o,e,i)):Da(u,o,e,i)}});var Za=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Uo.init(e,t);let r=e._zod.parse;Pe(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=Ur(()=>{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(!Kt(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 qa=z("$ZodRecord",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!ha(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(...et(d,v.issues)),r.value[d]=v.value})):(f.issues.length&&r.issues.push(...et(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"&&zo.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=>tt(v,n,He())),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(...et(u,v.issues)),r.value[c.value]=v.value})):(f.issues.length&&r.issues.push(...et(u,f.issues)),r.value[c.value]=f.value)}}return i.length?Promise.all(i).then(()=>r):r}});var Ga=z("$ZodEnum",(e,t)=>{fe.init(e,t);let r=$o(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>ga.has(typeof o)).map(o=>typeof o=="string"?_t(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}}),Wa=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"?_t(n):n?_t(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 Ka=z("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Cr(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 Ve;return r.value=o,r}});function ka(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(ka,"handleOptionalResult");var Xa=z("$ZodOptional",(e,t)=>{fe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(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=>ka(i,r.value)):ka(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Ja=z("$ZodNullable",(e,t)=>{fe.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mr(r.source)}|null)$`):void 0}),Pe(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 Ya=z("$ZodPipe",(e,t)=>{fe.init(e,t),Pe(e._zod,"values",()=>t.in._zod.values),Pe(e._zod,"optin",()=>t.in._zod.optin),Pe(e._zod,"optout",()=>t.out._zod.optout),Pe(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=>Vr(s,t.in,n)):Vr(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>Vr(i,t.out,n)):Vr(o,t.out,n)}});function Vr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}a(Vr,"handlePipeResult");var Qa=z("$ZodCustom",(e,t)=>{rt.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=>Ca(i,r,n,e));Ca(o,r,n,e)}});function Ca(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ro(o))}}a(Ca,"handleRefineResult");var ts;var Mo=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 rs(){return new Mo}a(rs,"registry");(ts=globalThis).__zod_globalRegistry??(ts.__zod_globalRegistry=rs());var Lo=globalThis.__zod_globalRegistry;function ns(e,t){return new e({type:"string",...se(t)})}a(ns,"_string");function os(e,t){return new e({type:"string",coerce:!0,...se(t)})}a(os,"_coercedString");function is(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...se(t)})}a(is,"_url");function as(e,t){return new e({type:"number",checks:[],...se(t)})}a(as,"_number");function ss(e,t){return new e({type:"number",coerce:!0,checks:[],...se(t)})}a(ss,"_coercedNumber");function us(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...se(t)})}a(us,"_int");function cs(e,t){return new e({type:"boolean",...se(t)})}a(cs,"_boolean");function ls(e,t){return new e({type:"boolean",coerce:!0,...se(t)})}a(ls,"_coercedBoolean");function ps(e,t){return new e({type:"bigint",coerce:!0,...se(t)})}a(ps,"_coercedBigint");function ds(e){return new e({type:"any"})}a(ds,"_any");function fs(e){return new e({type:"unknown"})}a(fs,"_unknown");function ms(e,t){return new e({type:"void",...se(t)})}a(ms,"_void");function hs(e,t){return new e({type:"date",coerce:!0,...se(t)})}a(hs,"_coercedDate");function Zr(e,t){return new Sa({check:"greater_than",...se(t),value:e,inclusive:!0})}a(Zr,"_gte");function je(e,t){return new wa({check:"min_length",...se(t),minimum:e})}a(je,"_minLength");function nt(e,t){return new $a({check:"string_format",format:"regex",...se(t),pattern:e})}a(nt,"_regex");function gs(e,t,r){let n=se(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}a(gs,"_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)=>jr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Jt(e,r,n),e.parseAsync=async(r,n)=>Fr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Yt(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)=>Lr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Gr=z("ZodMiniString",(e,t)=>{Hr.init(e,t),_e.init(e,t)});function l(e){return ns(Gr,e)}a(l,"string");var ys=z("ZodMiniStringFormat",(e,t)=>{ko.init(e,t),Gr.init(e,t)});var Rf=z("ZodMiniURL",(e,t)=>{Na.init(e,t),ys.init(e,t)});function vs(e){return is(Rf,e)}a(vs,"url");var Wr=z("ZodMiniNumber",(e,t)=>{Co.init(e,t),_e.init(e,t)});function be(e){return as(Wr,e)}a(be,"number");var zf=z("ZodMiniNumberFormat",(e,t)=>{Ua.init(e,t),Wr.init(e,t)});function Ps(e){return us(zf,e)}a(Ps,"int");var jo=z("ZodMiniBoolean",(e,t)=>{No.init(e,t),_e.init(e,t)});function ee(e){return cs(jo,e)}a(ee,"boolean");var _s=z("ZodMiniBigInt",(e,t)=>{Ma.init(e,t),_e.init(e,t)});var Df=z("ZodMiniAny",(e,t)=>{La.init(e,t),_e.init(e,t)});function er(){return ds(Df)}a(er,"any");var kf=z("ZodMiniUnknown",(e,t)=>{ja.init(e,t),_e.init(e,t)});function B(){return fs(kf)}a(B,"unknown");var Cf=z("ZodMiniVoid",(e,t)=>{Fa.init(e,t),_e.init(e,t)});function xs(e){return ms(Cf,e)}a(xs,"_void");var bs=z("ZodMiniDate",(e,t)=>{Va.init(e,t),_e.init(e,t)});var Nf=z("ZodMiniArray",(e,t)=>{Ba.init(e,t),_e.init(e,t)});function U(e,t){return new Nf({type:"array",element:e,...se(t)})}a(U,"array");var Uf=z("ZodMiniObject",(e,t)=>{Ha.init(e,t),_e.init(e,t),Pe(e,"shape",()=>t.shape)});function g(e,t){let r={type:"object",shape:e??{},...se(t)};return new Uf(r)}a(g,"object");var Mf=z("ZodMiniUnion",(e,t)=>{Uo.init(e,t),_e.init(e,t)});function G(e,t){return new Mf({type:"union",options:e,...se(t)})}a(G,"union");var Lf=z("ZodMiniDiscriminatedUnion",(e,t)=>{Za.init(e,t),_e.init(e,t)});function ot(e,t,r){return new Lf({type:"union",options:t,discriminator:e,...se(r)})}a(ot,"discriminatedUnion");var jf=z("ZodMiniRecord",(e,t)=>{qa.init(e,t),_e.init(e,t)});function H(e,t,r){return new jf({type:"record",keyType:e,valueType:t,...se(r)})}a(H,"record");var Ff=z("ZodMiniEnum",(e,t)=>{Ga.init(e,t),_e.init(e,t),e.options=Object.values(t.entries)});function N(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ff({type:"enum",entries:r,...se(t)})}a(N,"_enum");var Vf=z("ZodMiniLiteral",(e,t)=>{Wa.init(e,t),_e.init(e,t)});function C(e,t){return new Vf({type:"literal",values:Array.isArray(e)?e:[e],...se(t)})}a(C,"literal");var Bf=z("ZodMiniTransform",(e,t)=>{Ka.init(e,t),_e.init(e,t)});function it(e){return new Bf({type:"transform",transform:e})}a(it,"transform");var Hf=z("ZodMiniOptional",(e,t)=>{Xa.init(e,t),_e.init(e,t)});function _(e){return new Hf({type:"optional",innerType:e})}a(_,"optional");var Zf=z("ZodMiniNullable",(e,t)=>{Ja.init(e,t),_e.init(e,t)});function tr(e){return new Zf({type:"nullable",innerType:e})}a(tr,"nullable");var qf=z("ZodMiniPipe",(e,t)=>{Ya.init(e,t),_e.init(e,t)});function at(e,t){return new qf({type:"pipe",in:e,out:t})}a(at,"pipe");var Gf=z("ZodMiniCustom",(e,t)=>{Qa.init(e,t),_e.init(e,t)});function Kr(e,t){return gs(Gf,e??(()=>!0),t)}a(Kr,"custom");var rr={};So(rr,{bigint:()=>Qf,boolean:()=>Yf,date:()=>em,number:()=>Jf,string:()=>Xf});function Xf(e){return os(Gr,e)}a(Xf,"string");function Jf(e){return ss(Wr,e)}a(Jf,"number");function Yf(e){return ls(jo,e)}a(Yf,"boolean");function Qf(e){return ps(_s,e)}a(Qf,"bigint");function em(e){return hs(bs,e)}a(em,"date");var Vo=g({retryOnFailure:g({defaultValue:_(ee()),hide:_(ee())}),continueOnFailure:g({defaultValue:_(ee()),hide:_(ee())})}),Fo=class{constructor(t,r,n,o,i,s,u,c,d,f,v,y,p){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=i;this.run=s;this.test=u;this.requireAuth=c;this.errorHandlingOptions=d;this.outputSchema=f;this.audience=v;this.aiMetadata=y;this.classification=p}static{a(this,"IAction")}},re=a(e=>new Fo(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var Y=g({displayName:l(),description:_(l()),advanced:_(ee()),width:_(N(["half","full"])),icon:_(l()),placeholder:_(l())}),Z=a((e,t)=>g({type:C(t),required:ee(),defaultValue:_(er())}),"TPropertyValue");var ke=g({...Y.shape,...Z(l(),"SHORT_TEXT").shape}),Ze=g({...Y.shape,...Z(l(),"LONG_TEXT").shape});var Es=g({label:l(),value:B(),description:_(l()),icon:_(l())}),Xr=g({disabled:_(ee()),placeholder:_(l()),options:U(Es)});var rm=N(["cards"]),Ce=g({...Y.shape,options:Xr,display:_(rm),...Z(B(),"STATIC_DROPDOWN").shape}),qe=g({...Y.shape,options:Xr,...Z(U(B()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Bo=g({...Y.shape,...Z(B(),"DROPDOWN").shape,refreshers:U(l())}),nr=g({...Y.shape,...Z(U(B()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(l())});var Ge=g({...Y.shape,reveals:_(U(l())),...Z(ee(),"CHECKBOX").shape});var We=g({...Y.shape,display:_(N(["stepper"])),min:_(be()),max:_(be()),step:_(be()),...Z(be(),"NUMBER").shape});var or=g({...Y.shape,streaming:_(ee()),...Z(B(),"FILE").shape});var ir=g({...Y.shape,...Z(l(),"DATE_TIME").shape});var Is=H(l(),G([ke,Ze,Ce,nr,qe,Ge,We,or,ir])),ar=g({...Y.shape,properties:Is,...Z(U(B()),"ARRAY").shape});var Ss=N(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),As=g({preset:_(Ss),after:_(l()),before:_(l())}),Ho=g({...Y.shape,display:_(N(["dropdown"])),...Z(As,"DATE_RANGE").shape});var sr=g({...Y.shape,...Z(G([H(l(),B())]),"JSON").shape});var ws=G([ke,Ce,sr,ar,qe]),nm=H(l(),ws),Zo=g({refreshers:U(l()),...Y.shape,...Z(B(),"DYNAMIC").shape});var Jr=g({...Y.shape,...Z(xs(),"MARKDOWN").shape});var ur=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ur||{}),bt=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(bt||{}),Tt=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Tt||{});var cr=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(cr||{}),qo="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||{}),lr=(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))(lr||{}),om=g({strategy:N(lr),paramName:_(l())}),pr=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(pr||{});var Yr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Yr||{}),$s=g({status:_(be()),body:_(B()),headers:_(H(l(),l()))}),Os=g({type:C("DELAY"),resumeDateTime:l(),requestIdToReply:_(l()),handlerId:_(l()),streamStepProgress:_(N(Yr))}),Rs=g({type:C("WEBHOOK"),requestId:l(),requestIdToReply:_(l()),response:$s,handlerId:_(l()),streamStepProgress:_(N(Yr))}),im=G([Os,Rs]);var am=g({body:B(),rawBody:_(B()),headers:H(l(),l()),queryParams:H(l(),l())});function ye(e){return e==null}a(ye,"isNil");function dr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(dr,"isEmpty");function Qr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(Qr,"assertNotNullOrUndefined");var Go=Q(require("crypto"),1);var sm=128,st,Et,um=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!st||st.length<e?(st=Buffer.allocUnsafe(e*sm),Go.default.randomFillSync(st),Et=0):Et+e>st.length&&(Go.default.randomFillSync(st),Et=0)}catch(t){throw st=void 0,t}Et+=e},"fillPool"),cm=a(e=>(um(e|=0),st.subarray(Et-e,Et)),"random"),lm=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)=>{if(i<=0)return"";let s="";for(;;){let u=r(o),c=o;for(;c--;)if(s+=e[u[c]&n]||"",s.length===i)return s}}},"customRandom"),Ds=a((e,t=21)=>lm(e,t,cm),"customAlphabet");var pm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ks=21,tO=l().check(nt(new RegExp(`^[0-9a-zA-Z]{${ks}}$`))),dm=Ds(pm,ks);var ut=at(it(e=>e instanceof Date?e.toISOString():e),l()),Ue={id:l(),created:ut,updated:ut},le=a(e=>_(tr(e)),"Nullable");function Wo(e){return _(tr(N(e)))}a(Wo,"NullableEnum");var oO=at(it(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),_(ee())),en=a(e=>at(it(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),_(U(e))),"OptionalArrayFromQuery");var sO=H(l(),B());var It=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h.XAI="xai",h.DEEPSEEK="deepseek",h.ZAI="zai",h.QWEN="qwen",h.MINIMAX="minimax",h.MOONSHOT="moonshot",h))(It||{});var PO=l().check(nt(/^#[0-9A-Fa-f]{6}$/));var xO=g({filename:l(),data:B(),type:C("file"),mimetype:_(l())});var fm=Q(Ns());var wO=g({...Ue,name:l(),permissions:U(l()),platformId:le(l()),type:l(),userCount:_(be())});var Us=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Us||{}),Ko=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ko||{}),Xo=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Xo||{});var Jo=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Jo||{});var Yo=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Yo||{});var mm=g({mode:N(Us),value:B()}),hm=g({auth:_(l()),fields:H(l(),mm)}),gm=g({pieceName:l(),pieceVersion:l(),actionName:l(),predefinedInput:_(hm)}),ym=g({type:C("PIECE"),toolName:l().check(je(1)),pieceMetadata:gm}),vm=g({type:C("none")}),Pm=g({type:C("access_token"),accessToken:l()}),_m=g({type:C("api_key"),apiKey:l(),apiKeyHeader:l()}),xm=g({type:C("headers"),headers:H(l(),l())}),bm=ot("type",[vm,Pm,_m,xm]),Ms=g({type:C("FLOW"),toolName:l().check(je(1)),externalFlowId:l(),flowDisplayName:_(l())}),Ls=g({type:C("MCP"),toolName:l().check(je(1)),serverUrl:vs(),protocol:N(Xo),auth:bm}),js=g({type:C("KNOWLEDGE_BASE"),toolName:l().check(je(1)),sourceType:N(Ko),sourceId:l(),sourceName:l()}),Tm=ot("type",[ym,Ms,Ls,js]),Em=g({displayName:l(),description:_(l()),type:N(Jo)}),Fs=g({type:C("MARKDOWN"),markdown:l()}),St={type:C("TOOL_CALL"),input:le(H(l(),B())),output:_(B()),toolName:l(),status:N(Yo),toolCallId:l(),startTime:l(),endTime:_(l())},iR=g(St),Vs=ot("toolCallType",[g({...St,toolCallType:C("PIECE"),pieceName:l(),pieceVersion:l(),actionName:l()}),g({...St,toolCallType:C("FLOW"),displayName:l(),externalFlowId:l()}),g({...St,toolCallType:C("MCP"),displayName:l(),serverUrl:l()}),g({...St,toolCallType:C("KNOWLEDGE_BASE"),displayName:l(),sourceType:l()}),g({...St,toolCallType:C("UNKNOWN"),displayName:l()})]),Im=G([Fs,Vs]);var Qo=(r=>(r.IMAGE="image",r.TEXT="text",r))(Qo||{}),Ke=g({apiKey:l()}),Sm=Ke,Am=g({apiKey:l(),apiKeyHash:l()}),wm=Ke,$m=Ke,Om=Ke,Rm=Ke,zm=Ke,Dm=Ke,km=Ke,Gs=g({accessKeyId:l().check(je(1)),secretAccessKey:l().check(je(1))}),Cm=g({}),Nm=g({}),Um=g({}),Mm=g({}),Lm=g({}),jm=g({}),Ws=g({modelId:l(),modelName:l(),modelType:N(Qo)}),Ks=g({apiKeyHeader:l(),baseUrl:l(),models:U(Ws),defaultHeaders:_(H(l(),l()))}),Xs=g({accountId:l(),gatewayId:l(),models:U(Ws),vertexProject:_(l()),vertexRegion:_(l())}),Js=g({resourceName:l(),apiVersion:at(it(e=>typeof e=="string"&&e.trim().length===0?void 0:e),_(l()))}),Ys=g({region:l().check(je(1))}),Qs=g({}),Fm=G([Sm,Om,Rm,zm,Dm,$m,wm,Am,Gs,km]),eu=G([Ks,Xs,Js,Ys,Cm,Um,Mm,Lm,Nm,jm,Qs]),Vm=g({id:l(),name:l(),type:N(Qo)}),Bm=g({id:l(),name:l(),provider:N(It),config:eu,enabledForChat:ee()}),Hm=g({provider:N(It),name:l(),enabledForChat:ee(),keys:U(g({id:l(),name:l()}))}),Zm=g({provider:N(It),configId:l(),config:eu,auth:Fm,platformId:l()});var cR={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Bs=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],qm=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Gm=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Hs=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Wm=["grok-4.20","grok-4.1-fast"],Km={openai:Bs,anthropic:qm,google:Hs,activepieces:[...Gm.map(e=>`anthropic/${e}`),...Bs.map(e=>`openai/${e}`),...Hs.map(e=>`google/${e}`),...Wm.map(e=>`x-ai/${e}`)]};var Zs=128e3,Xm={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Jm({provider:e}){return e?Xm[e]??Zs:Zs}a(Jm,"getMaxContextTokens");var qs={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"},Ym={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Qm=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),eh={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function Ie(e){return{chatModels:Km[e],maxContextTokens:Jm({provider:e}),defaultEmbeddingModel:qs[e],supportsEmbedding:qs[e]!==void 0,supportsImageGeneration:!Qm.has(e),webSearch:Ym[e]}}a(Ie,"buildProviderCapabilities");var th={openai:Ie("openai"),anthropic:Ie("anthropic"),openrouter:Ie("openrouter"),azure:Ie("azure"),google:Ie("google"),"cloudflare-gateway":Ie("cloudflare-gateway"),custom:Ie("custom"),bedrock:Ie("bedrock"),mistral:Ie("mistral"),activepieces:Ie("activepieces"),xai:Ie("xai"),deepseek:Ie("deepseek"),zai:Ie("zai"),qwen:Ie("qwen"),minimax:Ie("minimax"),moonshot:Ie("moonshot")};var rh=g({base64Url:l(),fileName:l(),extension:_(l())}),nh=g({mimeType:l(),url:l(),fileName:_(l())}),ei=G([rh,nh]);var oh=G([g({type:C("file"),value:ei}),g({type:C("markdown"),value:l(),files:_(U(ei))})]),ih=g({sessionId:l(),message:l(),files:_(U(l()))});var ru=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ru||{}),nu=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(nu||{}),ti=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(ti||{});var ah=G([g({...Ue,name:l(),externalId:l(),type:C("STATIC_DROPDOWN"),tableId:l(),projectId:l(),data:g({options:U(g({value:l()}))})}),g({...Ue,name:l(),externalId:l(),type:G([C("TEXT"),C("NUMBER"),C("DATE"),C("DATETIME")]),tableId:l(),projectId:l()})]),sh=g({...Ue,name:l(),folderId:le(l()),projectId:l(),externalId:l(),status:Wo(nu),trigger:Wo(ru)}),uh=g({...Ue,tableId:l(),projectId:l(),cells:H(l(),g({updated:l(),created:l(),value:B(),fieldName:l()}))}),ch=g({events:U(N(ti)),webhookUrl:l(),flowId:l()}),lh=g({fields:U(g({id:l(),name:l()})),rows:U(H(l(),l())),name:l()}),ph=g({projectId:l(),limit:_(rr.number()),cursor:_(l()),name:_(l()),externalIds:en(l()),folderId:_(l()),folderIds:en(l())}),dh=g({records:U(U(g({fieldId:l(),value:iu()}))),tableId:l()}),fh=g({cells:_(U(g({fieldId:l(),value:iu()}))),tableId:l(),agentUpdate:_(ee())}),ou=ot("operator",[mt("eq"),mt("neq"),mt("gt"),mt("gte"),mt("lt"),mt("lte"),mt("co"),tu("exists"),tu("not_exists")]),mh=g({tableId:l(),limit:_(rr.number()),cursor:_(l()),filters:en(ou)});function iu(){return at(it(e=>e==null?e:String(e)),tr(l()))}a(iu,"coerceToString");function mt(e){return g({fieldId:l(),operator:C(e),value:l()})}a(mt,"valueFilter");function tu(e){return g({fieldId:l(),operator:C(e)})}a(tu,"existenceFilter");var hh=g({status:_(be()),body:_(B()),headers:_(H(l(),l()))}),gh=g({...Ue,deleted:le(ut),ownerId:l(),displayName:l(),platformId:l(),externalId:le(l())});var au=g({name:l(),description:_(l()),type:l(),required:ee()}),yh=g({pieceName:l(),triggerName:l(),input:g({toolName:l(),toolDescription:l(),inputSchema:U(au),returnsResponse:ee()})});var su="^[0-9]+\\.[0-9]+\\.[0-9]+$",wR=new RegExp(su),Ph="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",$R=l().check(nt(new RegExp(su))),OR=l().check(nt(new RegExp(Ph))),_h=g({packageType:C("ARCHIVE"),pieceType:N(bt),pieceName:l(),pieceVersion:l(),archiveId:l(),platformId:l()}),uu=g({packageType:C("REGISTRY"),pieceType:C("OFFICIAL"),pieceName:l(),pieceVersion:l()}),cu=g({packageType:C("REGISTRY"),pieceType:C("CUSTOM"),pieceName:l(),pieceVersion:l(),platformId:l()}),RR=G([uu,cu]),zR=G([_h,uu,cu]);var xh=ot("type",[g({type:C("CRON_EXPRESSION"),cronExpression:l(),timezone:l()}),g({type:C("INTERVAL"),intervalMs:Ps().check(Zr(6e4))})]),DR=g({...Ue,type:N(Ae),projectId:l(),flowId:l(),triggerName:l(),schedule:le(xh),flowVersionId:l(),pieceName:l(),pieceVersion:l(),deleted:le(l()),simulate:ee()}),lu=(h=>(h.UNKNOWN="UNKNOWN",h.FLOW_RUN_LOG="FLOW_RUN_LOG",h.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",h.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",h.FLOW_STEP_FILE="FLOW_STEP_FILE",h.SAMPLE_DATA="SAMPLE_DATA",h.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",h.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",h.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",h.PROJECT_RELEASE="PROJECT_RELEASE",h.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",h.PLATFORM_ASSET="PLATFORM_ASSET",h.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",h.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",h.KNOWLEDGE_BASE="KNOWLEDGE_BASE",h.FLOW_BUNDLE="FLOW_BUNDLE",h))(lu||{}),pu=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(pu||{}),du=(r=>(r.S3="S3",r.DB="DB",r))(du||{}),kR=g({...Ue,projectId:le(l()),platformId:le(l()),type:N(lu),compression:N(pu),data:_(B()),location:N(du),size:le(be()),fileName:le(l()),s3Key:le(l()),metadata:le(H(l(),l()))}),fu=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(fu||{}),mu=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(mu||{}),CR=g({id:l(),email:l(),firstName:l(),status:N(mu),externalId:le(l()),platformId:le(l()),platformRole:N(fu),lastName:l(),created:ut,updated:ut,lastActiveDate:le(ut),imageUrl:le(l())});var ri=g({...Y.shape,...Z(H(l(),B()),"OBJECT").shape});var ni=g({...Y.shape,formatProperty:_(l()),...Z(l(),"RICH_TEXT").shape});var vu=g({...Y.shape,...Z(l(),"COLOR").shape});var oi=G([ke,Ze,ni,Jr,Ge,Ce,qe,Bo,nr,Zo,We,ar,ri,sr,ir,Ho,or,vu]),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"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_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"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},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 Be=g({displayName:l(),description:_(l()),hasConnectionIdentifier:_(ee())});var Pu=g({username:l(),password:l()}),ii=g({...Be.shape,username:g({displayName:l(),description:_(l())}),password:g({displayName:l(),description:_(l())}),...Z(Pu,"BASIC_AUTH").shape});var Ih=H(l(),G([ke,Ze,We,Ge,Ce])),ai=g({...Be.shape,props:Ih,...Z(B(),"CUSTOM_AUTH").shape});var ht=g({...Be.shape,...Z(g({auth:l()}),"SECRET_TEXT").shape});var Sh=H(l(),G([ke,Ze,ht,We,Ge,Ce,qe,Jr])),_u=g({...Be.shape,props:Sh,...Z(B(),"OIDC").shape});var si=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(si||{}),xu=G([ke,ht,Ce]),bu=H(l(),xu),Ah=g({props:_(H(l(),xu)),authUrl:l(),tokenUrl:l(),scope:U(l()),prompt:_(G([C("none"),C("consent"),C("login"),C("omit")])),pkce:_(ee()),pkceMethod:_(G([C("plain"),C("S256")])),authorizationMethod:_(N(si)),grantType:_(G([N(cr),C(qo)])),extra:_(H(l(),l()))}),Tu=g({access_token:l(),props:_(bu),data:H(l(),er())}),ui=g({...Be.shape,...Ah.shape,...Z(Tu,"OAUTH2").shape});var At=G([ii,ai,_u,ui,ht]),fr="Connection",ci={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 vD={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 wh=g({...Y.shape,...Z(B(),"CUSTOM").shape,code:l()});var $h=G([oi,At]),li=H(l(),$h),LD=H(l(),oi);var Eu=G([g({strategy:C("CRON"),cronExpression:l()}),g({strategy:C("NONE")})]),wt=class{constructor(t,r,n,o,i,s,u,c,d,f,v,y,p,m,P,h,x,E,q,he,we){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=c;this.renewConfiguration=d;this.onRenew=f;this.onEnable=v;this.onDisable=y;this.onStart=p;this.run=m;this.test=P;this.sampleData=h;this.testStrategy=x;this.outputSchema=E;this.aiMetadata=q;this.classification=he;this.propertyGroups=we}static{a(this,"ITrigger")}},Se=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,e.classification,e.propertyGroups);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,e.classification,e.propertyGroups);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,e.classification,e.propertyGroups);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,ye(e.sampleData)&&ye(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Iu="2",rn="0.82.0";var pi=class{constructor(t,r,n,o,i,s,u,c,d=rn,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:Iu}),"getContextInfo");(!Rh(d)||zh(d,rn))&&(this.minimumSupportedRelease=rn),i.forEach(p=>this._actions[p.name]=p),s.forEach(p=>this._triggers[p.name]=p)}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:Oh(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}},Au=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(i=>i.type===r.type)))throw new Error("Auth properties must be unique by type");return new pi(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 Oh(e){if(e!==void 0)return Array.isArray(e)?e.map(Su):Su(e)}a(Oh,"withConnectionIdentifierFlag");function Su(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(Su,"flagConnectionIdentifier");function Rh(e){return/^\d+\.\d+\.\d+$/.test(e)}a(Rh,"isValidSimpleSemver");function zh(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(zh,"isSemverLessThan");var Dh=_(H(l(),H(l(),l()))),wu=g({id:_(l()),name:l(),displayName:l(),logoUrl:l(),description:l(),authors:U(l()),platformId:_(l()),directoryPath:_(l()),auth:_(G([At,U(At)])),version:l(),categories:_(U(N(Tt))),minimumSupportedRelease:_(l()),maximumSupportedRelease:_(l()),deprecated:_(ee()),i18n:Dh}),kh=N(["human","ai","both"]),$u=g({description:_(l()),idempotent:_(ee())}),Ou=N(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Ch=N(["tabs","section","summary","builder","footer"]),Ru=g({key:l(),display:Ch,label:_(l()),description:_(l()),icon:_(l()),props:U(l())}),zu=g({name:l(),displayName:l(),description:l(),props:li,propertyGroups:_(U(Ru)),requireAuth:ee(),errorHandlingOptions:_(Vo),outputSchema:_(Kr()),audience:_(kh),aiMetadata:_($u),classification:_(Ou)}),Du=g({name:l(),displayName:l(),description:l(),props:li,propertyGroups:_(U(Ru)),errorHandlingOptions:_(Vo),type:N(Ae),sampleData:B(),handshakeConfiguration:_(Kr()),renewConfiguration:_(Eu),testStrategy:N(pr),outputSchema:_(Kr()),aiMetadata:_($u),classification:_(Ou)}),Nh=g({...wu.shape,actions:H(l(),zu),triggers:H(l(),Du)}),Uh=g({...wu.shape,actions:be(),triggers:be(),suggestedActions:_(U(zu)),suggestedTriggers:_(U(Du))}),ku=g({projectUsage:be(),pieceType:N(bt),packageType:N(ur),platformId:_(l()),archiveId:_(l())}),Fk=g({...Nh.shape,...ku.shape}),Vk=g({...Uh.shape,...ku.shape}),Bk=g({name:l(),version:l()});var Mh=Q(require("path")),Lh=Q(require("fs/promises"));var $t=require("node:stream");var nn=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 on=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new di,r=new fi){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},di=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},fi=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 Cu({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(Cu,"toFailsafeOutput");var an=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(an||{});var sn=class extends nn{static{a(this,"FetchHttpClient")}constructor(t="",r=new on){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[q,he]of Object.entries(s))o.append(q,he);let u=o.toString(),c=u?`${n}?${u}`:n,d=t.responseType??"json",f=t.followRedirects??!0,v=t.retries??0,{body:y,extraHeaders:p,isStream:m}=jh(t.method)?Fh(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},P=Bh({...i,...p}),h=await Vh(async()=>{let q=new AbortController,he=t.timeout&&t.timeout>0?setTimeout(()=>q.abort(),t.timeout):void 0;try{let we={method:t.method.toString(),headers:P,body:y,redirect:f?"follow":"manual",signal:q.signal};return m&&(we.duplex="half"),r?.dispatcher!==void 0&&(we.dispatcher=r.dispatcher),await fetch(c,we)}finally{he!==void 0&&clearTimeout(he)}},m?0:v),x=f?300:400;if(h.status<200||h.status>=x){let q=await Nu(h,d==="stream"?"text":d),he=new mr(t.body,{status:h.status,responseBody:q});throw console.error("[HttpClient#(sanitized error message)] Request failed:",he),he}let E=await Nu(h,d);return{status:h.status,headers:Hh(h.headers),body:E}}};function jh(e){return e!=="GET"&&e!=="HEAD"}a(jh,"acceptsRequestBody");function Fh(e,t){if(Mu(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Zh(e)){let n=new $t.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof $t.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(Fh,"serializeBody");async function Nu(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Mu(e.body)?$t.Readable.from([]):$t.Readable.fromWeb(e.body);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(Nu,"parseResponseBody");async function Vh(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Uu(n);continue}return o}catch(o){if(r=o,n<t){await Uu(n);continue}throw o}throw r}a(Vh,"sendWithRetries");function Uu(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}a(Uu,"backoff");function Bh(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(Bh,"normalizeHeaders");function Hh(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}a(Hh,"toHttpHeaders");function Zh(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(Zh,"isNodeFormData");function Mu(e){return e==null}a(Mu,"isNil");var hr=new sn;var zy=Q(require("fs")),Hl=Q(Bl());var Dy={"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 ky(e){let t=e.split(";")[0].trim().toLowerCase();return Dy[t]??""}a(ky,"contentTypeToExtension");var Cy=a(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Ny=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 Zl({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:i,props:s,extraProps:u,authLocation:c="headers",classification:d="WRITE"}){return re({audience:"human",name:i||"custom_api_call",classification:d,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:f})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
6
|
+
i.e ${Ny(t,f)}/resource or /resource`,required:!0,defaultValue:f?t(f):"",...s?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(an).map(f=>({label:f,value:f}))},...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:f})=>{if(!f)return{};let v=f,y={};switch(v){case"none":break;case"json":y.data=T.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":y.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":y.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 y},"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 f=>{let{method:v,url:y,headers:p,queryParams:m,body:P,body_type:h,failsafe:x,timeout:E,response_is_binary:q,followRedirects:he}=f.propsValue;Qr(v,"Method"),Qr(y,"URL");let we=ye(r)?{}:await r(f.auth,f.propsValue),De=y.url,ve=De.startsWith("http://")||De.startsWith("https://")?De:Cy({baseUrl:t(f.auth),relativePath:De}),X={method:v,url:ve,headers:{...p??{},...c==="headers"||!ye(c)?we:{}},queryParams:{...c==="queryParams"?we:{},...m??{}},timeout:E?E*1e3:0,followRedirects:he};if(q&&(X.responseType="arraybuffer"),P)if(h&&h!=="none"){let $e=P.data;if(h==="form_data"){let Dr=$e,L=new Hl.default;for(let{fieldName:$,fieldType:I,textFieldValue:D,fileFieldValue:w}of Dr)I==="text"&&!dr(D)?L.append($,D):I==="file"&&!dr(w)&&L.append($,w.data,{filename:w?.filename});X.body=L,X.headers={...X.headers,...L.getHeaders()}}else X.body=$e}else h||(X.body=P);try{let $e=await hr.sendRequest(X);return await Uy(f.files,$e.body,$e.status,$e.headers,q)}catch($e){if(x)return Cu({error:$e,requestBody:X.body});throw $e}},"run")})}a(Zl,"createCustomApiCallAction");var Uy=a(async(e,t,r,n,o)=>{let i;if(o&&My(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],u=ky(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"),My=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var oe={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(ye(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=[];ye(u)||d==-1?f=c??[]:f=c?.slice(0,d)??[],ye(o)||(f=f.slice(-o));let v=f?.[0]?.id;return ye(v)||await t.put("lastItem",v),f.map(y=>y.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o,isRepublish:i}){switch(e.strategy){case 0:{if(i&&!ye(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(i&&!ye(await t.get("lastItem")))break;let u=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ye(u)?await t.delete("lastItem"):await t.put("lastItem",u);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 Ly(s.map(u=>u.data))}};function Ly(e){return e.length<=5?e:e.slice(0,5)}a(Ly,"getFirstFiveOrAll");var ql=require("node:stream");function jy(e){return"body"in e?{body:e.body,size:e.size}:{body:ql.Readable.from(e.data),size:e.data.length}}a(jy,"toStreamingBody");async function*Fy({readable:e,chunkSize:t}){let r=[],n=0;for await(let o of e)for(r.push(Buffer.isBuffer(o)?o:Buffer.from(o)),n+=r[r.length-1].length;n>=t;){let i=r.length===1?r[0]:Buffer.concat(r);yield i.subarray(0,t);let s=i.subarray(t);r=s.length>0?[s]:[],n=s.length}n>0&&(yield r.length===1?r[0]:Buffer.concat(r))}a(Fy,"readChunks");var ki={readChunks:Fy,toStreamingBody:jy};var Pr="login.microsoftonline.com",Wl="login.microsoftonline.us",Gl={[Pr]:"https://graph.microsoft.com",[Wl]:"https://graph.microsoft.us"},Kl=T.StaticDropdown({displayName:"Cloud Environment",description:"Select your Microsoft cloud environment.",required:!0,defaultValue:Pr,options:{disabled:!1,options:[{label:"Commercial (Global)",value:Pr},{label:"US Government (GCC High)",value:Wl}]}});function Vy(e){return e??Pr}a(Vy,"resolveCloudHost");function S(e){let t=Vy(e);return Gl[t]??Gl[Pr]}a(S,"getGraphBaseUrl");var By=`
|
|
7
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
8
|
set the **Redirect URI** to {{redirectUrl}} and add the following **Microsoft Graph (Delegated) permissions** under **API permissions**:
|
|
9
9
|
- Sites.Read.All
|
|
@@ -13,7 +13,7 @@ If you'd like to use your own custom Azure app instead of the default app, follo
|
|
|
13
13
|
- openid
|
|
14
14
|
- email
|
|
15
15
|
- profile
|
|
16
|
-
- offline_access`,$=si.OAuth2({description:Oy,props:{cloud:Fl},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 rd=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:rd({displayName:"Drive",refreshers:["siteId"]}),createDriveDropdown:rd,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 nd=Y(se());var od=te({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=nd.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 id=Y(se());var ad=te({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=id.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 sd=Y(se());var ud=te({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=sd.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 cd=Y(se());var ld=te({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 cd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}).api(`/sites/${t}/lists/${r}/items/${n}`).delete()}});var pd=Y(se());var dd=te({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=pd.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 fd=Y(se());var md=te({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=fd.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 hd=require("node:stream"),gd=require("node:stream/consumers");var yd=Y(se());var J_=250*1024*1024,X_=10*1024*1024,vd=te({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. Files over 250 MB are uploaded in chunks automatically. 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,streaming:!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=S(s),c=yd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:u}),f=(await c.api(`/sites/${t}/drives/${r}/root:${o}`).get()).id??"test",v=`/sites/${t}/drives/${r}/items/${f}:/${i}`,y=n.size,l=n.body;if(y==null){let _=await(0,gd.buffer)(n.body);y=_.length,l=hd.Readable.from(_)}if(y>J_){let _=await c.api(`${v}:/createUploadSession`).post({item:{"@microsoft.graph.conflictBehavior":"replace",name:i}});return await Y_({uploadUrl:_.uploadUrl,body:l,fileSize:y})}return(await gr.sendRequest({method:"PUT",url:`${u}/v1.0${v}:/content`,body:l,headers:{"Content-Type":"application/octet-stream","Content-Length":String(y)},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token}})).body}});async function Y_({uploadUrl:e,body:t,fileSize:r}){let n=0,o;for await(let i of Ml.readChunks({readable:t,chunkSize:X_}))o=await gr.sendRequest({method:"PUT",url:e,body:i,headers:{"Content-Length":String(i.length),"Content-Range":`bytes ${n}-${n+i.length-1}/${r}`}}),n+=i.length;return o?.body}a(Y_,"uploadInSession");var go=Y(se());var _d=2e3,Q_=120;async function eP(e){return new Promise(t=>setTimeout(t,e))}a(eP,"delay");var Pd=te({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=go.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(go.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=Q_*1e3/_d;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 eP(_d),l--}throw new Error("Copy operation timed out after 120 seconds.")}});var Ar=Y(se());var xd=2e3,tP=120;async function rP(e){return new Promise(t=>setTimeout(t,e))}a(rP,"delay");var bd=te({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=Ar.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=Ar.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(Ar.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=tP*1e3/xd;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 rP(xd),l--}throw new Error("Copy operation timed out after 120 seconds.")}});var ra=Y(se());var Td=te({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=ra.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=ra.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 na=Y(se());var Id=te({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=na.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=na.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 Ed=Y(se());var Sd=te({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=Ed.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 Ad=Y(se());var wd=te({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=Ad.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 yo=Y(se());var $d=te({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=yo.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=yo.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=yo.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 Od=Y(se());var Rd=te({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=Od.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 wr=Y(se());var zd="activepieces_sharepoint_trigger",kd=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=wr.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=wr.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:zd});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=wr.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===zd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=wr.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 $r=Y(se());var Dd="activepieces_sharepoint_subfolder_trigger",Cd=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=$r.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=$r.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:Dd})),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=$r.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===Dd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=$r.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 Nd=Y(se()),_o=Y(Zt());var vo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Nd.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,_o.default)(f.createdDateTime);return(0,_o.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,_o.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Ud=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(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 Md=Y(se()),Or=Y(Zt());var xo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,listId:o}=t,i=e.props?.cloud,s=Md.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=r===0?`$filter=createdDateTime gt ${(0,Or.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,Or.default)(f.createdDateTime);return(0,Or.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,Or.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Ld=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(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 aa=Y(se()),Rr=Y(Zt());var bo={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=aa.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,Rr.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,Rr.default)(l.lastModifiedDateTime);return(0,Rr.default)(m.lastModifiedDateTime).diff(_)}),d.map(l=>({epochMilliSeconds:(0,Rr.default)(l.lastModifiedDateTime).valueOf(),data:l}))},"items")},jd=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=aa.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(bo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(bo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(bo,e)},async run(e){return await ie.poll(bo,e)}});var sa=Y(se()),zr=Y(Zt());var To={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=sa.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,zr.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,zr.default)(l.lastModifiedDateTime);return(0,zr.default)(m.lastModifiedDateTime).diff(_)}),d.map(l=>({epochMilliSeconds:(0,zr.default)(l.lastModifiedDateTime).valueOf(),data:l}))},"items")},Fd=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=sa.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(To,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(To,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(To,e)},async run(e){return await ie.poll(To,e)}});var Vd=Y(se()),kr=Y(Zt());var Io={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Vd.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,kr.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,kr.default)(f.lastModifiedDateTime);return(0,kr.default)(v.lastModifiedDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,kr.default)(f.lastModifiedDateTime).valueOf(),data:f}))},"items")},Bd=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(Io,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await ie.onDisable(Io,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await ie.test(Io,e)},async run(e){return await ie.poll(Io,e)}});var Eo=Y(se());var Hd="activepieces_sharepoint_updated_list_item_trigger",Zd=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=Eo.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:Hd});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=Eo.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===Hd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Eo.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 nP=xu({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:[od,ad,ud,md,ld,dd,vd,Rd,Pd,bd,$d,Td,Id,Sd,wd,Ul({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:[kd,Cd,jd,Fd,Ld,Zd,Ud,Bd]});0&&(module.exports={microsoftSharePoint});
|
|
16
|
+
- offline_access`,O=ci.OAuth2({description:By,props:{cloud:Kl},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 Ye=Q(ae());var ld=a(e=>T.Dropdown({auth:O,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=Ye.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:O,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=Ye.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:ld({displayName:"Drive",refreshers:["siteId"]}),createDriveDropdown:ld,itemId:T.Dropdown({auth:O,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=Ye.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:O,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=Ye.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:O,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=Ye.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:O,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=Ye.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:O,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=Ye.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:O,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=Ye.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 pd=Q(ae());var dd=re({auth:O,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=pd.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 fd=Q(ae());var md=re({auth:O,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=fd.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 hd=Q(ae());var gd=re({auth:O,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=hd.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 yd=Q(ae());var vd=re({auth:O,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 yd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)}).api(`/sites/${t}/lists/${r}/items/${n}`).delete()}});var Pd=Q(ae());var _d=re({auth:O,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=Pd.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 xd=Q(ae());var bd=re({auth:O,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=xd.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 Td=require("node:stream"),Ed=require("node:stream/consumers");var Id=Q(ae());var c_=250*1024*1024,l_=10*1024*1024,Sd=re({auth:O,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. Files over 250 MB are uploaded in chunks automatically. 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,streaming:!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=S(s),c=Id.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:u}),f=(await c.api(`/sites/${t}/drives/${r}/root:${o}`).get()).id??"test",v=`/sites/${t}/drives/${r}/items/${f}:/${i}`,{body:y,size:p}=ki.toStreamingBody(n);if(p==null){let P=await(0,Ed.buffer)(y);p=P.length,y=Td.Readable.from(P)}if(p>c_){let P=await c.api(`${v}:/createUploadSession`).post({item:{"@microsoft.graph.conflictBehavior":"replace",name:i}});return await p_({uploadUrl:P.uploadUrl,body:y,fileSize:p})}return(await hr.sendRequest({method:"PUT",url:`${u}/v1.0${v}:/content`,body:y,headers:{"Content-Type":"application/octet-stream","Content-Length":String(p)},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token}})).body}});async function p_({uploadUrl:e,body:t,fileSize:r}){let n=0,o;for await(let i of ki.readChunks({readable:t,chunkSize:l_}))o=await hr.sendRequest({method:"PUT",url:e,body:i,headers:{"Content-Length":String(i.length),"Content-Range":`bytes ${n}-${n+i.length-1}/${r}`}}),n+=i.length;return o?.body}a(p_,"uploadInSession");var go=Q(ae());var Ad=2e3,d_=120;async function f_(e){return new Promise(t=>setTimeout(t,e))}a(f_,"delay");var wd=re({auth:O,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=go.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(go.ResponseType.RAW).query({"@microsoft.graph.conflictBehavior":u}).post(f)}catch(m){throw m.statusCode===400?new Error(`Invalid request: ${m.message||"Check your input parameters"}`):m.statusCode===403?new Error("Insufficient permissions to copy this item. Requires Files.ReadWrite or higher."):m.statusCode===404?new Error("Source item not found. Please verify the site, drive, and item IDs."):new Error(`Failed to initiate copy operation: ${m.message||"Unknown error"}`)}let y=v.headers.get("Location");if(!y)throw new Error("Could not get monitor URL from copy operation response.");let p=d_*1e3/Ad;for(;p>0;){let m=await d.api(y).get();if(m.status==="completed")return{success:!0,status:"completed",resourceId:m.resourceId,resourceLocation:m.resourceLocation};if(m.status==="failed"){let P=m.error?.details?m.error.details.map(h=>h.message||h.code).join(", "):m.error?.message||"Unknown error";throw new Error(`Copy operation failed: ${P}`)}await f_(Ad),p--}throw new Error("Copy operation timed out after 120 seconds.")}});var Sr=Q(ae());var $d=2e3,m_=120;async function h_(e){return new Promise(t=>setTimeout(t,e))}a(h_,"delay");var Od=re({auth:O,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:O,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=Sr.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=Sr.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(Sr.ResponseType.RAW).query({"@microsoft.graph.conflictBehavior":s}).post(f)}catch(m){throw m.statusCode===400?new Error(`Invalid request: ${m.message||"Check your input parameters"}`):m.statusCode===403?new Error("Insufficient permissions to copy this item. Requires Files.ReadWrite or higher."):m.statusCode===404?new Error("Source item not found. Please verify the site, drive, and item IDs."):new Error(`Failed to initiate copy operation: ${m.message||"Unknown error"}`)}let y=v.headers.get("Location");if(!y)throw new Error("Could not get monitor URL from copy operation response.");let p=m_*1e3/$d;for(;p>0;){let m=await c.api(y).get();if(m.status==="completed")return{success:!0,status:"completed",resourceId:m.resourceId,resourceLocation:m.resourceLocation};if(m.status==="failed"){let P=m.error?.details?m.error.details.map(h=>h.message||h.code).join(", "):m.error?.message||"Unknown error";throw new Error(`Copy operation failed: ${P}`)}await h_($d),p--}throw new Error("Copy operation timed out after 120 seconds.")}});var ia=Q(ae());var Rd=re({auth:O,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:O,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=ia.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=ia.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 aa=Q(ae());var zd=re({auth:O,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:O,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=aa.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=aa.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 Dd=Q(ae());var kd=re({auth:O,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=Dd.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 Cd=Q(ae());var Nd=re({auth:O,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=Cd.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 yo=Q(ae());var Ud=re({auth:O,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:O,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=yo.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:O,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=yo.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=yo.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 Md=Q(ae());var Ld=re({auth:O,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=Md.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 Ar=Q(ae());var jd="activepieces_sharepoint_trigger",Fd=Se({auth:O,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:O,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=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:"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=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,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:jd});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=Ar.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===jd);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 wr=Q(ae());var Vd="activepieces_sharepoint_subfolder_trigger",Bd=Se({auth:O,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:O,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=wr.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=wr.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.auth.access_token),"getAccessToken")},baseUrl:S(o)});try{let s=n==="root"?(await i.api(`/drives/${r}/root`).get()).id:n,c=(await i.api(`/drives/${r}/items/${s}/children?$filter=folder ne null&$select=id`).get()).value,d=new Date;d.setDate(d.getDate()+2);let f=c.map(p=>i.api("/subscriptions").post({changeType:"created",notificationUrl:e.webhookUrl,resource:`/sites/${t}/drive/items/${p.id}/children`,expirationDateTime:d.toISOString(),clientState:Vd})),y=(await Promise.allSettled(f)).filter(p=>p.status==="fulfilled").map(p=>p.value.id);await e.store.put("subscriptionIds",y)}catch(s){throw new Error(`Failed to create subscriptions: ${s.message||"Unknown error"}`)}},async onDisable(e){let t=await e.store.get("subscriptionIds");if(t&&t.length>0){let r=e.auth.props?.cloud,n=wr.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===Vd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=wr.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 Hd=Q(ae()),Po=Q(Zt());var vo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Hd.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,Po.default)(f.createdDateTime);return(0,Po.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,Po.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Zd=Se({auth:O,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 oe.onEnable(vo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await oe.onDisable(vo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await oe.test(vo,e)},async run(e){return await oe.poll(vo,e)}});var qd=Q(ae()),$r=Q(Zt());var xo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n,listId:o}=t,i=e.props?.cloud,s=qd.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(i)}),u=[],c=r===0?`$filter=createdDateTime gt ${(0,$r.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,$r.default)(f.createdDateTime);return(0,$r.default)(v.createdDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,$r.default)(f.createdDateTime).valueOf(),data:f}))},"items")},Gd=Se({auth:O,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 oe.onEnable(xo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await oe.onDisable(xo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await oe.test(xo,e)},async run(e){return await oe.poll(xo,e)}});var ca=Q(ae()),Or=Q(Zt());var bo={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=ca.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(u)}),d=[],f=i!=="root"?`/sites/${n}/drive/items/${i}/children`:`/sites/${n}/drives/${o}/items/root/children`,v=await c.api(f).orderby("lastModifiedDateTime desc").get(),y=!1;for(;!y&&v.value.length>0;){for(let p of v.value){if(!p.file)continue;let m=(0,Or.default)(p.lastModifiedDateTime).valueOf();if(s){d.push(p),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(p)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((p,m)=>{let P=(0,Or.default)(p.lastModifiedDateTime);return(0,Or.default)(m.lastModifiedDateTime).diff(P)}),d.map(p=>({epochMilliSeconds:(0,Or.default)(p.lastModifiedDateTime).valueOf(),data:p}))},"items")},Wd=Se({auth:O,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:O,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=ca.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 oe.onEnable(bo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await oe.onDisable(bo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await oe.test(bo,e)},async run(e){return await oe.poll(bo,e)}});var la=Q(ae()),Rr=Q(Zt());var To={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=la.Client.initWithMiddleware({authProvider:{getAccessToken:a(()=>Promise.resolve(e.access_token),"getAccessToken")},baseUrl:S(u)}),d=[],f=i!=="root"?`/sites/${n}/drive/items/${i}/children`:`/sites/${n}/drives/${o}/items/root/children`,v=await c.api(f).orderby("lastModifiedDateTime desc").get(),y=!1;for(;!y&&v.value.length>0;){for(let p of v.value){if(!p.folder)continue;let m=(0,Rr.default)(p.lastModifiedDateTime).valueOf();if(s){d.push(p),d.length>=10&&(y=!0);continue}if(m<r){y=!0;break}d.push(p)}if(y||!v["@odata.nextLink"])break;v=await c.api(v["@odata.nextLink"]).get()}return d.sort((p,m)=>{let P=(0,Rr.default)(p.lastModifiedDateTime);return(0,Rr.default)(m.lastModifiedDateTime).diff(P)}),d.map(p=>({epochMilliSeconds:(0,Rr.default)(p.lastModifiedDateTime).valueOf(),data:p}))},"items")},Kd=Se({auth:O,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:O,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=la.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 oe.onEnable(To,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await oe.onDisable(To,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await oe.test(To,e)},async run(e){return await oe.poll(To,e)}});var Xd=Q(ae()),zr=Q(Zt());var Eo={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{siteId:n}=t,o=r===0,i=e.props?.cloud,s=Xd.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,zr.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,zr.default)(f.lastModifiedDateTime);return(0,zr.default)(v.lastModifiedDateTime).diff(y)}),u.map(f=>({epochMilliSeconds:(0,zr.default)(f.lastModifiedDateTime).valueOf(),data:f}))},"items")},Jd=Se({auth:O,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 oe.onEnable(Eo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await oe.onDisable(Eo,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await oe.test(Eo,e)},async run(e){return await oe.poll(Eo,e)}});var Io=Q(ae());var Yd="activepieces_sharepoint_updated_list_item_trigger",Qd=Se({auth:O,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=Io.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:Yd});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=Io.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===Yd);if(r.length===0)return[];let n=e.auth.props?.cloud,o=Io.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 g_=Au({displayName:"Microsoft SharePoint",auth:O,minimumSupportedRelease:"0.78.0",logoUrl:"https://cdn.activepieces.com/pieces/microsoft-sharepoint.png",categories:["CONTENT_AND_FILES"],authors:["kishanprmr","pranith124","onyedikachi-david"],actions:[dd,md,gd,bd,vd,_d,Sd,Ld,wd,Od,Ud,Rd,zd,kd,Nd,Zl({auth:O,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:[Fd,Bd,Wd,Kd,Gd,Qd,Zd,Jd]});0&&(module.exports={microsoftSharePoint});
|
|
17
17
|
/*! Bundled license information:
|
|
18
18
|
|
|
19
19
|
mime-types/index.js:
|