@activepieces/piece-camb-ai 0.1.6 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-camb-ai",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "dependencies": {},
package/src/index.js CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";var Zs=Object.create;var et=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var Gs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hs(t))!Ws.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=Vs(t,i))||n.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?Zs(Gs(e)):{},yn(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),qs=e=>yn(et({},"__esModule",{value:!0}),e);var No=E((Ro,Zt)=>{(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"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,l){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],P,U;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>l)return null;for(U=l-g,P=":";U--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),l=function(){let ee=s.split(":"),ae=[];for(let Qe=0;Qe<ee.length;Qe++)ae.push(parseInt(ee[Qe],16));return ae}(),{parts:l,zoneId:v}}o(f,"expandIPv6");function y(s,l,g,m){if(s.length!==l.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==l[v]>>P)return!1;m-=g,v+=1}return!0}o(y,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function b(s,l){for(;s.length<l;)s=`0${s}`;return s}o(b,"padPart");let x={};x.IPv4=function(){function s(l){if(l.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<l.length;g++)if(m=l[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=l}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(l,g){let m;if(g===void 0&&(m=l,l=m[0],g=m[1]),l.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,l.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,U;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(U=m[P],g&&U!==0)return null;U!==8&&(g=!0),l+=U}else return null;return 32-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),g=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let l=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!l?!1:x.IPv4.isValidFourPartDecimal(l[1])},x.IPv4.networkAddressFromCIDR=function(s){let l,g,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let l=this.parser(s);if(l===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(l)},x.IPv4.parseCIDR=function(s){let l;if(l=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(l[2]);if(g>=0&&g<=32){let m=[this.parse(l[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let l,g,m;if(l=s.match(r.fourOctet))return function(){let v=l.slice(1,6),P=[];for(let U=0;U<v.length;U++)g=v[U],P.push(_(g));return P}();if(l=s.match(r.longValue)){if(m=_(l[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(l=s.match(r.twoOctet))?function(){let v=l.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(l=s.match(r.threeOctet))?function(){let v=l.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let l=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)l[g]=255,g++;return m<4&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.IPv6=function(){function s(l,g){let m,v;if(l.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(l[m]<<8|l[m+1]);else if(l.length===8)this.parts=l;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(l,g){let m;if(g===void 0&&(m=l,l=m[0],g=m[1]),l.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,l.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,m={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},v,P;for(let U=7;U>=0;U-=1)if(v=this.parts[U],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),l+=P}else return null;return 128-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let l,g=[],m=this.parts;for(let v=0;v<m.length;v++)l=m[v],g.push(l>>8),g.push(l&255);return g},s.prototype.toFixedLengthString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(b(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let l=this.parts.slice(-2),g=l[0],m=l[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},s.prototype.toRFC5952String=function(){let l=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=l.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),g=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(l){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${l})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let l=this.parser(s);return new this(l.parts,l.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let l,g,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(U){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${U})`)}},x.IPv6.parse=function(s){let l=this.parser(s);if(l.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(l.parts,l.zoneId)},x.IPv6.parseCIDR=function(s){let l,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(l=parseInt(g[2]),l>=0&&l<=128))return m=[this.parse(g[1]),l],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let l,g,m,v,P,U;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return f(s,8);if((m=s.match(d.transitional))&&(U=m[6]||"",l=m[1],m[1].endsWith("::")||(l=l.slice(0,-1)),l=f(l+U,6),l.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return l.parts.push(P[0]<<8|P[1]),l.parts.push(P[2]<<8|P[3]),{parts:l.parts,zoneId:l.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)l[g]=255,g++;return m<16&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.fromByteArray=function(s){let l=s.length;if(l===4)return new x.IPv4(s);if(l===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let l=this.parse(s);return l.kind()==="ipv6"&&l.isIPv4MappedAddress()?l.toIPv4Address():l},x.subnetMatch=function(s,l,g){let m,v,P,U;g==null&&(g="unicast");for(v in l)if(Object.prototype.hasOwnProperty.call(l,v)){for(P=l[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(U=P[m],s.kind()===U[0].kind()&&s.match.apply(s,U))return v}return g},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Ro)});var ki=E((qS,zi)=>{var Ai=require("stream").Stream,Tp=require("util");zi.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");Tp.inherits(ue,Ai);ue.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=Ai.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.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)};ue.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 Ni=E((JS,Ri)=>{var Ip=require("util"),wi=require("stream").Stream,Oi=ki();Ri.exports=K;function K(){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}o(K,"CombinedStream");Ip.inherits(K,wi);K.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};K.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};K.prototype.append=function(e){var t=K.isStreamLike(e);if(t){if(!(e instanceof Oi)){var r=Oi.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};K.prototype.pipe=function(e,t){return wi.prototype.pipe.call(this,e,t),this.resume(),e};K.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}};K.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=K.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};K.prototype._pipeNext=function(e){this._currentStream=e;var t=K.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()};K.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};K.prototype.write=function(e){this.emit("data",e)};K.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};K.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")};K.prototype.end=function(){this._reset(),this.emit("end")};K.prototype.destroy=function(){this._reset(),this.emit("close")};K.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};K.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};K.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)};K.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ci=E((YS,Di)=>{"use strict";Di.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 ji=E(re=>{"use strict";var Kt=Ci(),Ep=require("path").extname,Ui=/^\s*([^;\s]*)(?:;|\s|$)/,$p=/^text\//i;re.charset=Mi;re.charsets={lookup:Mi};re.contentType=Sp;re.extension=Ap;re.extensions=Object.create(null);re.lookup=zp;re.types=Object.create(null);kp(re.extensions,re.types);function Mi(e){if(!e||typeof e!="string")return!1;var t=Ui.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&$p.test(t[1])?"UTF-8":!1}o(Mi,"charset");function Sp(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}o(Sp,"contentType");function Ap(e){if(!e||typeof e!="string")return!1;var t=Ui.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ap,"extension");function zp(e){if(!e||typeof e!="string")return!1;var t=Ep("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(zp,"lookup");function kp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(o(function(i){var u=Kt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var d=0;d<c.length;d++){var f=c[d];if(t[f]){var y=r.indexOf(Kt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>_||y===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(kp,"populateMaps")});var Fi=E((tA,Li)=>{Li.exports=Op;function Op(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Op,"defer")});var Vr=E((nA,Zi)=>{var Bi=Fi();Zi.exports=wp;function wp(e){var t=!1;return Bi(function(){t=!0}),o(function(n,i){t?e(n,i):Bi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(wp,"async")});var Hr=E((iA,Vi)=>{Vi.exports=Rp;function Rp(e){Object.keys(e.jobs).forEach(Np.bind(e)),e.jobs={}}o(Rp,"abort");function Np(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Np,"clean")});var Gr=E((sA,Gi)=>{var Hi=Vr(),Dp=Hr();Gi.exports=Cp;function Cp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Up(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Dp(r):r.results[i]=c,n(u,r.results))})}o(Cp,"iterate");function Up(e,t,r,n){var i;return e.length==2?i=e(r,Hi(n)):i=e(r,t,Hi(n)),i}o(Up,"runJob")});var Wr=E((cA,Wi)=>{Wi.exports=Mp;function Mp(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(i,u){return t(e[i],e[u])}),n}o(Mp,"state")});var qr=E((lA,qi)=>{var jp=Hr(),Lp=Vr();qi.exports=Fp;function Fp(e){Object.keys(this.jobs).length&&(this.index=this.size,jp(this),Lp(e)(null,this.results))}o(Fp,"terminator")});var Ji=E((mA,Ki)=>{var Bp=Gr(),Zp=Wr(),Vp=qr();Ki.exports=Hp;function Hp(e,t,r){for(var n=Zp(e);n.index<(n.keyedList||e).length;)Bp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Vp.bind(n,r)}o(Hp,"parallel")});var Kr=E((gA,Jt)=>{var Xi=Gr(),Gp=Wr(),Wp=qr();Jt.exports=qp;Jt.exports.ascending=Yi;Jt.exports.descending=Kp;function qp(e,t,r,n){var i=Gp(e,r);return Xi(e,t,i,o(function u(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||e).length){Xi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Wp.bind(i,n)}o(qp,"serialOrdered");function Yi(e,t){return e<t?-1:e>t?1:0}o(Yi,"ascending");function Kp(e,t){return-1*Yi(e,t)}o(Kp,"descending")});var ea=E((hA,Qi)=>{var Jp=Kr();Qi.exports=Xp;function Xp(e,t,r){return Jp(e,t,null,r)}o(Xp,"serial")});var ra=E((xA,ta)=>{ta.exports={parallel:Ji(),serial:ea(),serialOrdered:Kr()}});var Jr=E((_A,na)=>{"use strict";na.exports=Object});var ia=E((PA,oa)=>{"use strict";oa.exports=Error});var sa=E((bA,aa)=>{"use strict";aa.exports=EvalError});var ca=E((TA,ua)=>{"use strict";ua.exports=RangeError});var la=E((IA,pa)=>{"use strict";pa.exports=ReferenceError});var ma=E((EA,da)=>{"use strict";da.exports=SyntaxError});var Xt=E(($A,fa)=>{"use strict";fa.exports=TypeError});var ya=E((SA,ga)=>{"use strict";ga.exports=URIError});var va=E((AA,ha)=>{"use strict";ha.exports=Math.abs});var _a=E((zA,xa)=>{"use strict";xa.exports=Math.floor});var ba=E((kA,Pa)=>{"use strict";Pa.exports=Math.max});var Ia=E((OA,Ta)=>{"use strict";Ta.exports=Math.min});var $a=E((wA,Ea)=>{"use strict";Ea.exports=Math.pow});var Aa=E((RA,Sa)=>{"use strict";Sa.exports=Math.round});var ka=E((NA,za)=>{"use strict";za.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var wa=E((CA,Oa)=>{"use strict";var Yp=ka();Oa.exports=o(function(t){return Yp(t)||t===0?t:t<0?-1:1},"sign")});var Na=E((MA,Ra)=>{"use strict";Ra.exports=Object.getOwnPropertyDescriptor});var Xr=E((jA,Da)=>{"use strict";var Yt=Na();if(Yt)try{Yt([],"length")}catch{Yt=null}Da.exports=Yt});var Ua=E((LA,Ca)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ca.exports=Qt});var Yr=E((FA,Ma)=>{"use strict";Ma.exports=o(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 i=42;t[r]=i;for(var u 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Fa=E((ZA,La)=>{"use strict";var ja=typeof Symbol<"u"&&Symbol,Qp=Yr();La.exports=o(function(){return typeof ja!="function"||typeof Symbol!="function"||typeof ja("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qp()},"hasNativeSymbols")});var Qr=E((HA,Ba)=>{"use strict";Ba.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var en=E((GA,Za)=>{"use strict";var el=Jr();Za.exports=el.getPrototypeOf||null});var Ga=E((WA,Ha)=>{"use strict";var tl="Function.prototype.bind called on incompatible ",rl=Object.prototype.toString,nl=Math.max,ol="[object Function]",Va=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),il=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),al=o(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");Ha.exports=o(function(t){var r=this;if(typeof r!="function"||rl.apply(r)!==ol)throw new TypeError(tl+r);for(var n=il(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Va(n,arguments));return Object(_)===_?_:this}return r.apply(t,Va(n,arguments))},"binder"),c=nl(0,r.length-n.length),d=[],f=0;f<c;f++)d[f]="$"+f;if(i=Function("binder","return function ("+al(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var He=E((KA,Wa)=>{"use strict";var sl=Ga();Wa.exports=Function.prototype.bind||sl});var er=E((JA,qa)=>{"use strict";qa.exports=Function.prototype.call});var tn=E((XA,Ka)=>{"use strict";Ka.exports=Function.prototype.apply});var Xa=E((YA,Ja)=>{"use strict";Ja.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Qa=E((QA,Ya)=>{"use strict";var ul=He(),cl=tn(),pl=er(),ll=Xa();Ya.exports=ll||ul.call(pl,cl)});var ts=E((ez,es)=>{"use strict";var dl=He(),ml=Xt(),fl=er(),gl=Qa();es.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ml("a function is required");return gl(dl,fl,t)},"callBindBasic")});var ss=E((rz,as)=>{"use strict";var yl=ts(),rs=Xr(),os;try{os=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var rn=!!os&&rs&&rs(Object.prototype,"__proto__"),is=Object,ns=is.getPrototypeOf;as.exports=rn&&typeof rn.get=="function"?yl([rn.get]):typeof ns=="function"?o(function(t){return ns(t==null?t:is(t))},"getDunder"):!1});var ds=E((oz,ls)=>{"use strict";var us=Qr(),cs=en(),ps=ss();ls.exports=us?o(function(t){return us(t)},"getProto"):cs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return cs(t)},"getProto"):ps?o(function(t){return ps(t)},"getProto"):null});var nn=E((az,ms)=>{"use strict";var hl=Function.prototype.call,vl=Object.prototype.hasOwnProperty,xl=He();ms.exports=xl.call(hl,vl)});var _s=E((sz,xs)=>{"use strict";var j,_l=Jr(),Pl=ia(),bl=sa(),Tl=ca(),Il=la(),Ke=ma(),qe=Xt(),El=ya(),$l=va(),Sl=_a(),Al=ba(),zl=Ia(),kl=$a(),Ol=Aa(),wl=wa(),hs=Function,on=o(function(e){try{return hs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=Xr(),Rl=Ua(),an=o(function(){throw new qe},"throwTypeError"),Nl=Pt?function(){try{return arguments.callee,an}catch{try{return Pt(arguments,"callee").get}catch{return an}}}():an,Ge=Fa()(),Y=ds(),Dl=en(),Cl=Qr(),vs=tn(),bt=er(),We={},Ul=typeof Uint8Array>"u"||!Y?j:Y(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&Y?Y([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%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%":Pl,"%eval%":eval,"%EvalError%":bl,"%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%":hs,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&Y?Y(Y([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!Y?j:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_l,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":Tl,"%ReferenceError%":Il,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!Y?j:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&Y?Y(""[Symbol.iterator]()):j,"%Symbol%":Ge?Symbol:j,"%SyntaxError%":Ke,"%ThrowTypeError%":Nl,"%TypedArray%":Ul,"%TypeError%":qe,"%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%":El,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":vs,"%Object.defineProperty%":Rl,"%Object.getPrototypeOf%":Dl,"%Math.abs%":$l,"%Math.floor%":Sl,"%Math.max%":Al,"%Math.min%":zl,"%Math.pow%":kl,"%Math.round%":Ol,"%Math.sign%":wl,"%Reflect.getPrototypeOf%":Cl};if(Y)try{null.error}catch(e){fs=Y(Y(e)),De["%Error.prototype%"]=fs}var fs,Ml=o(function e(t){var r;if(t==="%AsyncFunction%")r=on("async function () {}");else if(t==="%GeneratorFunction%")r=on("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=on("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return De[t]=r,r},"doEval"),gs={__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"]},Tt=He(),tr=nn(),jl=Tt.call(bt,Array.prototype.concat),Ll=Tt.call(vs,Array.prototype.splice),ys=Tt.call(bt,String.prototype.replace),rr=Tt.call(bt,String.prototype.slice),Fl=Tt.call(bt,RegExp.prototype.exec),Bl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Zl=/\\(\\)?/g,Vl=o(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return ys(t,Bl,function(u,c,d,f){i[i.length]=d?ys(f,Zl,"$1"):c||u}),i},"stringToPath"),Hl=o(function(t,r){var n=t,i;if(tr(gs,n)&&(i=gs[n],n="%"+i[0]+"%"),tr(De,n)){var u=De[n];if(u===We&&(u=Ml(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");xs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(Fl(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Vl(t),i=n.length>0?n[0]:"",u=Hl("%"+i+"%",r),c=u.name,d=u.value,f=!1,y=u.alias;y&&(i=y[0],Ll(n,jl([0,1],y)));for(var _=1,b=!0;_<n.length;_+=1){var x=n[_],s=rr(x,0,1),l=rr(x,-1);if((s==='"'||s==="'"||s==="`"||l==='"'||l==="'"||l==="`")&&s!==l)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(f=!0),i+="."+x,c="%"+i+"%",tr(De,c))d=De[c];else if(d!=null){if(!(x in d)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&_+1>=n.length){var g=Pt(d,x);b=!!g,b&&"get"in g&&!("originalValue"in g.get)?d=g.get:d=d[x]}else b=tr(d,x),d=d[x];b&&!f&&(De[c]=d)}}return d},"GetIntrinsic")});var bs=E((cz,Ps)=>{"use strict";var Gl=Yr();Ps.exports=o(function(){return Gl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Es=E((lz,Is)=>{"use strict";var Wl=_s(),Ts=Wl("%Object.defineProperty%",!0),ql=bs()(),Kl=nn(),Jl=Xt(),nr=ql?Symbol.toStringTag:null;Is.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Jl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!Kl(t,nr))&&(Ts?Ts(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Ss=E((mz,$s)=>{"use strict";var Xl=Function.prototype.call,Yl=Object.prototype.hasOwnProperty,Ql=He();$s.exports=Ql.call(Xl,Yl)});var zs=E((fz,As)=>{"use strict";As.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ln=E((gz,Os)=>{"use strict";var pn=Ni(),ed=require("util"),sn=require("path"),td=require("http"),rd=require("https"),nd=require("url").parse,od=require("fs"),id=require("stream").Stream,ad=require("crypto"),un=ji(),sd=ra(),ud=Es(),Se=Ss(),cn=zs();function ks(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(ks,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],pn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");ed.inherits(L,pn);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=pn.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 i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.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)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Se(t,"httpVersion"))&&!(t instanceof id))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Se(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):od.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Se(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Se(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+ks(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&cn(c,r.header);var d;for(var f in c)if(Se(c,f)){if(d=c[f],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=f+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Se(e,"httpVersion")&&(r=sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+ks(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=un.lookup(e.name)),!r&&e&&e.path&&(r=un.lookup(e.path)),!r&&e&&e.readable&&Se(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=un.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Se(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.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(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+ad.randomBytes(12).toString("hex")};L.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};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.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}sd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=nd(e),n=cn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=cn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=rd.request(n):r=td.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,f=o(function(y,_){return r.removeListener("error",f),r.removeListener("response",d),t.call(this,y,_)},"callback");d=f.bind(this,null),r.on("error",f),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};ud(L.prototype,"FormData");Os.exports=L});var hd={};gn(hd,{cambAi:()=>yd});module.exports=qs(hd);var Ks=Object.freeze({status:"aborted"});function T(e,t,r){function n(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);let y=c.prototype,_=Object.keys(y);for(let b=0;b<_.length;b++){let x=_[b];x in d||(d[x]=y[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(d){var f;let y=r?.Parent?new u:this;n(y,d),(f=y._zod).deferred??(f.deferred=[]);for(let _ of y._zod.deferred)_();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var Js=Symbol("zod_brand"),ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function me(e){return e&&Object.assign(ir,e),ir}o(me,"config");function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(sr,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function xn(e){return e==null}o(xn,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var hn=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Xs=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(G,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var Ys={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 Ue(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}o(Ue,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(cr,"issue");var In=o((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,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),En=T("$ZodError",In),rt=T("$ZodError",In,{Parent:Error});var eu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ce;if(c.issues.length){let d=new(i?.Err??e)(c.issues.map(f=>be(f,u,me())));throw ur(d,i?.callee),d}return c.value},"_parse"),kt=eu(rt),tu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??e)(c.issues.map(f=>be(f,u,me())));throw ur(d,i?.callee),d}return c.value},"_parseAsync"),Ot=tu(rt),ru=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new ce;return u.issues.length?{success:!1,error:new(e??En)(u.issues.map(c=>be(c,i,me())))}:{success:!0,data:u.value}},"_safeParse"),nt=ru(rt),nu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>be(c,i,me())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=nu(rt);var ou="(?:(?:\\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])))",iu=new RegExp(`^${ou}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var pr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Me=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=T("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Me.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),kn=T("$ZodCheckRegex",(e,t)=>{lr.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 wn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,d,f)=>{let y=Ue(c),_;for(let b of d){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ce;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Ue(c,x)))});else{if(c.issues.length===x)continue;y||(y=Ue(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,d,f)=>{if(Ue(c))return c.aborted=!0,c;let y=i(d,n,f);if(y instanceof Promise){if(f.async===!1)throw new ce;return y.then(_=>e._zod.parse(_,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return y instanceof Promise?y.then(_=>u(_,c,d)):u(y,c,d)}let f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new ce;return f.then(y=>i(y,n,d))}return i(f,n,d)}}J(e,"~standard",()=>({validate:o(i=>{try{let u=nt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(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}}),dr=T("$ZodStringFormat",(e,t)=>{lr.init(e,t),Nt.init(e,t)});var Un=T("$ZodURL",(e,t)=>{dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Mn=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var mr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=Sn,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 Ln=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Fn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Bn=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Zn=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Rn(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let d=i[c],f=t.element._zod.run({value:d,issues:[]},n);f instanceof Promise?u.push(f.then(y=>Rn(y,r,c))):Rn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Rt,"handlePropertyResult");function au(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=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(au,"normalizeDef");function su(e,t,r,n,i,u){let c=[],d=i.keySet,f=i.catchall._zod,y=f.def.type,_=f.optout==="optional";for(let b in t){if(d.has(b))continue;if(y==="never"){c.push(b);continue}let x=f.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Rt(s,r,b,t,_))):Rt(x,r,b,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(su,"handleCatchall");var Hn=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...d};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=St(()=>au(t));J(e._zod,"propValues",()=>{let d=t.shape,f={};for(let y in d){let _=d[y]._zod;if(_.values){f[y]??(f[y]=new Set);for(let b of _.values)f[y].add(b)}}return f});let i=tt,u=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let y=d.value;if(!i(y))return d.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),d;d.value={};let _=[],b=c.shape;for(let x of c.keys){let s=b[x],l=s._zod.optout==="optional",g=s._zod.run({value:y[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>Rt(m,d,x,y,l))):Rt(g,d,x,y,l)}return u?su(_,y,d,f,n.value,e):_.length?Promise.all(_).then(()=>d):d}});function Nn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ue(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>be(c,n,me())))}),t)}o(Nn,"handleUnionResults");var fr=T("$ZodUnion",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>At(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,d=[];for(let f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)d.push(y),c=!0;else{if(y.issues.length===0)return y;d.push(y)}}return c?Promise.all(d).then(f=>Nn(f,i,e,u)):Nn(d,i,e,u)}});var Gn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,f]of Object.entries(c)){i[d]||(i[d]=new Set);for(let y of f)i[d].add(y)}}return i});let n=St(()=>{let i=t.options,u=new Map;for(let c of i){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of d){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!tt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Wn=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){d.add(typeof y=="number"?y.toString():y);let _=t.valueType._zod.run({value:i[y],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...Pe(y,b.issues)),r.value[y]=b.value})):(_.issues.length&&r.issues.push(...Pe(y,_.issues)),r.value[y]=_.value)}let f;for(let y in i)d.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let f=t.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&pr.test(d)&&f.issues.length){let b=t.keyType._zod.run({value:Number(d),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>be(b,n,me())),input:d,path:[d],inst:e});continue}let _=t.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...Pe(d,b.issues)),r.value[f.value]=b.value})):(_.issues.length&&r.issues.push(...Pe(d,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var qn=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?Ce(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Kn=T("$ZodLiteral",(e,t)=>{if(W.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"?Ce(n):n?Ce(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Jn=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=T("$ZodNullable",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)}|null)$`):void 0}),J(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 Qn=T("$ZodPipe",(e,t)=>{W.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var eo=T("$ZodCustom",(e,t)=>{Me.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(cr(i))}}o(Cn,"handleRefineResult");var ro,lu=Symbol("ZodOutput"),du=Symbol("ZodInput"),gr=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function no(){return new gr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var yr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...G(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...G(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...G(t)})}o(co,"_boolean");function po(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(po,"_coercedBoolean");function lo(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(lo,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...G(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(yo,"_coercedDate");function se(e,t){return new zn({check:"min_length",...G(t),minimum:e})}o(se,"_minLength");function Te(e,t){return new kn({check:"string_format",format:"regex",...G(t),pattern:e})}o(Te,"_regex");function ho(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(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)=>zt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ct=T("ZodMiniString",(e,t)=>{Nt.init(e,t),X.init(e,t)});function a(e){return oo(Ct,e)}o(a,"string");var vo=T("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Ct.init(e,t)});var bu=T("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(bu,e)}o(xo,"url");var hr=T("ZodMiniNumber",(e,t)=>{Mn.init(e,t),X.init(e,t)});function te(e){return so(hr,e)}o(te,"number");var vr=T("ZodMiniBoolean",(e,t)=>{mr.init(e,t),X.init(e,t)});function B(e){return co(vr,e)}o(B,"boolean");var _o=T("ZodMiniBigInt",(e,t)=>{jn.init(e,t),X.init(e,t)});var Tu=T("ZodMiniAny",(e,t)=>{Ln.init(e,t),X.init(e,t)});function at(){return mo(Tu)}o(at,"any");var Iu=T("ZodMiniUnknown",(e,t)=>{Fn.init(e,t),X.init(e,t)});function O(){return fo(Iu)}o(O,"unknown");var Eu=T("ZodMiniVoid",(e,t)=>{Bn.init(e,t),X.init(e,t)});function Po(e){return go(Eu,e)}o(Po,"_void");var bo=T("ZodMiniDate",(e,t)=>{Zn.init(e,t),X.init(e,t)});var $u=T("ZodMiniArray",(e,t)=>{Vn.init(e,t),X.init(e,t)});function N(e,t){return new $u({type:"array",element:e,...G(t)})}o(N,"array");var Su=T("ZodMiniObject",(e,t)=>{Hn.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...G(t)};return new Su(r)}o(p,"object");var Au=T("ZodMiniUnion",(e,t)=>{fr.init(e,t),X.init(e,t)});function D(e,t){return new Au({type:"union",options:e,...G(t)})}o(D,"union");var zu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Gn.init(e,t),X.init(e,t)});function je(e,t,r){return new zu({type:"union",options:t,discriminator:e,...G(r)})}o(je,"discriminatedUnion");var ku=T("ZodMiniRecord",(e,t)=>{Wn.init(e,t),X.init(e,t)});function w(e,t,r){return new ku({type:"record",keyType:e,valueType:t,...G(r)})}o(w,"record");var Ou=T("ZodMiniEnum",(e,t)=>{qn.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ou({type:"enum",entries:r,...G(t)})}o(M,"_enum");var wu=T("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),X.init(e,t)});function $(e,t){return new wu({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o($,"literal");var Ru=T("ZodMiniTransform",(e,t)=>{Jn.init(e,t),X.init(e,t)});function Ie(e){return new Ru({type:"transform",transform:e})}o(Ie,"transform");var Nu=T("ZodMiniOptional",(e,t)=>{Xn.init(e,t),X.init(e,t)});function h(e){return new Nu({type:"optional",innerType:e})}o(h,"optional");var Du=T("ZodMiniNullable",(e,t)=>{Yn.init(e,t),X.init(e,t)});function st(e){return new Du({type:"nullable",innerType:e})}o(st,"nullable");var Cu=T("ZodMiniPipe",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Ee(e,t){return new Cu({type:"pipe",in:e,out:t})}o(Ee,"pipe");var Uu=T("ZodMiniCustom",(e,t)=>{eo.init(e,t),X.init(e,t)});function Ut(e,t){return ho(Uu,e??(()=>!0),t)}o(Ut,"custom");var ut={};gn(ut,{bigint:()=>Vu,boolean:()=>Zu,date:()=>Hu,number:()=>Bu,string:()=>Fu});function Fu(e){return io(Ct,e)}o(Fu,"string");function Bu(e){return uo(hr,e)}o(Bu,"number");function Zu(e){return po(vr,e)}o(Zu,"boolean");function Vu(e){return lo(_o,e)}o(Vu,"bigint");function Hu(e){return yo(bo,e)}o(Hu,"date");var _r=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),xr=class{constructor(t,r,n,i,u,c,d,f,y,_,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=d;this.errorHandlingOptions=f;this.outputSchema=y;this.audience=_;this.aiMetadata=b}static{o(this,"IAction")}},pe=o(e=>new xr(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 F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:$(t),required:B(),defaultValue:h(at())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),fe=p({...F.shape,...C(a(),"LONG_TEXT").shape});var Io=p({label:a(),value:O()}),Mt=p({disabled:h(B()),placeholder:h(a()),options:N(Io)});var oe=p({...F.shape,options:Mt,...C(O(),"STATIC_DROPDOWN").shape}),ge=p({...F.shape,options:Mt,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...F.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),ct=p({...F.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ye=p({...F.shape,...C(B(),"CHECKBOX").shape});var he=p({...F.shape,...C(te(),"NUMBER").shape});var pt=p({...F.shape,...C(O(),"FILE").shape});var lt=p({...F.shape,...C(a(),"DATE_TIME").shape});var Eo=w(a(),D([ne,fe,oe,ct,ge,ye,he,pt,lt])),dt=p({...F.shape,properties:Eo,...C(N(O()),"ARRAY").shape});var mt=p({...F.shape,...C(D([w(a(),O())]),"JSON").shape});var $o=D([ne,oe,mt,dt,ge]),Wu=w(a(),$o),br=p({refreshers:N(a()),...F.shape,...C(O(),"DYNAMIC").shape});var jt=p({...F.shape,...C(Po(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),Fe=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Fe||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Tr="both_client_credentials_and_authorization_code";var Oe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Oe||{}),yt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(yt||{}),qu=p({strategy:M(yt),paramName:h(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),So=p({status:h(te()),body:h(O()),headers:h(w(a(),a()))}),Ao=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(M(Lt))}),zo=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:So,handlerId:h(a()),streamStepProgress:h(M(Lt))}),Ku=D([Ao,zo]);var Ju=p({body:O(),rawBody:h(O()),headers:w(a(),a()),queryParams:w(a(),a())});function ve(e){return e==null}o(ve,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Ft(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ft,"assertNotNullOrUndefined");var Ir=ke(require("crypto"),1);var Xu=128,we,Be,Yu=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*Xu),Ir.default.randomFillSync(we),Be=0):Be+e>we.length&&(Ir.default.randomFillSync(we),Be=0),Be+=e},"fillPool"),Qu=o(e=>(Yu(e|=0),we.subarray(Be-e,Be)),"random"),ec=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let d=r(i),f=i;for(;f--;)if(c+=e[d[f]&n]||"",c.length===u)return c}}},"customRandom"),Oo=o((e,t=21)=>ec(e,t,Qu),"customAlphabet");var tc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,eb=a().check(Te(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),rc=Oo(tc,wo);var $e=Ee(Ie(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:$e,updated:$e},H=o(e=>h(st(e)),"Nullable");function Er(e){return h(st(M(e)))}o(Er,"NullableEnum");var nb=Ee(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Bt=o(e=>Ee(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var ab=w(a(),O());var xt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(xt||{});var vb=a().check(Te(/^#[0-9A-Fa-f]{6}$/));var _b=p({filename:a(),data:O(),type:$("file"),mimetype:h(a())});var nc=ke(No());var Sb=p({...ie,name:a(),permissions:N(a()),platformId:H(a()),type:a(),userCount:h(te())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),Sr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Sr||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var oc=p({mode:M(Do),value:O()}),ic=p({auth:h(a()),fields:w(a(),oc)}),ac=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(ic)}),sc=p({type:$("PIECE"),toolName:a().check(se(1)),pieceMetadata:ac}),uc=p({type:$("none")}),cc=p({type:$("access_token"),accessToken:a()}),pc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),lc=p({type:$("headers"),headers:w(a(),a())}),dc=je("type",[uc,cc,pc,lc]),Co=p({type:$("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:h(a())}),Uo=p({type:$("MCP"),toolName:a().check(se(1)),serverUrl:xo(),protocol:M(Sr),auth:dc}),Mo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:M($r),sourceId:a(),sourceName:a()}),mc=je("type",[sc,Co,Uo,Mo]),fc=p({displayName:a(),description:h(a()),type:M(Ar)}),jo=p({type:$("MARKDOWN"),markdown:a()}),Ze={type:$("TOOL_CALL"),input:H(w(a(),O())),output:h(O()),toolName:a(),status:M(zr),toolCallId:a(),startTime:a(),endTime:h(a())},eT=p(Ze),Lo=je("toolCallType",[p({...Ze,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ze,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ze,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...Ze,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ze,toolCallType:$("UNKNOWN"),displayName:a()})]),gc=D([jo,Lo]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),xe=p({apiKey:a()}),yc=xe,hc=p({apiKey:a(),apiKeyHash:a()}),vc=xe,xc=xe,_c=xe,Pc=xe,bc=xe,Tc=xe,Ic=xe,Fo=p({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Ec=p({}),$c=p({}),Sc=p({}),Ac=p({}),zc=p({}),kc=p({}),Bo=p({modelId:a(),modelName:a(),modelType:M(kr)}),Zo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Bo),defaultHeaders:h(w(a(),a()))}),Vo=p({accountId:a(),gatewayId:a(),models:N(Bo),vertexProject:h(a()),vertexRegion:h(a())}),Ho=p({resourceName:a(),apiVersion:Ee(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Go=p({region:a().check(se(1))}),Oc=D([yc,_c,Pc,bc,Tc,xc,vc,hc,Fo,Ic]),Wo=D([Zo,Vo,Ho,Go,Ec,Sc,Ac,zc,$c,kc]),wc=p({id:a(),name:a(),type:M(kr)}),Rc=p({id:a(),name:a(),provider:M(xt),config:Wo,enabledForChat:B()}),Nc=p({provider:M(xt),config:Wo,auth:Oc,platformId:a()});var oT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Dc=p({base64Url:a(),fileName:a(),extension:h(a())}),Cc=p({mimeType:a(),url:a(),fileName:h(a())}),Or=D([Dc,Cc]);var Uc=D([p({type:$("file"),value:Or}),p({type:$("markdown"),value:a(),files:h(N(Or))})]),Mc=p({sessionId:a(),message:a(),files:h(N(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var jc=D([p({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),Lc=p({...ie,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Er(Jo),trigger:Er(Ko)}),Fc=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),Bc=p({events:N(M(wr)),webhookUrl:a(),flowId:a()}),Zc=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Vc=p({projectId:a(),limit:h(ut.number()),cursor:h(a()),name:h(a()),externalIds:Bt(a()),folderId:h(a()),folderIds:Bt(a())}),Hc=p({records:N(N(p({fieldId:a(),value:Yo()}))),tableId:a()}),Gc=p({cells:h(N(p({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:h(B())}),Xo=je("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),qo("exists"),qo("not_exists")]),Wc=p({tableId:a(),limit:h(ut.number()),cursor:h(a()),filters:Bt(Xo)});function Yo(){return Ee(Ie(e=>e==null?e:String(e)),st(a()))}o(Yo,"coerceToString");function Re(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Re,"valueFilter");function qo(e){return p({fieldId:a(),operator:$(e)})}o(qo,"existenceFilter");var qc=p({status:h(te()),body:h(O()),headers:h(w(a(),a()))}),Kc=p({...ie,deleted:H($e),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var Qo=p({name:a(),description:h(a()),type:a(),required:B()}),Jc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(Qo),returnsResponse:B()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",TT=new RegExp(ei),Yc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",IT=a().check(Te(new RegExp(ei))),ET=a().check(Te(new RegExp(Yc))),Qc=p({packageType:$("ARCHIVE"),pieceType:M(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),$T=D([ti,ri]),ST=D([Qc,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),ep=p({type:M(ni),cronExpression:a(),timezone:a()}),AT=p({...ie,type:M(Oe),projectId:a(),flowId:a(),triggerName:a(),schedule:H(ep),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:B()}),oi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),zT=p({...ie,projectId:H(a()),platformId:H(a()),type:M(oi),compression:M(ii),data:h(O()),location:M(ai),size:H(te()),fileName:H(a()),s3Key:H(a()),metadata:H(w(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),kT=p({id:a(),email:a(),firstName:a(),status:M(ui),externalId:H(a()),platformId:H(a()),platformRole:M(si),lastName:a(),created:$e,updated:$e,lastActiveDate:H($e),imageUrl:H(a())});var Rr=p({...F.shape,...C(w(a(),O()),"OBJECT").shape});var di=p({...F.shape,...C(a(),"COLOR").shape});var Nr=D([ne,fe,jt,ye,oe,ge,Pr,ct,br,he,dt,Rr,mt,lt,pt,di]),S={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 le=p({displayName:a(),description:h(a())});var mi=p({username:a(),password:a()}),Dr=p({...le.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(mi,"BASIC_AUTH").shape});var op=w(a(),D([ne,fe,he,ye,oe])),Cr=p({...le.shape,props:op,...C(O(),"CUSTOM_AUTH").shape});var Ne=p({...le.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var ip=w(a(),D([ne,fe,Ne,he,ye,oe,ge,jt])),fi=p({...le.shape,props:ip,...C(O(),"OIDC").shape});var Ur=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ur||{}),gi=D([ne,Ne,oe]),yi=w(a(),gi),ap=p({props:h(w(a(),gi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(B()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(M(Ur)),grantType:h(D([M(gt),$(Tr)])),extra:h(w(a(),a()))}),hi=p({access_token:a(),props:h(yi),data:w(a(),at())}),Mr=p({...le.shape,...ap.shape,...C(hi,"OAUTH2").shape});var Ve=D([Dr,Cr,fi,Mr,Ne]),_t="Connection",jr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var uE={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 sp=p({...F.shape,...C(O(),"CUSTOM").shape,code:a()});var up=D([Nr,Ve]),Lr=w(a(),up),AE=w(a(),Nr);var vi=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]);var xi="2",Vt="0.82.0";var Fr=class{constructor(t,r,n,i,u,c,d,f,y=Vt,_,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=_;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:xi}),"getContextInfo");(!cp(y)||pp(y,Vt))&&(this.minimumSupportedRelease=Vt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},_i=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Fr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function cp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(cp,"isValidSimpleSemver");function pp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,d]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<d}o(pp,"isSemverLessThan");var lp=h(w(a(),w(a(),a()))),Pi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Ve,N(Ve)])),version:a(),categories:h(N(M(Fe))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:lp}),dp=M(["human","ai","both"]),bi=p({description:h(a()),idempotent:h(B())}),Ti=p({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:B(),errorHandlingOptions:h(_r),outputSchema:h(Ut()),audience:h(dp),aiMetadata:h(bi)}),Ii=p({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:h(_r),type:M(Oe),sampleData:O(),handshakeConfiguration:h(Ut()),renewConfiguration:h(vi),testStrategy:M(ht),outputSchema:h(Ut()),aiMetadata:h(bi)}),mp=p({...Pi.shape,actions:w(a(),Ti),triggers:w(a(),Ii)}),fp=p({...Pi.shape,actions:te(),triggers:te(),suggestedActions:h(N(Ii)),suggestedTriggers:h(N(Ti))}),Ei=p({projectUsage:te(),tags:h(N(a())),pieceType:M(Le),packageType:M(ft),platformId:h(a()),archiveId:h(a())}),A$=p({...mp.shape,...Ei.shape}),z$=p({...fp.shape,...Ei.shape}),k$=p({name:a(),version:a()});var gp=ke(require("path")),yp=ke(require("fs/promises"));var Ht=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Br,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Wt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Ht{static{o(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[U,ee]of Object.entries(c))i.append(U,ee);let d=i.toString(),f=d?`${n}?${d}`:n,y=t.responseType??"json",_=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:s,isStream:l}=hp(t.body,u),g=xp({...u,...s}),m=await vp(async()=>{let U=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>U.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:U.signal};return l&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{ee!==void 0&&clearTimeout(ee)}},b),v=_?300:400;if(m.status<200||m.status>=v){let U=await $i(m,y),ee=new Wt(t.body,{status:m.status,responseBody:U});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let P=await $i(m,y);return{status:m.status,headers:_p(m.headers),body:P}}};function hp(e,t){return bp(e)?{body:void 0,extraHeaders:{},isStream:!1}:Pp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(hp,"serializeBody");async function $i(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o($i,"parseResponseBody");async function vp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Si(n);continue}return i}catch(i){if(r=i,n<t){await Si(n);continue}throw i}throw r}o(vp,"sendWithRetries");function Si(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Si,"backoff");function xp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(xp,"normalizeHeaders");function _p(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(_p,"toHttpHeaders");function Pp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Pp,"isNodeFormData");function bp(e){return e==null}o(bp,"isNil");var Z=new qt;var _e=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(_e||{});var cd=ke(require("fs")),ws=ke(ln());var pd={"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 ld(e){let t=e.split(";")[0].trim().toLowerCase();return pd[t]??""}o(ld,"contentTypeToExtension");var dd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),md=o((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 Rs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:d,authLocation:f="headers"}){return pe({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${md(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(_e).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.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:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let _=y,b={};switch(_){case"none":break;case"json":b.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async y=>{let{method:_,url:b,headers:x,queryParams:s,body:l,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:U}=y.propsValue;Ft(_,"Method"),Ft(b,"URL");let ee=ve(r)?{}:await r(y.auth,y.propsValue),ae=b.url,Qe=ae.startsWith("http://")||ae.startsWith("https://")?ae:dd({baseUrl:t(y.auth),relativePath:ae}),ze={method:_,url:Qe,headers:{...x??{},...f==="headers"||!ve(f)?ee:{}},queryParams:{...f==="queryParams"?ee:{},...s??{}},timeout:v?v*1e3:0,followRedirects:U};if(P&&(ze.responseType="arraybuffer"),l)if(g&&g!=="none"){let de=l.data;if(g==="form_data"){let Bs=de,It=new ws.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:or}of Bs)mn==="text"&&!vt(fn)?It.append(dn,fn):mn==="file"&&!vt(or)&&It.append(dn,or.data,{filename:or?.filename});ze.body=It,ze.headers={...ze.headers,...It.getHeaders()}}else ze.body=de}else g||(ze.body=l);try{let de=await Z.sendRequest(ze);return await fd(y.files,de.body,de.status,de.headers,P)}catch(de){if(m)return de.errorMessage();throw de}},"run")})}o(Rs,"createCustomApiCallAction");var fd=o(async(e,t,r,n,i)=>{let u;if(i&&gd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=ld(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),gd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var V="https://client.camb.ai/apis",Ae=5e3;var Je=10,Ns=120,Ds=S.Dropdown({auth:Q,displayName:"Voice",description:"Select the voice to generate the speech.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${V}/list-voices`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.voice_name,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Xe=S.Dropdown({auth:Q,displayName:"Source Language",description:"Select the original language of the input text.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${V}/source-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Cs=S.Dropdown({displayName:"Target Language",description:"Select the language to translate the text into.",auth:Q,required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${V}/target-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Ye=S.Dropdown({displayName:"Folder",auth:Q,description:"Select the folder to save the task in.",required:!1,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please authenticate first"};try{return{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${V}/folders`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.folder_name,value:n.folder_id}))}}catch{return{disabled:!0,options:[],placeholder:"Could not load folders."}}},"options")});var Q=jr.SecretText({displayName:"API Key",description:`
1
+ "use strict";var du=Object.create;var rt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty;var o=(e,t)=>rt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)rt(e,r,{get:t[r],enumerable:!0})},bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!yu.call(e,i)&&i!==r&&rt(e,i,{get:()=>t[i],enumerable:!(n=mu(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?du(gu(e)):{},bn(t||!e||!e.__esModule?rt(r,"default",{value:e,enumerable:!0}):r,e)),hu=e=>bn(rt({},"__esModule",{value:!0}),e);var qo=E((Wo,qt)=>{(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"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(p.zoneIndex)||[])[0],P,M;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(M=d-y,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let te=s.split(":"),me=[];for(let be=0;be<te.length;be++)me.push(parseInt(te[be],16));return me})(),{parts:d,zoneId:x}}o(g,"expandIPv6");function v(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[x]>>P!==d[x]>>P)return!1;m-=y,x+=1}return!0}o(v,"matchCIDR");function h(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(h,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,M;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in m){if(M=m[P],y&&M!==0)return null;M!==8&&(y=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let M=0;M<x.length;M++)y=x[M],P.push(h(y));return P})();if(d=s.match(r.longValue)){if(m=h(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(m>>P&255);return x})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(m=h(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(m=h(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(h(x[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,y){let m,x;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={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,P;for(let M=7;M>=0;M-=1)if(x=this.parts[M],x in m){if(P=m[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(T(this.parts[x].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new _.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(m=P.index,x=P[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,y,m,x,P,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return g(s,8);if((m=s.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,y){let m,x,P,M;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return x}return y},typeof qt<"u"&&qt.exports?qt.exports=_:e.ipaddr=_})(Wo)});var Yi=E((HA,Xi)=>{var Ji=require("stream").Stream,tl=require("util");Xi.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");tl.inherits(ue,Ji);ue.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=Ji.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.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)};ue.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 ra=E((WA,ta)=>{var rl=require("util"),ea=require("stream").Stream,Qi=Yi();ta.exports=K;function K(){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}o(K,"CombinedStream");rl.inherits(K,ea);K.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};K.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};K.prototype.append=function(e){var t=K.isStreamLike(e);if(t){if(!(e instanceof Qi)){var r=Qi.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};K.prototype.pipe=function(e,t){return ea.prototype.pipe.call(this,e,t),this.resume(),e};K.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}};K.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=K.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};K.prototype._pipeNext=function(e){this._currentStream=e;var t=K.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()};K.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};K.prototype.write=function(e){this.emit("data",e)};K.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};K.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")};K.prototype.end=function(){this._reset(),this.emit("end")};K.prototype.destroy=function(){this._reset(),this.emit("close")};K.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};K.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};K.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)};K.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var oa=E((KA,na)=>{"use strict";na.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 sa=E(re=>{"use strict";var Qt=oa(),nl=require("path").extname,ia=/^\s*([^;\s]*)(?:;|\s|$)/,ol=/^text\//i;re.charset=aa;re.charsets={lookup:aa};re.contentType=il;re.extension=al;re.extensions=Object.create(null);re.lookup=sl;re.types=Object.create(null);ul(re.extensions,re.types);function aa(e){if(!e||typeof e!="string")return!1;var t=ia.exec(e),r=t&&Qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ol.test(t[1])?"UTF-8":!1}o(aa,"charset");function il(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}o(il,"contentType");function al(e){if(!e||typeof e!="string")return!1;var t=ia.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(al,"extension");function sl(e){if(!e||typeof e!="string")return!1;var t=nl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(sl,"lookup");function ul(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Qt).forEach(o(function(i){var u=Qt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var g=c[p];if(t[g]){var v=r.indexOf(Qt[t[g]].source),h=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(v>h||v===h&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(ul,"populateMaps")});var ca=E((YA,ua)=>{ua.exports=cl;function cl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(cl,"defer")});var Jr=E((ez,la)=>{var pa=ca();la.exports=pl;function pl(e){var t=!1;return pa(function(){t=!0}),o(function(n,i){t?e(n,i):pa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(pl,"async")});var Xr=E((rz,da)=>{da.exports=ll;function ll(e){Object.keys(e.jobs).forEach(dl.bind(e)),e.jobs={}}o(ll,"abort");function dl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(dl,"clean")});var Yr=E((oz,fa)=>{var ma=Jr(),ml=Xr();fa.exports=fl;function fl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=gl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ml(r):r.results[i]=c,n(u,r.results))})}o(fl,"iterate");function gl(e,t,r,n){var i;return e.length==2?i=e(r,ma(n)):i=e(r,t,ma(n)),i}o(gl,"runJob")});var Qr=E((az,ga)=>{ga.exports=yl;function yl(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(i,u){return t(e[i],e[u])}),n}o(yl,"state")});var en=E((uz,ya)=>{var hl=Xr(),vl=Jr();ya.exports=xl;function xl(e){Object.keys(this.jobs).length&&(this.index=this.size,hl(this),vl(e)(null,this.results))}o(xl,"terminator")});var va=E((pz,ha)=>{var _l=Yr(),Pl=Qr(),bl=en();ha.exports=Tl;function Tl(e,t,r){for(var n=Pl(e);n.index<(n.keyedList||e).length;)_l(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return bl.bind(n,r)}o(Tl,"parallel")});var tn=E((dz,er)=>{var xa=Yr(),Il=Qr(),El=en();er.exports=Sl;er.exports.ascending=_a;er.exports.descending=$l;function Sl(e,t,r,n){var i=Il(e,r);return xa(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){xa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),El.bind(i,n)}o(Sl,"serialOrdered");function _a(e,t){return e<t?-1:e>t?1:0}o(_a,"ascending");function $l(e,t){return-1*_a(e,t)}o($l,"descending")});var ba=E((fz,Pa)=>{var Al=tn();Pa.exports=zl;function zl(e,t,r){return Al(e,t,null,r)}o(zl,"serial")});var Ia=E((yz,Ta)=>{Ta.exports={parallel:va(),serial:ba(),serialOrdered:tn()}});var rn=E((hz,Ea)=>{"use strict";Ea.exports=Object});var $a=E((vz,Sa)=>{"use strict";Sa.exports=Error});var za=E((xz,Aa)=>{"use strict";Aa.exports=EvalError});var ka=E((_z,Oa)=>{"use strict";Oa.exports=RangeError});var wa=E((Pz,Ra)=>{"use strict";Ra.exports=ReferenceError});var Da=E((bz,Na)=>{"use strict";Na.exports=SyntaxError});var tr=E((Tz,Ca)=>{"use strict";Ca.exports=TypeError});var Ma=E((Iz,Ua)=>{"use strict";Ua.exports=URIError});var ja=E((Ez,La)=>{"use strict";La.exports=Math.abs});var Ba=E((Sz,Fa)=>{"use strict";Fa.exports=Math.floor});var Za=E(($z,Va)=>{"use strict";Va.exports=Math.max});var Ga=E((Az,Ha)=>{"use strict";Ha.exports=Math.min});var qa=E((zz,Wa)=>{"use strict";Wa.exports=Math.pow});var Ja=E((Oz,Ka)=>{"use strict";Ka.exports=Math.round});var Ya=E((kz,Xa)=>{"use strict";Xa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var es=E((wz,Qa)=>{"use strict";var Ol=Ya();Qa.exports=o(function(t){return Ol(t)||t===0?t:t<0?-1:1},"sign")});var rs=E((Dz,ts)=>{"use strict";ts.exports=Object.getOwnPropertyDescriptor});var nn=E((Cz,ns)=>{"use strict";var rr=rs();if(rr)try{rr([],"length")}catch{rr=null}ns.exports=rr});var is=E((Uz,os)=>{"use strict";var nr=Object.defineProperty||!1;if(nr)try{nr({},"a",{value:1})}catch{nr=!1}os.exports=nr});var on=E((Mz,as)=>{"use strict";as.exports=o(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 i=42;t[r]=i;for(var u 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var cs=E((jz,us)=>{"use strict";var ss=typeof Symbol<"u"&&Symbol,kl=on();us.exports=o(function(){return typeof ss!="function"||typeof Symbol!="function"||typeof ss("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:kl()},"hasNativeSymbols")});var an=E((Bz,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var sn=E((Vz,ls)=>{"use strict";var Rl=rn();ls.exports=Rl.getPrototypeOf||null});var fs=E((Zz,ms)=>{"use strict";var wl="Function.prototype.bind called on incompatible ",Nl=Object.prototype.toString,Dl=Math.max,Cl="[object Function]",ds=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Ul=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Ml=o(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");ms.exports=o(function(t){var r=this;if(typeof r!="function"||Nl.apply(r)!==Cl)throw new TypeError(wl+r);for(var n=Ul(arguments,1),i,u=o(function(){if(this instanceof i){var h=r.apply(this,ds(n,arguments));return Object(h)===h?h:this}return r.apply(t,ds(n,arguments))},"binder"),c=Dl(0,r.length-n.length),p=[],g=0;g<c;g++)p[g]="$"+g;if(i=Function("binder","return function ("+Ml(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var v=o(function(){},"Empty");v.prototype=r.prototype,i.prototype=new v,v.prototype=null}return i},"bind")});var qe=E((Gz,gs)=>{"use strict";var Ll=fs();gs.exports=Function.prototype.bind||Ll});var or=E((Wz,ys)=>{"use strict";ys.exports=Function.prototype.call});var un=E((qz,hs)=>{"use strict";hs.exports=Function.prototype.apply});var xs=E((Kz,vs)=>{"use strict";vs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ps=E((Jz,_s)=>{"use strict";var jl=qe(),Fl=un(),Bl=or(),Vl=xs();_s.exports=Vl||jl.call(Bl,Fl)});var Ts=E((Xz,bs)=>{"use strict";var Zl=qe(),Hl=tr(),Gl=or(),Wl=Ps();bs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Hl("a function is required");return Wl(Zl,Gl,t)},"callBindBasic")});var zs=E((Qz,As)=>{"use strict";var ql=Ts(),Is=nn(),Ss;try{Ss=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var cn=!!Ss&&Is&&Is(Object.prototype,"__proto__"),$s=Object,Es=$s.getPrototypeOf;As.exports=cn&&typeof cn.get=="function"?ql([cn.get]):typeof Es=="function"?o(function(t){return Es(t==null?t:$s(t))},"getDunder"):!1});var Ns=E((tO,ws)=>{"use strict";var Os=an(),ks=sn(),Rs=zs();ws.exports=Os?o(function(t){return Os(t)},"getProto"):ks?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ks(t)},"getProto"):Rs?o(function(t){return Rs(t)},"getProto"):null});var pn=E((nO,Ds)=>{"use strict";var Kl=Function.prototype.call,Jl=Object.prototype.hasOwnProperty,Xl=qe();Ds.exports=Xl.call(Kl,Jl)});var Bs=E((oO,Fs)=>{"use strict";var L,Yl=rn(),Ql=$a(),ed=za(),td=ka(),rd=wa(),Ye=Da(),Xe=tr(),nd=Ma(),od=ja(),id=Ba(),ad=Za(),sd=Ga(),ud=qa(),cd=Ja(),pd=es(),Ls=Function,ln=o(function(e){try{return Ls('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),It=nn(),ld=is(),dn=o(function(){throw new Xe},"throwTypeError"),dd=It?(function(){try{return arguments.callee,dn}catch{try{return It(arguments,"callee").get}catch{return dn}}})():dn,Ke=cs()(),Q=Ns(),md=sn(),fd=an(),js=un(),Et=or(),Je={},gd=typeof Uint8Array>"u"||!Q?L:Q(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&Q?Q([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ql,"%eval%":eval,"%EvalError%":ed,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":Ls,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&Q?Q(Q([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!Q?L:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Yl,"%Object.getOwnPropertyDescriptor%":It,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":td,"%ReferenceError%":rd,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!Q?L:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&Q?Q(""[Symbol.iterator]()):L,"%Symbol%":Ke?Symbol:L,"%SyntaxError%":Ye,"%ThrowTypeError%":dd,"%TypedArray%":gd,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":nd,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":js,"%Object.defineProperty%":ld,"%Object.getPrototypeOf%":md,"%Math.abs%":od,"%Math.floor%":id,"%Math.max%":ad,"%Math.min%":sd,"%Math.pow%":ud,"%Math.round%":cd,"%Math.sign%":pd,"%Reflect.getPrototypeOf%":fd};if(Q)try{null.error}catch(e){Cs=Q(Q(e)),Le["%Error.prototype%"]=Cs}var Cs,yd=o(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Le[t]=r,r},"doEval"),Us={__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"]},St=qe(),ir=pn(),hd=St.call(Et,Array.prototype.concat),vd=St.call(js,Array.prototype.splice),Ms=St.call(Et,String.prototype.replace),ar=St.call(Et,String.prototype.slice),xd=St.call(Et,RegExp.prototype.exec),_d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pd=/\\(\\)?/g,bd=o(function(t){var r=ar(t,0,1),n=ar(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return Ms(t,_d,function(u,c,p,g){i[i.length]=p?Ms(g,Pd,"$1"):c||u}),i},"stringToPath"),Td=o(function(t,r){var n=t,i;if(ir(Us,n)&&(i=Us[n],n="%"+i[0]+"%"),ir(Le,n)){var u=Le[n];if(u===Je&&(u=yd(n)),typeof u>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Fs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(xd(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=bd(t),i=n.length>0?n[0]:"",u=Td("%"+i+"%",r),c=u.name,p=u.value,g=!1,v=u.alias;v&&(i=v[0],vd(n,hd([0,1],v)));for(var h=1,T=!0;h<n.length;h+=1){var _=n[h],s=ar(_,0,1),d=ar(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ye("property names with quotes must have matching quotes");if((_==="constructor"||!T)&&(g=!0),i+="."+_,c="%"+i+"%",ir(Le,c))p=Le[c];else if(p!=null){if(!(_ in p)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(It&&h+1>=n.length){var y=It(p,_);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else T=ir(p,_),p=p[_];T&&!g&&(Le[c]=p)}}return p},"GetIntrinsic")});var Zs=E((aO,Vs)=>{"use strict";var Id=on();Vs.exports=o(function(){return Id()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ws=E((uO,Gs)=>{"use strict";var Ed=Bs(),Hs=Ed("%Object.defineProperty%",!0),Sd=Zs()(),$d=pn(),Ad=tr(),sr=Sd?Symbol.toStringTag:null;Gs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Ad("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");sr&&(n||!$d(t,sr))&&(Hs?Hs(t,sr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[sr]=r)},"setToStringTag")});var Ks=E((pO,qs)=>{"use strict";var zd=Function.prototype.call,Od=Object.prototype.hasOwnProperty,kd=qe();qs.exports=kd.call(zd,Od)});var Xs=E((lO,Js)=>{"use strict";Js.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var hn=E((dO,Qs)=>{"use strict";var yn=ra(),Rd=require("util"),mn=require("path"),wd=require("http"),Nd=require("https"),Dd=require("url").parse,Cd=require("fs"),Ud=require("stream").Stream,Md=require("crypto"),fn=sa(),Ld=Ia(),jd=Ws(),we=Ks(),gn=Xs();function Ys(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ys,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],yn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(B,"FormData");Rd.inherits(B,yn);B.LINE_BREAK=`\r
2
+ `;B.DEFAULT_CONTENT_TYPE="application/octet-stream";B.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=yn.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 i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};B.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)+B.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof Ud))&&(r.knownLength||this._valuesToMeasure.push(t))};B.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Cd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};B.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ys(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&gn(c,r.header);var p;for(var g in c)if(we(c,g)){if(p=c[g],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=g+": "+p.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+u+B.LINE_BREAK};B.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=mn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=mn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=mn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ys(r)+'"'};B.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=fn.lookup(e.name)),!r&&e&&e.path&&(r=fn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=fn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=B.DEFAULT_CONTENT_TYPE),r};B.prototype._multiPartFooter=function(){return function(e){var t=B.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};B.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+B.LINE_BREAK};B.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};B.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};B.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};B.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(B.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};B.prototype._generateBoundary=function(){this._boundary="--------------------------"+Md.randomBytes(12).toString("hex")};B.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};B.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};B.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}Ld.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Dd(e),n=gn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=gn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Nd.request(n):r=wd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,g=o(function(v,h){return r.removeListener("error",g),r.removeListener("response",p),t.call(this,v,h)},"callback");p=g.bind(this,null),r.on("error",g),r.on("response",p)}}.bind(this)),r};B.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};B.prototype.toString=function(){return"[object FormData]"};jd(B.prototype,"FormData");Qs.exports=B});var Kd={};Pn(Kd,{cambAi:()=>qd});module.exports=hu(Kd);var vu=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,g);let v=c.prototype,h=Object.keys(v);for(let T=0;T<h.length;T++){let _=h[T];_ in p||(p[_]=v[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var g;let v=r?.Parent?new u:this;n(v,p),(g=v._zod).deferred??(g.deferred=[]);for(let h of v._zod.deferred)h();return v}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},At=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function ge(e){return e&&Object.assign(cr,e),cr}o(ge,"config");function lr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(lr,"getEnumValues");function In(e,t){return typeof t=="bigint"?t.toString():t}o(In,"jsonStringifyReplacer");function Ot(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Ot,"cached");function En(e){return e==null}o(En,"nullish");function kt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(kt,"cleanRegex");var Tn=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(nt,"isObject");var xu=Ot(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sn(e){if(nt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(nt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Sn,"isPlainObject");var $n=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function Rt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Rt,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function An(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(An,"optionalKeys");var zn={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 Fe(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}o(Fe,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function zt(e){return typeof e=="string"?e:e?.message}o(zt,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=zt(e.inst?._zod.def?.error?.(e))??zt(t?.error?.(e))??zt(r.customError?.(e))??zt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ee,"finalizeIssue");function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(On,"getLengthableOrigin");function mr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(mr,"issue");var kn=o((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,In,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Rn=b("$ZodError",kn),ot=b("$ZodError",kn,{Parent:Error});var Pu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ce;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(g=>Ee(g,u,ge())));throw dr(p,i?.callee),p}return c.value},"_parse"),wt=Pu(ot),bu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(g=>Ee(g,u,ge())));throw dr(p,i?.callee),p}return c.value},"_parseAsync"),Nt=bu(ot),Tu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new ce;return u.issues.length?{success:!1,error:new(e??Rn)(u.issues.map(c=>Ee(c,i,ge())))}:{success:!0,data:u.value}},"_safeParse"),it=Tu(ot),Iu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ee(c,i,ge())))}:{success:!0,data:u.value}},"_safeParseAsync"),at=Iu(ot);var Eu="(?:(?:\\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])))",Su=new RegExp(`^${Eu}$`);var wn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Nn=/^-?\d+n?$/,Dn=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i;var Se=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),$u={number:"number",bigint:"bigint",object:"date"};var Un=b("$ZodCheckGreaterThan",(e,t)=>{Se.init(e,t);let r=$u[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.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 Mn=b("$ZodCheckNumberFormat",(e,t)=>{Se.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=zn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Dn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,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}):c.issues.push({input:p,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}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Ln=b("$ZodCheckMinLength",(e,t)=>{var r;Se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!En(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=On(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var gr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Se.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),jn=b("$ZodCheckRegex",(e,t)=>{gr.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 Bn={major:4,minor:3,patch:6};var q=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,g)=>{let v=Fe(c),h;for(let T of p){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(v)continue;let _=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new ce;if(h||s instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(v||(v=Fe(c,_)))});else{if(c.issues.length===_)continue;v||(v=Fe(c,_))}}return h?h.then(()=>c):c},"runChecks"),u=o((c,p,g)=>{if(Fe(c))return c.aborted=!0,c;let v=i(p,n,g);if(v instanceof Promise){if(g.async===!1)throw new ce;return v.then(h=>e._zod.parse(h,g))}return e._zod.parse(v,g)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let v=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return v instanceof Promise?v.then(h=>u(h,c,p)):u(v,c,p)}let g=e._zod.parse(c,p);if(g instanceof Promise){if(p.async===!1)throw new ce;return g.then(v=>i(v,n,p))}return i(g,n,p)}}J(e,"~standard",()=>({validate:o(i=>{try{let u=it(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return at(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ut=b("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wn(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}}),yr=b("$ZodStringFormat",(e,t)=>{gr.init(e,t),Ut.init(e,t)});var Wn=b("$ZodURL",(e,t)=>{yr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var hr=b("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??fr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),qn=b("$ZodNumberFormat",(e,t)=>{Mn.init(e,t),hr.init(e,t)}),vr=b("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Cn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Kn=b("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Nn,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 Jn=b("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Xn=b("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r});var Yn=b("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Qn=b("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Vn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(Vn,"handleArrayResult");var eo=b("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],g=t.element._zod.run({value:p,issues:[]},n);g instanceof Promise?u.push(g.then(v=>Vn(v,r,c))):Vn(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ct(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ct,"handlePropertyResult");function Au(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=An(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Au,"normalizeDef");function zu(e,t,r,n,i,u){let c=[],p=i.keySet,g=i.catchall._zod,v=g.def.type,h=g.optout==="optional";for(let T in t){if(p.has(T))continue;if(v==="never"){c.push(T);continue}let _=g.run({value:t[T],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Ct(s,r,T,t,h))):Ct(_,r,T,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(zu,"handleCatchall");var to=b("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...p};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Ot(()=>Au(t));J(e._zod,"propValues",()=>{let p=t.shape,g={};for(let v in p){let h=p[v]._zod;if(h.values){g[v]??(g[v]=new Set);for(let T of h.values)g[v].add(T)}}return g});let i=nt,u=t.catchall,c;e._zod.parse=(p,g)=>{c??(c=n.value);let v=p.value;if(!i(v))return p.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),p;p.value={};let h=[],T=c.shape;for(let _ of c.keys){let s=T[_],d=s._zod.optout==="optional",y=s._zod.run({value:v[_],issues:[]},g);y instanceof Promise?h.push(y.then(m=>Ct(m,p,_,v,d))):Ct(y,p,_,v,d)}return u?zu(h,v,p,g,n.value,e):h.length?Promise.all(h).then(()=>p):p}});function Zn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Fe(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ee(c,n,ge())))}),t)}o(Zn,"handleUnionResults");var xr=b("$ZodUnion",(e,t)=>{q.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>kt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let g of t.options){let v=g._zod.run({value:i.value,issues:[]},u);if(v instanceof Promise)p.push(v),c=!0;else{if(v.issues.length===0)return v;p.push(v)}}return c?Promise.all(p).then(g=>Zn(g,i,e,u)):Zn(p,i,e,u)}});var ro=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,g]of Object.entries(c)){i[p]||(i[p]=new Set);for(let v of g)i[p].add(v)}}return i});let n=Ot(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of p){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!nt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var no=b("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Sn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let v of c)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){p.add(typeof v=="number"?v.toString():v);let h=t.valueType._zod.run({value:i[v],issues:[]},n);h instanceof Promise?u.push(h.then(T=>{T.issues.length&&r.issues.push(...Ie(v,T.issues)),r.value[v]=T.value})):(h.issues.length&&r.issues.push(...Ie(v,h.issues)),r.value[v]=h.value)}let g;for(let v in i)p.has(v)||(g=g??[],g.push(v));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let g=t.keyType._zod.run({value:p,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&fr.test(p)&&g.issues.length){let T=t.keyType._zod.run({value:Number(p),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(g=T)}if(g.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(T=>Ee(T,n,ge())),input:p,path:[p],inst:e});continue}let h=t.valueType._zod.run({value:i[p],issues:[]},n);h instanceof Promise?u.push(h.then(T=>{T.issues.length&&r.issues.push(...Ie(p,T.issues)),r.value[g.value]=T.value})):(h.issues.length&&r.issues.push(...Ie(p,h.issues)),r.value[g.value]=h.value)}}return u.length?Promise.all(u).then(()=>r):r}});var oo=b("$ZodEnum",(e,t)=>{q.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>$n.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),io=b("$ZodLiteral",(e,t)=>{if(q.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"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var ao=b("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new At(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Hn,"handleOptionalResult");var so=b("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Hn(u,r.value)):Hn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var uo=b("$ZodNullable",(e,t)=>{q.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(r.source)}|null)$`):void 0}),J(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 co=b("$ZodPipe",(e,t)=>{q.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Dt(c,t.in,n)):Dt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Dt(u,t.out,n)):Dt(i,t.out,n)}});function Dt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Dt,"handlePipeResult");var po=b("$ZodCustom",(e,t)=>{Se.init(e,t),q.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Gn(u,r,n,e));Gn(i,r,n,e)}});function Gn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(mr(i))}}o(Gn,"handleRefineResult");var mo;var _r=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function fo(){return new _r}o(fo,"registry");(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=fo());var Pr=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...Z(t)})}o(go,"_string");function yo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(yo,"_coercedString");function ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(ho,"_url");function vo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(vo,"_number");function xo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(xo,"_coercedNumber");function _o(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(_o,"_int");function Po(e,t){return new e({type:"boolean",...Z(t)})}o(Po,"_boolean");function bo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(bo,"_coercedBoolean");function To(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(To,"_coercedBigint");function Io(e){return new e({type:"any"})}o(Io,"_any");function Eo(e){return new e({type:"unknown"})}o(Eo,"_unknown");function So(e,t){return new e({type:"void",...Z(t)})}o(So,"_void");function $o(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o($o,"_coercedDate");function Mt(e,t){return new Un({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Mt,"_gte");function ae(e,t){return new Ln({check:"min_length",...Z(t),minimum:e})}o(ae,"_minLength");function $e(e,t){return new jn({check:"string_format",format:"regex",...Z(t),pattern:e})}o($e,"_regex");function Ao(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Ao,"_custom");var X=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");q.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>it(e,r,n),e.parseAsync=async(r,n)=>Nt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>at(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)=>Rt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),jt=b("ZodMiniString",(e,t)=>{Ut.init(e,t),X.init(e,t)});function a(e){return go(jt,e)}o(a,"string");var zo=b("ZodMiniStringFormat",(e,t)=>{yr.init(e,t),jt.init(e,t)});var Bu=b("ZodMiniURL",(e,t)=>{Wn.init(e,t),zo.init(e,t)});function Oo(e){return ho(Bu,e)}o(Oo,"url");var Ft=b("ZodMiniNumber",(e,t)=>{hr.init(e,t),X.init(e,t)});function Y(e){return vo(Ft,e)}o(Y,"number");var Vu=b("ZodMiniNumberFormat",(e,t)=>{qn.init(e,t),Ft.init(e,t)});function ko(e){return _o(Vu,e)}o(ko,"int");var br=b("ZodMiniBoolean",(e,t)=>{vr.init(e,t),X.init(e,t)});function F(e){return Po(br,e)}o(F,"boolean");var Ro=b("ZodMiniBigInt",(e,t)=>{Kn.init(e,t),X.init(e,t)});var Zu=b("ZodMiniAny",(e,t)=>{Jn.init(e,t),X.init(e,t)});function ut(){return Io(Zu)}o(ut,"any");var Hu=b("ZodMiniUnknown",(e,t)=>{Xn.init(e,t),X.init(e,t)});function N(){return Eo(Hu)}o(N,"unknown");var Gu=b("ZodMiniVoid",(e,t)=>{Yn.init(e,t),X.init(e,t)});function wo(e){return So(Gu,e)}o(wo,"_void");var No=b("ZodMiniDate",(e,t)=>{Qn.init(e,t),X.init(e,t)});var Wu=b("ZodMiniArray",(e,t)=>{eo.init(e,t),X.init(e,t)});function O(e,t){return new Wu({type:"array",element:e,...Z(t)})}o(O,"array");var qu=b("ZodMiniObject",(e,t)=>{to.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new qu(r)}o(l,"object");var Ku=b("ZodMiniUnion",(e,t)=>{xr.init(e,t),X.init(e,t)});function U(e,t){return new Ku({type:"union",options:e,...Z(t)})}o(U,"union");var Ju=b("ZodMiniDiscriminatedUnion",(e,t)=>{ro.init(e,t),X.init(e,t)});function Ae(e,t,r){return new Ju({type:"union",options:t,discriminator:e,...Z(r)})}o(Ae,"discriminatedUnion");var Xu=b("ZodMiniRecord",(e,t)=>{no.init(e,t),X.init(e,t)});function D(e,t,r){return new Xu({type:"record",keyType:e,valueType:t,...Z(r)})}o(D,"record");var Yu=b("ZodMiniEnum",(e,t)=>{oo.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function $(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Yu({type:"enum",entries:r,...Z(t)})}o($,"_enum");var Qu=b("ZodMiniLiteral",(e,t)=>{io.init(e,t),X.init(e,t)});function S(e,t){return new Qu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(S,"literal");var ec=b("ZodMiniTransform",(e,t)=>{ao.init(e,t),X.init(e,t)});function ze(e){return new ec({type:"transform",transform:e})}o(ze,"transform");var tc=b("ZodMiniOptional",(e,t)=>{so.init(e,t),X.init(e,t)});function f(e){return new tc({type:"optional",innerType:e})}o(f,"optional");var rc=b("ZodMiniNullable",(e,t)=>{uo.init(e,t),X.init(e,t)});function ct(e){return new rc({type:"nullable",innerType:e})}o(ct,"nullable");var nc=b("ZodMiniPipe",(e,t)=>{co.init(e,t),X.init(e,t)});function Oe(e,t){return new nc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var oc=b("ZodMiniCustom",(e,t)=>{po.init(e,t),X.init(e,t)});function Bt(e,t){return Ao(oc,e??(()=>!0),t)}o(Bt,"custom");var pt={};Pn(pt,{bigint:()=>pc,boolean:()=>cc,date:()=>lc,number:()=>uc,string:()=>sc});function sc(e){return yo(jt,e)}o(sc,"string");function uc(e){return xo(Ft,e)}o(uc,"number");function cc(e){return bo(br,e)}o(cc,"boolean");function pc(e){return To(Ro,e)}o(pc,"bigint");function lc(e){return $o(No,e)}o(lc,"date");var Ir=l({retryOnFailure:l({defaultValue:f(F()),hide:f(F())}),continueOnFailure:l({defaultValue:f(F()),hide:f(F())})}),Tr=class{constructor(t,r,n,i,u,c,p,g,v,h,T,_,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=p;this.requireAuth=g;this.errorHandlingOptions=v;this.outputSchema=h;this.audience=T;this.aiMetadata=_;this.classification=s}static{o(this,"IAction")}},pe=o(e=>new Tr(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 j=l({displayName:a(),description:f(a()),advanced:f(F()),width:f($(["half","full"])),icon:f(a()),placeholder:f(a())}),C=o((e,t)=>l({type:S(t),required:F(),defaultValue:f(ut())}),"TPropertyValue");var ne=l({...j.shape,...C(a(),"SHORT_TEXT").shape}),ye=l({...j.shape,...C(a(),"LONG_TEXT").shape});var Co=l({label:a(),value:N(),description:f(a()),icon:f(a())}),Vt=l({disabled:f(F()),placeholder:f(a()),options:O(Co)});var mc=$(["cards"]),oe=l({...j.shape,options:Vt,display:f(mc),...C(N(),"STATIC_DROPDOWN").shape}),he=l({...j.shape,options:Vt,...C(O(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=l({...j.shape,...C(N(),"DROPDOWN").shape,refreshers:O(a())}),lt=l({...j.shape,...C(O(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:O(a())});var ve=l({...j.shape,reveals:f(O(a())),...C(F(),"CHECKBOX").shape});var xe=l({...j.shape,display:f($(["stepper"])),min:f(Y()),max:f(Y()),step:f(Y()),...C(Y(),"NUMBER").shape});var dt=l({...j.shape,streaming:f(F()),...C(N(),"FILE").shape});var mt=l({...j.shape,...C(a(),"DATE_TIME").shape});var Uo=D(a(),U([ne,ye,oe,lt,he,ve,xe,dt,mt])),ft=l({...j.shape,properties:Uo,...C(O(N()),"ARRAY").shape});var Mo=$(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Lo=l({preset:f(Mo),after:f(a()),before:f(a())}),Sr=l({...j.shape,display:f($(["dropdown"])),...C(Lo,"DATE_RANGE").shape});var gt=l({...j.shape,...C(U([D(a(),N())]),"JSON").shape});var jo=U([ne,oe,gt,ft,he]),fc=D(a(),jo),$r=l({refreshers:O(a()),...j.shape,...C(N(),"DYNAMIC").shape});var Zt=l({...j.shape,...C(wo(),"MARKDOWN").shape});var yt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(yt||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(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))(Ve||{});var ht=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ht||{}),Ar="both_client_credentials_and_authorization_code";var Ce=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ce||{}),vt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(vt||{}),gc=l({strategy:$(vt),paramName:f(a())}),xt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(xt||{});var Ht=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ht||{}),Fo=l({status:f(Y()),body:f(N()),headers:f(D(a(),a()))}),Bo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f($(Ht))}),Vo=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Fo,handlerId:f(a()),streamStepProgress:f($(Ht))}),yc=U([Bo,Vo]);var hc=l({body:N(),rawBody:f(N()),headers:D(a(),a()),queryParams:D(a(),a())});function se(e){return e==null}o(se,"isNil");function _t(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(_t,"isEmpty");function Gt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Gt,"assertNotNullOrUndefined");var zr=De(require("crypto"),1);var vc=128,ke,Ze,xc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*vc),zr.default.randomFillSync(ke),Ze=0):Ze+e>ke.length&&(zr.default.randomFillSync(ke),Ze=0)}catch(t){throw ke=void 0,t}Ze+=e},"fillPool"),_c=o(e=>(xc(e|=0),ke.subarray(Ze-e,Ze)),"random"),Pc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let c="";for(;;){let p=r(i),g=i;for(;g--;)if(c+=e[p[g]&n]||"",c.length===u)return c}}},"customRandom"),Ho=o((e,t=21)=>Pc(e,t,_c),"customAlphabet");var bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,Nb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),Tc=Ho(bc,Go);var Re=Oe(ze(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Re,updated:Re},W=o(e=>f(ct(e)),"Nullable");function Or(e){return f(ct($(e)))}o(Or,"NullableEnum");var Ub=Oe(ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(F())),Wt=o(e=>Oe(ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(O(e))),"OptionalArrayFromQuery");var jb=D(a(),N());var Pt=(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))(Pt||{});var Yb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var eT=l({filename:a(),data:N(),type:S("file"),mimetype:f(a())});var Ic=De(qo());var sT=l({...ie,name:a(),permissions:O(a()),platformId:W(a()),type:a(),userCount:f(Y())});var Ko=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ko||{}),kr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(kr||{}),Rr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Rr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var Ec=l({mode:$(Ko),value:N()}),Sc=l({auth:f(a()),fields:D(a(),Ec)}),$c=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(Sc)}),Ac=l({type:S("PIECE"),toolName:a().check(ae(1)),pieceMetadata:$c}),zc=l({type:S("none")}),Oc=l({type:S("access_token"),accessToken:a()}),kc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Rc=l({type:S("headers"),headers:D(a(),a())}),wc=Ae("type",[zc,Oc,kc,Rc]),Jo=l({type:S("FLOW"),toolName:a().check(ae(1)),externalFlowId:a(),flowDisplayName:f(a())}),Xo=l({type:S("MCP"),toolName:a().check(ae(1)),serverUrl:Oo(),protocol:$(Rr),auth:wc}),Yo=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(ae(1)),sourceType:$(kr),sourceId:a(),sourceName:a()}),Nc=Ae("type",[Ac,Jo,Xo,Yo]),Dc=l({displayName:a(),description:f(a()),type:$(wr)}),Qo=l({type:S("MARKDOWN"),markdown:a()}),He={type:S("TOOL_CALL"),input:W(D(a(),N())),output:f(N()),toolName:a(),status:$(Nr),toolCallId:a(),startTime:a(),endTime:f(a())},MT=l(He),ei=Ae("toolCallType",[l({...He,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...He,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...He,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...He,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...He,toolCallType:S("UNKNOWN"),displayName:a()})]),Cc=U([Qo,ei]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),_e=l({apiKey:a()}),Uc=_e,Mc=l({apiKey:a(),apiKeyHash:a()}),Lc=_e,jc=_e,Fc=_e,Bc=_e,Vc=_e,Zc=_e,Hc=_e,ii=l({accessKeyId:a().check(ae(1)),secretAccessKey:a().check(ae(1))}),Gc=l({}),Wc=l({}),qc=l({}),Kc=l({}),Jc=l({}),Xc=l({}),ai=l({modelId:a(),modelName:a(),modelType:$(Dr)}),si=l({apiKeyHeader:a(),baseUrl:a(),models:O(ai),defaultHeaders:f(D(a(),a()))}),ui=l({accountId:a(),gatewayId:a(),models:O(ai),vertexProject:f(a()),vertexRegion:f(a())}),ci=l({resourceName:a(),apiVersion:Oe(ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),pi=l({region:a().check(ae(1))}),Yc=U([Uc,Fc,Bc,Vc,Zc,jc,Lc,Mc,ii,Hc]),li=U([si,ui,ci,pi,Gc,qc,Kc,Jc,Wc,Xc]),Qc=l({id:a(),name:a(),type:$(Dr)}),ep=l({id:a(),name:a(),provider:$(Pt),config:li,enabledForChat:F()}),tp=l({provider:$(Pt),config:li,auth:Yc,platformId:a()});var BT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],rp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],np=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],op=["grok-4.20","grok-4.1-fast"],ip={openai:ti,anthropic:rp,google:ri,activepieces:[...np.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...op.map(e=>`x-ai/${e}`)]};var ni=128e3,ap={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function sp({provider:e}){return e?ap[e]??ni:ni}o(sp,"getMaxContextTokens");var oi={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"},up={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},cp=new Set(["anthropic","mistral"]);function le(e){return{chatModels:ip[e],maxContextTokens:sp({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!cp.has(e),webSearch:up[e]}}o(le,"buildProviderCapabilities");var pp={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var lp=l({base64Url:a(),fileName:a(),extension:f(a())}),dp=l({mimeType:a(),url:a(),fileName:f(a())}),Cr=U([lp,dp]);var mp=U([l({type:S("file"),value:Cr}),l({type:S("markdown"),value:a(),files:f(O(Cr))})]),fp=l({sessionId:a(),message:a(),files:f(O(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var gp=U([l({...ie,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:O(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:U([S("TEXT"),S("NUMBER"),S("DATE"),S("DATETIME")]),tableId:a(),projectId:a()})]),yp=l({...ie,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:Or(fi),trigger:Or(mi)}),hp=l({...ie,tableId:a(),projectId:a(),cells:D(a(),l({updated:a(),created:a(),value:N(),fieldName:a()}))}),vp=l({events:O($(Ur)),webhookUrl:a(),flowId:a()}),xp=l({fields:O(l({id:a(),name:a()})),rows:O(D(a(),a())),name:a()}),_p=l({projectId:a(),limit:f(pt.number()),cursor:f(a()),name:f(a()),externalIds:Wt(a()),folderId:f(a()),folderIds:Wt(a())}),Pp=l({records:O(O(l({fieldId:a(),value:yi()}))),tableId:a()}),bp=l({cells:f(O(l({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:f(F())}),gi=Ae("operator",[Ue("eq"),Ue("neq"),Ue("gt"),Ue("gte"),Ue("lt"),Ue("lte"),Ue("co"),di("exists"),di("not_exists")]),Tp=l({tableId:a(),limit:f(pt.number()),cursor:f(a()),filters:Wt(gi)});function yi(){return Oe(ze(e=>e==null?e:String(e)),ct(a()))}o(yi,"coerceToString");function Ue(e){return l({fieldId:a(),operator:S(e),value:a()})}o(Ue,"valueFilter");function di(e){return l({fieldId:a(),operator:S(e)})}o(di,"existenceFilter");var Ip=l({status:f(Y()),body:f(N()),headers:f(D(a(),a()))}),Ep=l({...ie,deleted:W(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var hi=l({name:a(),description:f(a()),type:a(),required:F()}),Sp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:O(hi),returnsResponse:F()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",sI=new RegExp(vi),Ap="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",uI=a().check($e(new RegExp(vi))),cI=a().check($e(new RegExp(Ap))),zp=l({packageType:S("ARCHIVE"),pieceType:$(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),pI=U([xi,_i]),lI=U([zp,xi,_i]);var Op=Ae("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:ko().check(Mt(6e4))})]),dI=l({...ie,type:$(Ce),projectId:a(),flowId:a(),triggerName:a(),schedule:W(Op),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:F()}),Pi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),mI=l({...ie,projectId:W(a()),platformId:W(a()),type:$(Pi),compression:$(bi),data:f(N()),location:$(Ti),size:W(Y()),fileName:W(a()),s3Key:W(a()),metadata:W(D(a(),a()))}),Ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ii||{}),Ei=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ei||{}),fI=l({id:a(),email:a(),firstName:a(),status:$(Ei),externalId:W(a()),platformId:W(a()),platformRole:$(Ii),lastName:a(),created:Re,updated:Re,lastActiveDate:W(Re),imageUrl:W(a())});var Mr=l({...j.shape,...C(D(a(),N()),"OBJECT").shape});var Lr=l({...j.shape,formatProperty:f(a()),...C(a(),"RICH_TEXT").shape});var zi=l({...j.shape,...C(a(),"COLOR").shape});var jr=U([ne,ye,Lr,Zt,ve,oe,he,Er,lt,$r,xe,ft,Mr,gt,mt,Sr,dt,zi]),A={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 de=l({displayName:a(),description:f(a()),hasConnectionIdentifier:f(F())});var Oi=l({username:a(),password:a()}),Fr=l({...de.shape,username:l({displayName:a(),description:f(a())}),password:l({displayName:a(),description:f(a())}),...C(Oi,"BASIC_AUTH").shape});var Np=D(a(),U([ne,ye,xe,ve,oe])),Br=l({...de.shape,props:Np,...C(N(),"CUSTOM_AUTH").shape});var Me=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Dp=D(a(),U([ne,ye,Me,xe,ve,oe,he,Zt])),ki=l({...de.shape,props:Dp,...C(N(),"OIDC").shape});var Vr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Vr||{}),Ri=U([ne,Me,oe]),wi=D(a(),Ri),Cp=l({props:f(D(a(),Ri)),authUrl:a(),tokenUrl:a(),scope:O(a()),prompt:f(U([S("none"),S("consent"),S("login"),S("omit")])),pkce:f(F()),pkceMethod:f(U([S("plain"),S("S256")])),authorizationMethod:f($(Vr)),grantType:f(U([$(ht),S(Ar)])),extra:f(D(a(),a()))}),Ni=l({access_token:a(),props:f(wi),data:D(a(),ut())}),Zr=l({...de.shape,...Cp.shape,...C(Ni,"OAUTH2").shape});var Ge=U([Fr,Br,ki,Zr,Me]),bt="Connection",Hr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||bt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||bt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||bt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||bt}},None(){}};var XE={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 Up=l({...j.shape,...C(N(),"CUSTOM").shape,code:a()});var Mp=U([jr,Ge]),Gr=D(a(),Mp),vS=D(a(),jr);var Di=U([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var Ci="2",Kt="0.82.0";var Wr=class{constructor(t,r,n,i,u,c,p,g,v=Kt,h,T="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=g;this.minimumSupportedRelease=v;this.maximumSupportedRelease=h;this.description=T;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ci}),"getContextInfo");(!jp(v)||Fp(v,Kt))&&(this.minimumSupportedRelease=Kt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(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:Lp(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}},Mi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(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 Lp(e){if(e!==void 0)return Array.isArray(e)?e.map(Ui):Ui(e)}o(Lp,"withConnectionIdentifierFlag");function Ui(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Ui,"flagConnectionIdentifier");function jp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(jp,"isValidSimpleSemver");function Fp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Fp,"isSemverLessThan");var Bp=f(D(a(),D(a(),a()))),Li=l({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:O(a()),platformId:f(a()),directoryPath:f(a()),auth:f(U([Ge,O(Ge)])),version:a(),categories:f(O($(Ve))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(F()),i18n:Bp}),Vp=$(["human","ai","both"]),ji=l({description:f(a()),idempotent:f(F())}),Fi=$(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Zp=$(["tabs","section","summary","builder","footer"]),Bi=l({key:a(),display:Zp,label:f(a()),description:f(a()),icon:f(a()),props:O(a())}),Vi=l({name:a(),displayName:a(),description:a(),props:Gr,propertyGroups:f(O(Bi)),requireAuth:F(),errorHandlingOptions:f(Ir),outputSchema:f(Bt()),audience:f(Vp),aiMetadata:f(ji),classification:f(Fi)}),Zi=l({name:a(),displayName:a(),description:a(),props:Gr,propertyGroups:f(O(Bi)),errorHandlingOptions:f(Ir),type:$(Ce),sampleData:N(),handshakeConfiguration:f(Bt()),renewConfiguration:f(Di),testStrategy:$(xt),outputSchema:f(Bt()),aiMetadata:f(ji),classification:f(Fi)}),Hp=l({...Li.shape,actions:D(a(),Vi),triggers:D(a(),Zi)}),Gp=l({...Li.shape,actions:Y(),triggers:Y(),suggestedActions:f(O(Vi)),suggestedTriggers:f(O(Zi))}),Hi=l({projectUsage:Y(),pieceType:$(Be),packageType:$(yt),platformId:f(a()),archiveId:f(a())}),_$=l({...Hp.shape,...Hi.shape}),P$=l({...Gp.shape,...Hi.shape}),b$=l({name:a(),version:a()});var Wp=De(require("path")),qp=De(require("fs/promises"));var We=require("node:stream");var Jt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}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 Xt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new qr,r=new Kr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},qr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Kr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Tt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(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 Gi({error:e,requestBody:t}){return e instanceof Tt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Gi,"toFailsafeOutput");var Pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Pe||{});var Yt=class extends Jt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Xt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,te]of Object.entries(c))i.append(M,te);let p=i.toString(),g=p?`${n}?${p}`:n,v=t.responseType??"json",h=t.followRedirects??!0,T=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Kp(t.method)?Jp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Yp({...u,...s}),m=await Xp(async()=>{let M=new AbortController,te=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let me={method:t.method.toString(),headers:y,body:_,redirect:h?"follow":"manual",signal:M.signal};return d&&(me.duplex="half"),r?.dispatcher!==void 0&&(me.dispatcher=r.dispatcher),await fetch(g,me)}finally{te!==void 0&&clearTimeout(te)}},d?0:T),x=h?300:400;if(m.status<200||m.status>=x){let M=await Wi(m,v==="stream"?"text":v),te=new Tt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",te),te}let P=await Wi(m,v);return{status:m.status,headers:Qp(m.headers),body:P}}};function Kp(e){return e!=="GET"&&e!=="HEAD"}o(Kp,"acceptsRequestBody");function Jp(e,t){if(Ki(e))return{body:void 0,extraHeaders:{},isStream:!1};if(el(e)){let n=new We.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof We.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}}o(Jp,"serializeBody");async function Wi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ki(e.body)?We.Readable.from([]):We.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}}}}o(Wi,"parseResponseBody");async function Xp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await qi(n);continue}return i}catch(i){if(r=i,n<t){await qi(n);continue}throw i}throw r}o(Xp,"sendWithRetries");function qi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(qi,"backoff");function Yp(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}o(Yp,"normalizeHeaders");function Qp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Qp,"toHttpHeaders");function el(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(el,"isNodeFormData");function Ki(e){return e==null}o(Ki,"isNil");var V=new Yt;var Fd=De(require("fs")),eu=De(hn());var Bd={"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 Vd(e){let t=e.split(";")[0].trim().toLowerCase();return Bd[t]??""}o(Vd,"contentTypeToExtension");var Zd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Hd=o((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 tu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:g="headers",classification:v="WRITE"}){return pe({audience:"human",name:u||"custom_api_call",classification:v,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:A.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:A.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Hd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:A.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Pe).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:A.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:A.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:A.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:A.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let T=h,_={};switch(T){case"none":break;case"json":_.data=A.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=A.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=A.Array({displayName:"Form Data",required:!0,properties:{fieldName:A.ShortText({displayName:"Field Name",required:!0}),fieldType:A.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:A.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:A.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:A.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:A.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:A.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:A.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:T,url:_,headers:s,queryParams:d,body:y,body_type:m,failsafe:x,timeout:P,response_is_binary:M,followRedirects:te}=h.propsValue;Gt(T,"Method"),Gt(_,"URL");let me=se(r)?{}:await r(h.auth,h.propsValue),be=_.url,pu=be.startsWith("http://")||be.startsWith("https://")?be:Zd({baseUrl:t(h.auth),relativePath:be}),Te={method:T,url:pu,headers:{...s??{},...g==="headers"||!se(g)?me:{}},queryParams:{...g==="queryParams"?me:{},...d??{}},timeout:P?P*1e3:0,followRedirects:te};if(M&&(Te.responseType="arraybuffer"),y)if(m&&m!=="none"){let fe=y.data;if(m==="form_data"){let lu=fe,$t=new eu.default;for(let{fieldName:vn,fieldType:xn,textFieldValue:_n,fileFieldValue:ur}of lu)xn==="text"&&!_t(_n)?$t.append(vn,_n):xn==="file"&&!_t(ur)&&$t.append(vn,ur.data,{filename:ur?.filename});Te.body=$t,Te.headers={...Te.headers,...$t.getHeaders()}}else Te.body=fe}else m||(Te.body=y);try{let fe=await V.sendRequest(Te);return await Gd(h.files,fe.body,fe.status,fe.headers,M)}catch(fe){if(x)return Gi({error:fe,requestBody:Te.body});throw fe}},"run")})}o(tu,"createCustomApiCallAction");var Gd=o(async(e,t,r,n,i)=>{let u;if(i&&Wd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Vd(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Wd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var G="https://client.camb.ai/apis",Ne=5e3;var Qe=10,ru=120,nu=A.Dropdown({auth:ee,displayName:"Voice",description:"Select the voice to generate the speech.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await V.sendRequest({method:"GET",url:`${G}/list-voices`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.voice_name,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),et=A.Dropdown({auth:ee,displayName:"Source Language",description:"Select the original language of the input text.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await V.sendRequest({method:"GET",url:`${G}/source-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),ou=A.Dropdown({displayName:"Target Language",description:"Select the language to translate the text into.",auth:ee,required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await V.sendRequest({method:"GET",url:`${G}/target-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),tt=A.Dropdown({displayName:"Folder",auth:ee,description:"Select the folder to save the task in.",required:!1,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please authenticate first"};try{return{disabled:!1,options:((await V.sendRequest({method:"GET",url:`${G}/folders`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.folder_name,value:n.folder_id}))}}catch{return{disabled:!0,options:[],placeholder:"Could not load folders."}}},"options")});var ee=Hr.SecretText({displayName:"API Key",description:`
4
4
  To get your API key, please follow these steps:
5
5
  1. Log in to your [CAMB.AI Studio](https://camb.ai/studio/) account.
6
6
  2. Navigate to your workspace's API Keys dashboard.
7
7
  3. Create a new key if you haven't already.
8
8
  4. Copy the API key and paste it here.
9
- `,required:!0,validate:o(async({auth:e})=>{try{return await Z.sendRequest({method:"GET",url:`${V}/source-languages`,headers:{"x-api-key":e}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key."}}},"validate")});var Us=pe({auth:Q,name:"create_text_to_sound",displayName:"Create Text-to-Sound",description:"Convert input text into \u201Csound effects\u201D using an AI model.",audience:"both",aiMetadata:{description:"Generates a sound-effect audio clip from a text prompt describing the desired effect using Camb.AI, polling until the generation task completes and returning the audio. Use to synthesize non-speech sound effects (not spoken voice \u2014 use Create Text-to-Speech for that). Duration is capped at 10 seconds (defaults to 8). Not idempotent: each call starts a new generation task and produces fresh audio.",idempotent:!1},props:{prompt:S.LongText({displayName:"Prompt",description:"A clear, descriptive explanation of the desired audio effect. Concise prompts yield more accurate results.",required:!0}),duration:S.Number({displayName:"Duration (seconds)",description:"The desired length of the audio in seconds (max 10). Defaults to 8 if not set.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Ye},async run(e){let{auth:t}=e,{prompt:r,duration:n,project_name:i,project_description:u,folder_id:c}=e.propsValue,d={prompt:r};n&&(d.duration=n),i&&(d.project_name=i),u&&(d.project_description=u),c&&(d.folder_id=c);let y=(await Z.sendRequest({method:"POST",url:`${V}/text-to-sound`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:d})).body.task_id,_=0,b=null;for(;_<Je;){let s=await Z.sendRequest({method:"GET",url:`${V}/text-to-sound/${y}`,headers:{"x-api-key":t.secret_text}}),l=s.body.status;if(l==="SUCCESS"){b=s.body.run_id??null;break}if(l==="FAILED")throw new Error(`Sound generation task failed: ${JSON.stringify(s.body)}`);await new Promise(g=>setTimeout(g,Ae)),_++}if(!b)throw new Error("Sound generation task timed out or failed to return a run_id.");return{audio:(await Z.sendRequest({method:"GET",url:`${V}/text-to-sound-result/${b}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"})).body}}});var Ms=pe({auth:Q,name:"create_text_to_speech",displayName:"Create Text-to-Speech",description:"Convert text into speech using a specified voice, language, gender, and age group.",audience:"both",aiMetadata:{description:"Synthesizes spoken-voice audio from text via Camb.AI text-to-speech, polling until the task completes and writing the resulting WAV to a file. Requires a language and a voice_id (both selected from Camb.AI dropdowns); optionally tune gender and age. Use for spoken narration/dialogue; for non-speech sound effects use Create Text-to-Sound instead. Not idempotent: each call starts a new synthesis task and produces a new audio file.",idempotent:!1},props:{text:S.LongText({displayName:"Text",description:"The text to be converted to speech.",required:!0}),language:Xe,voice_id:Ds,gender:S.StaticDropdown({displayName:"Gender",description:"The gender of the speaker.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:S.Number({displayName:"Age",description:"The age of the speaker to be generated.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Ye},async run(e){let{auth:t}=e,{text:r,language:n,voice_id:i,gender:u,age:c,project_name:d,project_description:f,folder_id:y}=e.propsValue,_={text:r,language:Number(n),voice_id:Number(i)};u!==void 0&&(_.gender=u),c&&(_.age=c),d&&(_.project_name=d),f&&(_.project_description=f),y&&(_.folder_id=y);let x=(await Z.sendRequest({method:"POST",url:`${V}/tts`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:_})).body.task_id,s=0,l=null;for(;s<Je;){let U=await Z.sendRequest({method:"GET",url:`${V}/tts/${x}`,headers:{"x-api-key":t.secret_text}});if(U.body.status==="SUCCESS"){l=U.body.run_id??null;break}if(U.body.status==="FAILED")throw new Error(`Text-to-Speech task failed: ${JSON.stringify(U.body)}`);await new Promise(ee=>setTimeout(ee,Ae)),s++}if(!l)throw new Error("Text-to-Speech task timed out or failed to return a run_id.");let g=await Z.sendRequest({method:"GET",url:`${V}/tts-result/${l}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"}),m=`speech_${l}.wav`,v=Buffer.from(g.body);return{message:"Speech generated successfully.",audio_url:await e.files.write({fileName:m,data:v}),run_id:l}}});var js=pe({auth:Q,name:"create_translation",displayName:"Create Translation",description:"Translate text from a source language to a target language.",audience:"both",aiMetadata:{description:"Translates text from a source language to a target language via Camb.AI, polling until the translation task completes. Each input line is treated as a separate segment to translate, and both languages are chosen from Camb.AI dropdowns; optionally tune formality, gender, and target audience age. Use for text translation only (not audio \u2014 use Create Transcription for speech-to-text). Not idempotent: each call starts a new translation task.",idempotent:!1},props:{texts:S.LongText({displayName:"Text to Translate",description:"The text to be translated. You can enter multiple lines; each line will be treated as a separate text segment.",required:!0}),source_language:Xe,target_language:Cs,formality:S.StaticDropdown({displayName:"Formality",description:"Adjust the formality level to match your context.",required:!1,options:{options:[{label:"Formal",value:1},{label:"Informal",value:2}]}}),gender:S.StaticDropdown({displayName:"Gender",description:"Specify grammatical gender preferences when relevant in the target language.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:S.Number({displayName:"Audience Age",description:"Helps adjust vocabulary and expressions to be age-appropriate.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1})},async run(e){let{auth:t}=e,{texts:r,source_language:n,target_language:i,formality:u,gender:c,age:d,project_name:f}=e.propsValue,y={texts:r.split(`
10
- `).filter(g=>g.trim().length>0),source_language:Number(n),target_language:Number(i)};u!==void 0&&(y.formality=u),c!==void 0&&(y.gender=c),d&&(y.age=d),f&&(y.project_name=f);let b=(await Z.sendRequest({method:"POST",url:`${V}/translate`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:y})).body.task_id,x=null,s=0;for(;s<Je;){let g=await Z.sendRequest({method:"GET",url:`${V}/translate/${b}`,headers:{"x-api-key":t.secret_text}});if(g.body.status==="SUCCESS"){x=g.body.run_id??null;break}if(g.body.status==="ERROR"||g.body.status==="FAILED")throw new Error(`Translation task failed: ${JSON.stringify(g.body)}`);await new Promise(m=>setTimeout(m,Ae)),s++}if(!x)throw new Error("Translation task timed out or failed to return a task_id.");return(await Z.sendRequest({method:"GET",url:`${V}/translation-result/${x}`,headers:{"x-api-key":t.secret_text}})).body}});var Ls=ke(ln());var Fs=pe({auth:Q,name:"create_transcription",displayName:"Create Transcription",description:"Creates a task to process speech into readable text.",audience:"both",aiMetadata:{description:"Transcribes speech from an audio/video source into text via Camb.AI, polling until the transcription task completes. The media can be supplied either as an uploaded file (max 20MB) or as a public file URL, selected via the media source mode; you must specify the spoken language. Use to convert recorded speech to text. Not idempotent: each call starts a new transcription task.",idempotent:!1},props:{language:Xe,source_type:S.StaticDropdown({displayName:"Media Source",description:"Choose whether to upload a file or provide a URL.",required:!0,defaultValue:"file",options:{options:[{label:"Upload File",value:"file"},{label:"File URL",value:"url"}]}}),media:S.DynamicProperties({auth:Q,displayName:"Media",required:!0,refreshers:["source_type"],props:o(async e=>{let t=e.source_type,r={};return t==="file"?r.media_file=S.File({displayName:"Media File",description:"The media file (e.g., MP3, WAV, MP4) to transcribe. Max size: 20MB.",required:!0}):t==="url"&&(r.media_url=S.ShortText({displayName:"Media URL",description:"A public URL to the media file to transcribe.",required:!0})),r},"props")}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Ye},async run(e){let{auth:t}=e,{language:r,source_type:n,media:i,project_name:u,project_description:c,folder_id:d}=e.propsValue,f=new Ls.default;if(f.append("language",Number(r).toString()),u&&f.append("project_name",u),c&&f.append("project_description",c),d&&f.append("folder_id",d.toString()),n==="url"){if(!i.media_url)throw new Error("Media URL is required when source is 'File URL'.");f.append("media_url",i.media_url)}else{if(!i.media_file)throw new Error("Media File is required when source is 'Upload File'.");let m=i.media_file;f.append("media_file",m.data,m.filename)}let y=await f.getBuffer(),_={"x-api-key":t.secret_text,...f.getHeaders()},x=(await Z.sendRequest({method:"POST",url:`${V}/transcribe`,headers:_,body:y})).body.task_id,s=null,l=0;for(;l<Ns;){let m=await Z.sendRequest({method:"GET",url:`${V}/transcribe/${x}`,headers:{"x-api-key":t.secret_text}});if(m.body.status==="SUCCESS"){s=m.body.run_id??null;break}if(m.body.status==="FAILED")throw new Error(`Transcription task failed: ${JSON.stringify(m.body)}`);await new Promise(v=>setTimeout(v,Ae)),l++}if(!s)throw new Error("Transcription task timed out or failed to return a task_id.");return(await Z.sendRequest({method:"GET",url:`${V}/transcription-result/${s}`,headers:{"x-api-key":t.secret_text}})).body}});var yd=_i({displayName:"Camb.AI",auth:Q,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/camb-ai.png",authors:["david-oluwaseun420","sanket-a11y"],categories:["ARTIFICIAL_INTELLIGENCE"],actions:[Us,Ms,js,Fs,Rs({auth:Q,baseUrl:o(()=>V,"baseUrl"),authMapping:o(async e=>({"x-api-key":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={cambAi});
9
+ `,required:!0,validate:o(async({auth:e})=>{try{return await V.sendRequest({method:"GET",url:`${G}/source-languages`,headers:{"x-api-key":e}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key."}}},"validate")});var iu=pe({auth:ee,name:"create_text_to_sound",classification:"READ",displayName:"Create Text-to-Sound",description:"Convert input text into \u201Csound effects\u201D using an AI model.",audience:"both",aiMetadata:{description:"Generates a sound-effect audio clip from a text prompt describing the desired effect using Camb.AI, polling until the generation task completes and returning the audio. Use to synthesize non-speech sound effects (not spoken voice \u2014 use Create Text-to-Speech for that). Duration is capped at 10 seconds (defaults to 8). Not idempotent: each call starts a new generation task and produces fresh audio.",idempotent:!1},props:{prompt:A.LongText({displayName:"Prompt",description:"A clear, descriptive explanation of the desired audio effect. Concise prompts yield more accurate results.",required:!0}),duration:A.Number({displayName:"Duration (seconds)",description:"The desired length of the audio in seconds (max 10). Defaults to 8 if not set.",required:!1}),project_name:A.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:A.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:tt},async run(e){let{auth:t}=e,{prompt:r,duration:n,project_name:i,project_description:u,folder_id:c}=e.propsValue,p={prompt:r};n&&(p.duration=n),i&&(p.project_name=i),u&&(p.project_description=u),c&&(p.folder_id=c);let v=(await V.sendRequest({method:"POST",url:`${G}/text-to-sound`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:p})).body.task_id,h=0,T=null;for(;h<Qe;){let s=await V.sendRequest({method:"GET",url:`${G}/text-to-sound/${v}`,headers:{"x-api-key":t.secret_text}}),d=s.body.status;if(d==="SUCCESS"){T=s.body.run_id??null;break}if(d==="FAILED")throw new Error(`Sound generation task failed: ${JSON.stringify(s.body)}`);await new Promise(y=>setTimeout(y,Ne)),h++}if(!T)throw new Error("Sound generation task timed out or failed to return a run_id.");return{audio:(await V.sendRequest({method:"GET",url:`${G}/text-to-sound-result/${T}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"})).body}}});var au=pe({auth:ee,name:"create_text_to_speech",classification:"READ",displayName:"Create Text-to-Speech",description:"Convert text into speech using a specified voice, language, gender, and age group.",audience:"both",aiMetadata:{description:"Synthesizes spoken-voice audio from text via Camb.AI text-to-speech, polling until the task completes and writing the resulting WAV to a file. Requires a language and a voice_id (both selected from Camb.AI dropdowns); optionally tune gender and age. Use for spoken narration/dialogue; for non-speech sound effects use Create Text-to-Sound instead. Not idempotent: each call starts a new synthesis task and produces a new audio file.",idempotent:!1},props:{text:A.LongText({displayName:"Text",description:"The text to be converted to speech.",required:!0}),language:et,voice_id:nu,gender:A.StaticDropdown({displayName:"Gender",description:"The gender of the speaker.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:A.Number({displayName:"Age",description:"The age of the speaker to be generated.",required:!1}),project_name:A.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:A.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:tt},async run(e){let{auth:t}=e,{text:r,language:n,voice_id:i,gender:u,age:c,project_name:p,project_description:g,folder_id:v}=e.propsValue,h={text:r,language:Number(n),voice_id:Number(i)};u!==void 0&&(h.gender=u),c&&(h.age=c),p&&(h.project_name=p),g&&(h.project_description=g),v&&(h.folder_id=v);let _=(await V.sendRequest({method:"POST",url:`${G}/tts`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:h})).body.task_id,s=0,d=null;for(;s<Qe;){let M=await V.sendRequest({method:"GET",url:`${G}/tts/${_}`,headers:{"x-api-key":t.secret_text}});if(M.body.status==="SUCCESS"){d=M.body.run_id??null;break}if(M.body.status==="FAILED")throw new Error(`Text-to-Speech task failed: ${JSON.stringify(M.body)}`);await new Promise(te=>setTimeout(te,Ne)),s++}if(!d)throw new Error("Text-to-Speech task timed out or failed to return a run_id.");let y=await V.sendRequest({method:"GET",url:`${G}/tts-result/${d}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"}),m=`speech_${d}.wav`,x=Buffer.from(y.body);return{message:"Speech generated successfully.",audio_url:await e.files.write({fileName:m,data:x}),run_id:d}}});var su=pe({auth:ee,name:"create_translation",classification:"READ",displayName:"Create Translation",description:"Translate text from a source language to a target language.",audience:"both",aiMetadata:{description:"Translates text from a source language to a target language via Camb.AI, polling until the translation task completes. Each input line is treated as a separate segment to translate, and both languages are chosen from Camb.AI dropdowns; optionally tune formality, gender, and target audience age. Use for text translation only (not audio \u2014 use Create Transcription for speech-to-text). Not idempotent: each call starts a new translation task.",idempotent:!1},props:{texts:A.LongText({displayName:"Text to Translate",description:"The text to be translated. You can enter multiple lines; each line will be treated as a separate text segment.",required:!0}),source_language:et,target_language:ou,formality:A.StaticDropdown({displayName:"Formality",description:"Adjust the formality level to match your context.",required:!1,options:{options:[{label:"Formal",value:1},{label:"Informal",value:2}]}}),gender:A.StaticDropdown({displayName:"Gender",description:"Specify grammatical gender preferences when relevant in the target language.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:A.Number({displayName:"Audience Age",description:"Helps adjust vocabulary and expressions to be age-appropriate.",required:!1}),project_name:A.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1})},async run(e){let{auth:t}=e,{texts:r,source_language:n,target_language:i,formality:u,gender:c,age:p,project_name:g}=e.propsValue,v={texts:r.split(`
10
+ `).filter(y=>y.trim().length>0),source_language:Number(n),target_language:Number(i)};u!==void 0&&(v.formality=u),c!==void 0&&(v.gender=c),p&&(v.age=p),g&&(v.project_name=g);let T=(await V.sendRequest({method:"POST",url:`${G}/translate`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:v})).body.task_id,_=null,s=0;for(;s<Qe;){let y=await V.sendRequest({method:"GET",url:`${G}/translate/${T}`,headers:{"x-api-key":t.secret_text}});if(y.body.status==="SUCCESS"){_=y.body.run_id??null;break}if(y.body.status==="ERROR"||y.body.status==="FAILED")throw new Error(`Translation task failed: ${JSON.stringify(y.body)}`);await new Promise(m=>setTimeout(m,Ne)),s++}if(!_)throw new Error("Translation task timed out or failed to return a task_id.");return(await V.sendRequest({method:"GET",url:`${G}/translation-result/${_}`,headers:{"x-api-key":t.secret_text}})).body}});var uu=De(hn());var cu=pe({auth:ee,name:"create_transcription",classification:"READ",displayName:"Create Transcription",description:"Creates a task to process speech into readable text.",audience:"both",aiMetadata:{description:"Transcribes speech from an audio/video source into text via Camb.AI, polling until the transcription task completes. The media can be supplied either as an uploaded file (max 20MB) or as a public file URL, selected via the media source mode; you must specify the spoken language. Use to convert recorded speech to text. Not idempotent: each call starts a new transcription task.",idempotent:!1},props:{language:et,source_type:A.StaticDropdown({displayName:"Media Source",description:"Choose whether to upload a file or provide a URL.",required:!0,defaultValue:"file",options:{options:[{label:"Upload File",value:"file"},{label:"File URL",value:"url"}]}}),media:A.DynamicProperties({auth:ee,displayName:"Media",required:!0,refreshers:["source_type"],props:o(async e=>{let t=e.source_type,r={};return t==="file"?r.media_file=A.File({displayName:"Media File",description:"The media file (e.g., MP3, WAV, MP4) to transcribe. Max size: 20MB.",required:!0}):t==="url"&&(r.media_url=A.ShortText({displayName:"Media URL",description:"A public URL to the media file to transcribe.",required:!0})),r},"props")}),project_name:A.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:A.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:tt},async run(e){let{auth:t}=e,{language:r,source_type:n,media:i,project_name:u,project_description:c,folder_id:p}=e.propsValue,g=new uu.default;if(g.append("language",Number(r).toString()),u&&g.append("project_name",u),c&&g.append("project_description",c),p&&g.append("folder_id",p.toString()),n==="url"){if(!i.media_url)throw new Error("Media URL is required when source is 'File URL'.");g.append("media_url",i.media_url)}else{if(!i.media_file)throw new Error("Media File is required when source is 'Upload File'.");let m=i.media_file;g.append("media_file",m.data,m.filename)}let v=await g.getBuffer(),h={"x-api-key":t.secret_text,...g.getHeaders()},_=(await V.sendRequest({method:"POST",url:`${G}/transcribe`,headers:h,body:v})).body.task_id,s=null,d=0;for(;d<ru;){let m=await V.sendRequest({method:"GET",url:`${G}/transcribe/${_}`,headers:{"x-api-key":t.secret_text}});if(m.body.status==="SUCCESS"){s=m.body.run_id??null;break}if(m.body.status==="FAILED")throw new Error(`Transcription task failed: ${JSON.stringify(m.body)}`);await new Promise(x=>setTimeout(x,Ne)),d++}if(!s)throw new Error("Transcription task timed out or failed to return a task_id.");return(await V.sendRequest({method:"GET",url:`${G}/transcription-result/${s}`,headers:{"x-api-key":t.secret_text}})).body}});var qd=Mi({displayName:"Camb.AI",auth:ee,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/camb-ai.png",authors:["david-oluwaseun420","sanket-a11y"],categories:["ARTIFICIAL_INTELLIGENCE"],actions:[iu,au,su,cu,tu({auth:ee,baseUrl:o(()=>G,"baseUrl"),authMapping:o(async e=>({"x-api-key":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={cambAi});
11
11
  /*! Bundled license information:
12
12
 
13
13
  mime-types/index.js: