@activepieces/piece-algolia 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -12
- package/src/index.js +13 -42
- package/src/index.d.ts +0 -4
- package/src/index.js.map +0 -1
- package/src/lib/actions/browse-records.d.ts +0 -13
- package/src/lib/actions/browse-records.js +0 -41
- package/src/lib/actions/browse-records.js.map +0 -1
- package/src/lib/actions/delete-records.d.ts +0 -13
- package/src/lib/actions/delete-records.js +0 -40
- package/src/lib/actions/delete-records.js.map +0 -1
- package/src/lib/actions/save-records.d.ts +0 -7
- package/src/lib/actions/save-records.js +0 -43
- package/src/lib/actions/save-records.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -4
- package/src/lib/common/auth.js +0 -50
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -21
- package/src/lib/common/client.js +0 -139
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -9
- package/src/lib/common/props.js +0 -52
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -31
- package/src/lib/common/types.js +0 -3
- package/src/lib/common/types.js.map +0 -1
- package/src/lib/common/utils.d.ts +0 -5
- package/src/lib/common/utils.js +0 -69
- package/src/lib/common/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-algolia",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
15
|
-
"lint": "eslint 'src/**/*.ts'"
|
|
16
|
-
}
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/index.js",
|
|
9
|
+
"package.json",
|
|
10
|
+
"src/i18n"
|
|
11
|
+
]
|
|
17
12
|
}
|
package/src/index.js
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algolia = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
description: 'Manage your Algolia search indices — add, browse, and delete records.',
|
|
15
|
-
minimumSupportedRelease: '0.36.1',
|
|
16
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/algolia.png',
|
|
17
|
-
categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
|
|
18
|
-
authors: ['veri5ied'],
|
|
19
|
-
auth: auth_1.algoliaAuth,
|
|
20
|
-
actions: [
|
|
21
|
-
save_records_1.saveRecordsAction,
|
|
22
|
-
browse_records_1.browseRecordsAction,
|
|
23
|
-
delete_records_1.deleteRecordsAction,
|
|
24
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
25
|
-
auth: auth_1.algoliaAuth,
|
|
26
|
-
baseUrl: (auth) => {
|
|
27
|
-
if (!auth) {
|
|
28
|
-
return '';
|
|
29
|
-
}
|
|
30
|
-
return `https://${auth.props.applicationId}.algolia.net/1`;
|
|
31
|
-
},
|
|
32
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
return ({
|
|
34
|
-
'x-algolia-application-id': auth.props.applicationId,
|
|
35
|
-
'x-algolia-api-key': auth.props.apiKey,
|
|
36
|
-
});
|
|
37
|
-
}),
|
|
38
|
-
}),
|
|
39
|
-
],
|
|
40
|
-
triggers: [],
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var qs=Object.create;var qe=Object.defineProperty;var Ks=Object.getOwnPropertyDescriptor;var Js=Object.getOwnPropertyNames;var Xs=Object.getPrototypeOf,Ys=Object.prototype.hasOwnProperty;var o=(e,t)=>qe(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yn=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Js(t))!Ys.call(e,i)&&i!==r&&qe(e,i,{get:()=>t[i],enumerable:!(n=Ks(t,i))||n.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?qs(Xs(e)):{},hn(t||!e||!e.__esModule?qe(r,"default",{value:e,enumerable:!0}):r,e)),Qs=e=>hn(qe({},"__esModule",{value:!0}),e);var Do=T((No,jt)=>{(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,}",l="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,p){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],P,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>p)return null;for(M=p-f,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),p=function(){let Q=s.split(":"),ne=[];for(let Ge=0;Ge<Q.length;Ge++)ne.push(parseInt(Q[Ge],16));return ne}(),{parts:p,zoneId:v}}o(y,"expandIPv6");function h(s,p,f,m){if(s.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=f-m,P<0&&(P=0),s[v]>>P!==p[v]>>P)return!1;m-=f,v+=1}return!0}o(h,"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 $(s,p){for(;s.length<p;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=function(){function s(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<p.length;f++)if(m=p[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}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(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,M;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(M=m[P],f&&M!==0)return null;M!==8&&(f=!0),p+=M}else return null;return 32-p},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 p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(f[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 p=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!p?!1:x.IPv4.isValidFourPartDecimal(p[1])},x.IPv4.networkAddressFromCIDR=function(s){let p,f,m,v,P;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),P=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let p=this.parser(s);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},x.IPv4.parseCIDR=function(s){let p;if(p=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(p[2]);if(f>=0&&f<=32){let m=[this.parse(p[1]),f];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 p,f,m;if(p=s.match(r.fourOctet))return function(){let v=p.slice(1,6),P=[];for(let M=0;M<v.length;M++)f=v[M],P.push(_(f));return P}();if(p=s.match(r.longValue)){if(m=_(p[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(p=s.match(r.twoOctet))?function(){let v=p.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}():(p=s.match(r.threeOctet))?function(){let v=p.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 p=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<4&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.IPv6=function(){function s(p,f){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;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");f&&(this.zoneId=f)}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(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!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 M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(P=m[v],f&&P!==0)return null;P!==16&&(f=!0),p+=P}else return null;return 128-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let p,f=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],f.push(p>>8),f.push(p&255);return f},s.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),f=p[0],m=p[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,P;for(;P=p.exec(f);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(f[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},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 p=this.parser(s);return new this(p.parts,p.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 p,f,m,v,P;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),P=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let p=this.parser(s);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},x.IPv6.parseCIDR=function(s){let p,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(p=parseInt(f[2]),p>=0&&p<=128))return m=[this.parse(f[1]),p],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 p,f,m,v,P,M;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return y(s,8);if((m=s.match(d.transitional))&&(M=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=y(p+M,6),p.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<P.length;f++)if(v=P[f],!(0<=v&&v<=255))return null;return p.parts.push(P[0]<<8|P[1]),p.parts.push(P[2]<<8|P[3]),{parts:p.parts,zoneId:p.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 p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<16&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.fromByteArray=function(s){let p=s.length;if(p===4)return new x.IPv4(s);if(p===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 p=this.parse(s);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},x.subnetMatch=function(s,p,f){let m,v,P,M;f==null&&(f="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(P=p[v],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 v}return f},typeof jt<"u"&&jt.exports?jt.exports=x:e.ipaddr=x})(No)});var ki=T((nS,Oi)=>{var zi=require("stream").Stream,Sl=require("util");Oi.exports=ie;function ie(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ie,"DelayedStream");Sl.inherits(ie,zi);ie.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(ie.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ie.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ie.prototype.resume=function(){this._released||this.release(),this.source.resume()};ie.prototype.pause=function(){this.source.pause()};ie.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ie.prototype.pipe=function(){var e=zi.prototype.pipe.apply(this,arguments);return this.resume(),e};ie.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)};ie.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 Di=T((iS,Ni)=>{var zl=require("util"),Ri=require("stream").Stream,wi=ki();Ni.exports=G;function G(){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(G,"CombinedStream");zl.inherits(G,Ri);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof wi)){var r=wi.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};G.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.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=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.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()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.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)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ui=T((sS,Ci)=>{"use strict";Ci.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 Li=T(Y=>{"use strict";var qt=Ui(),Ol=require("path").extname,Mi=/^\s*([^;\s]*)(?:;|\s|$)/,kl=/^text\//i;Y.charset=ji;Y.charsets={lookup:ji};Y.contentType=wl;Y.extension=Rl;Y.extensions=Object.create(null);Y.lookup=Nl;Y.types=Object.create(null);Dl(Y.extensions,Y.types);function ji(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&kl.test(t[1])?"UTF-8":!1}o(ji,"charset");function wl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(wl,"contentType");function Rl(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Rl,"extension");function Nl(e){if(!e||typeof e!="string")return!1;var t=Ol("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(Nl,"lookup");function Dl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(qt).forEach(o(function(i){var u=qt[i],l=u.extensions;if(!(!l||!l.length)){e[i]=l;for(var d=0;d<l.length;d++){var y=l[d];if(t[y]){var h=r.indexOf(qt[t[y]].source),_=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>_||h===_&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(Dl,"populateMaps")});var Bi=T((lS,Fi)=>{Fi.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 Vr=T((dS,Vi)=>{var Zi=Bi();Vi.exports=Ul;function Ul(e){var t=!1;return Zi(function(){t=!0}),o(function(n,i){t?e(n,i):Zi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Ul,"async")});var Hr=T((fS,Hi)=>{Hi.exports=Ml;function Ml(e){Object.keys(e.jobs).forEach(jl.bind(e)),e.jobs={}}o(Ml,"abort");function jl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(jl,"clean")});var Wr=T((yS,Gi)=>{var Wi=Vr(),Ll=Hr();Gi.exports=Fl;function Fl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Bl(t,i,e[i],function(u,l){i in r.jobs&&(delete r.jobs[i],u?Ll(r):r.results[i]=l,n(u,r.results))})}o(Fl,"iterate");function Bl(e,t,r,n){var i;return e.length==2?i=e(r,Wi(n)):i=e(r,t,Wi(n)),i}o(Bl,"runJob")});var Gr=T((vS,qi)=>{qi.exports=Zl;function Zl(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(Zl,"state")});var qr=T((_S,Ki)=>{var Vl=Hr(),Hl=Vr();Ki.exports=Wl;function Wl(e){Object.keys(this.jobs).length&&(this.index=this.size,Vl(this),Hl(e)(null,this.results))}o(Wl,"terminator")});var Xi=T((bS,Ji)=>{var Gl=Wr(),ql=Gr(),Kl=qr();Ji.exports=Jl;function Jl(e,t,r){for(var n=ql(e);n.index<(n.keyedList||e).length;)Gl(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 Kl.bind(n,r)}o(Jl,"parallel")});var Kr=T((TS,Kt)=>{var Yi=Wr(),Xl=Gr(),Yl=qr();Kt.exports=Ql;Kt.exports.ascending=Qi;Kt.exports.descending=ep;function Ql(e,t,r,n){var i=Xl(e,r);return Yi(e,t,i,o(function u(l,d){if(l){n(l,d);return}if(i.index++,i.index<(i.keyedList||e).length){Yi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Yl.bind(i,n)}o(Ql,"serialOrdered");function Qi(e,t){return e<t?-1:e>t?1:0}o(Qi,"ascending");function ep(e,t){return-1*Qi(e,t)}o(ep,"descending")});var ta=T((ES,ea)=>{var tp=Kr();ea.exports=rp;function rp(e,t,r){return tp(e,t,null,r)}o(rp,"serial")});var na=T((SS,ra)=>{ra.exports={parallel:Xi(),serial:ta(),serialOrdered:Kr()}});var Jr=T((zS,oa)=>{"use strict";oa.exports=Object});var aa=T((OS,ia)=>{"use strict";ia.exports=Error});var ua=T((kS,sa)=>{"use strict";sa.exports=EvalError});var la=T((wS,ca)=>{"use strict";ca.exports=RangeError});var da=T((RS,pa)=>{"use strict";pa.exports=ReferenceError});var fa=T((NS,ma)=>{"use strict";ma.exports=SyntaxError});var Jt=T((DS,ga)=>{"use strict";ga.exports=TypeError});var ha=T((CS,ya)=>{"use strict";ya.exports=URIError});var xa=T((US,va)=>{"use strict";va.exports=Math.abs});var Pa=T((MS,_a)=>{"use strict";_a.exports=Math.floor});var Ia=T((jS,ba)=>{"use strict";ba.exports=Math.max});var $a=T((LS,Ta)=>{"use strict";Ta.exports=Math.min});var Aa=T((FS,Ea)=>{"use strict";Ea.exports=Math.pow});var za=T((BS,Sa)=>{"use strict";Sa.exports=Math.round});var ka=T((ZS,Oa)=>{"use strict";Oa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=T((HS,wa)=>{"use strict";var np=ka();wa.exports=o(function(t){return np(t)||t===0?t:t<0?-1:1},"sign")});var Da=T((GS,Na)=>{"use strict";Na.exports=Object.getOwnPropertyDescriptor});var Xr=T((qS,Ca)=>{"use strict";var Xt=Da();if(Xt)try{Xt([],"length")}catch{Xt=null}Ca.exports=Xt});var Ma=T((KS,Ua)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Ua.exports=Yt});var Yr=T((JS,ja)=>{"use strict";ja.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 l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[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 Ba=T((YS,Fa)=>{"use strict";var La=typeof Symbol<"u"&&Symbol,op=Yr();Fa.exports=o(function(){return typeof La!="function"||typeof Symbol!="function"||typeof La("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:op()},"hasNativeSymbols")});var Qr=T((ez,Za)=>{"use strict";Za.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var en=T((tz,Va)=>{"use strict";var ip=Jr();Va.exports=ip.getPrototypeOf||null});var Ga=T((rz,Wa)=>{"use strict";var ap="Function.prototype.bind called on incompatible ",sp=Object.prototype.toString,up=Math.max,cp="[object Function]",Ha=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"),lp=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"),pp=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");Wa.exports=o(function(t){var r=this;if(typeof r!="function"||sp.apply(r)!==cp)throw new TypeError(ap+r);for(var n=lp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ha(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ha(n,arguments))},"binder"),l=up(0,r.length-n.length),d=[],y=0;y<l;y++)d[y]="$"+y;if(i=Function("binder","return function ("+pp(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Fe=T((oz,qa)=>{"use strict";var dp=Ga();qa.exports=Function.prototype.bind||dp});var Qt=T((iz,Ka)=>{"use strict";Ka.exports=Function.prototype.call});var tn=T((az,Ja)=>{"use strict";Ja.exports=Function.prototype.apply});var Ya=T((sz,Xa)=>{"use strict";Xa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var es=T((uz,Qa)=>{"use strict";var mp=Fe(),fp=tn(),gp=Qt(),yp=Ya();Qa.exports=yp||mp.call(gp,fp)});var rs=T((cz,ts)=>{"use strict";var hp=Fe(),vp=Jt(),xp=Qt(),_p=es();ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new vp("a function is required");return _p(hp,xp,t)},"callBindBasic")});var us=T((pz,ss)=>{"use strict";var Pp=rs(),ns=Xr(),is;try{is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var rn=!!is&&ns&&ns(Object.prototype,"__proto__"),as=Object,os=as.getPrototypeOf;ss.exports=rn&&typeof rn.get=="function"?Pp([rn.get]):typeof os=="function"?o(function(t){return os(t==null?t:as(t))},"getDunder"):!1});var ms=T((mz,ds)=>{"use strict";var cs=Qr(),ls=en(),ps=us();ds.exports=cs?o(function(t){return cs(t)},"getProto"):ls?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ls(t)},"getProto"):ps?o(function(t){return ps(t)},"getProto"):null});var nn=T((gz,fs)=>{"use strict";var bp=Function.prototype.call,Ip=Object.prototype.hasOwnProperty,Tp=Fe();fs.exports=Tp.call(bp,Ip)});var Ps=T((yz,_s)=>{"use strict";var U,$p=Jr(),Ep=aa(),Ap=ua(),Sp=la(),zp=da(),He=fa(),Ve=Jt(),Op=ha(),kp=xa(),wp=Pa(),Rp=Ia(),Np=$a(),Dp=Aa(),Cp=za(),Up=Ra(),vs=Function,on=o(function(e){try{return vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),yt=Xr(),Mp=Ma(),an=o(function(){throw new Ve},"throwTypeError"),jp=yt?function(){try{return arguments.callee,an}catch{try{return yt(arguments,"callee").get}catch{return an}}}():an,Be=Ba()(),J=ms(),Lp=en(),Fp=Qr(),xs=tn(),ht=Qt(),Ze={},Bp=typeof Uint8Array>"u"||!J?U:J(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":Be&&J?J([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":Ze,"%AsyncGenerator%":Ze,"%AsyncGeneratorFunction%":Ze,"%AsyncIteratorPrototype%":Ze,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ep,"%eval%":eval,"%EvalError%":Ap,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":vs,"%GeneratorFunction%":Ze,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Be&&J?J(J([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Be||!J?U:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$p,"%Object.getOwnPropertyDescriptor%":yt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Sp,"%ReferenceError%":zp,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Be||!J?U:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Be&&J?J(""[Symbol.iterator]()):U,"%Symbol%":Be?Symbol:U,"%SyntaxError%":He,"%ThrowTypeError%":jp,"%TypedArray%":Bp,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":Op,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":ht,"%Function.prototype.apply%":xs,"%Object.defineProperty%":Mp,"%Object.getPrototypeOf%":Lp,"%Math.abs%":kp,"%Math.floor%":wp,"%Math.max%":Rp,"%Math.min%":Np,"%Math.pow%":Dp,"%Math.round%":Cp,"%Math.sign%":Up,"%Reflect.getPrototypeOf%":Fp};if(J)try{null.error}catch(e){gs=J(J(e)),Oe["%Error.prototype%"]=gs}var gs,Zp=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&&J&&(r=J(i.prototype))}return Oe[t]=r,r},"doEval"),ys={__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"]},vt=Fe(),er=nn(),Vp=vt.call(ht,Array.prototype.concat),Hp=vt.call(xs,Array.prototype.splice),hs=vt.call(ht,String.prototype.replace),tr=vt.call(ht,String.prototype.slice),Wp=vt.call(ht,RegExp.prototype.exec),Gp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qp=/\\(\\)?/g,Kp=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var i=[];return hs(t,Gp,function(u,l,d,y){i[i.length]=d?hs(y,qp,"$1"):l||u}),i},"stringToPath"),Jp=o(function(t,r){var n=t,i;if(er(ys,n)&&(i=ys[n],n="%"+i[0]+"%"),er(Oe,n)){var u=Oe[n];if(u===Ze&&(u=Zp(n)),typeof u>"u"&&!r)throw new Ve("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new He("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_s.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(Wp(/^%?[^%]*%?$/,t)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Kp(t),i=n.length>0?n[0]:"",u=Jp("%"+i+"%",r),l=u.name,d=u.value,y=!1,h=u.alias;h&&(i=h[0],Hp(n,Vp([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],s=tr(x,0,1),p=tr(x,-1);if((s==='"'||s==="'"||s==="`"||p==='"'||p==="'"||p==="`")&&s!==p)throw new He("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(y=!0),i+="."+x,l="%"+i+"%",er(Oe,l))d=Oe[l];else if(d!=null){if(!(x in d)){if(!r)throw new Ve("base intrinsic for "+t+" exists, but the property is not available.");return}if(yt&&_+1>=n.length){var f=yt(d,x);$=!!f,$&&"get"in f&&!("originalValue"in f.get)?d=f.get:d=d[x]}else $=er(d,x),d=d[x];$&&!y&&(Oe[l]=d)}}return d},"GetIntrinsic")});var Is=T((vz,bs)=>{"use strict";var Xp=Yr();bs.exports=o(function(){return Xp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Es=T((_z,$s)=>{"use strict";var Yp=Ps(),Ts=Yp("%Object.defineProperty%",!0),Qp=Is()(),ed=nn(),td=Jt(),rr=Qp?Symbol.toStringTag:null;$s.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 td("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!ed(t,rr))&&(Ts?Ts(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ss=T((bz,As)=>{"use strict";var rd=Function.prototype.call,nd=Object.prototype.hasOwnProperty,od=Fe();As.exports=od.call(rd,nd)});var Os=T((Iz,zs)=>{"use strict";zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=T((Tz,ws)=>{"use strict";var ln=Di(),id=require("util"),sn=require("path"),ad=require("http"),sd=require("https"),ud=require("url").parse,cd=require("fs"),ld=require("stream").Stream,pd=require("crypto"),un=Li(),dd=na(),md=Es(),Te=Ss(),cn=Os();function ks(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(ks,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");id.inherits(j,ln);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ln.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)};j.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)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Te(t,"httpVersion"))&&!(t instanceof ld))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Te(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)}):Te(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Te(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.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="",l={"Content-Disposition":["form-data",'name="'+ks(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&cn(l,r.header);var d;for(var y in l)if(Te(l,y)){if(d=l[y],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=y+": "+d.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.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&&Te(e,"httpVersion")&&(r=sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+ks(r)+'"'};j.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&&Te(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=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Te(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.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(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+pd.randomBytes(12).toString("hex")};j.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};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.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}dd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=ud(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=sd.request(n):r=ad.request(n),this.getLength(function(u,l){if(u&&u!=="Unknown stream"){this._error(u);return}if(l&&r.setHeader("Content-Length",l),this.pipe(r),t){var d,y=o(function(h,_){return r.removeListener("error",y),r.removeListener("response",d),t.call(this,h,_)},"callback");d=y.bind(this,null),r.on("error",y),r.on("response",d)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};md(j.prototype,"FormData");ws.exports=j});var Ad={};yn(Ad,{algolia:()=>Ed});module.exports=Qs(Ad);var eu=Object.freeze({status:"aborted"});function b(e,t,r){function n(d,y){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:y,constr:l,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,y);let h=l.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];x in d||(d[x]=h[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 l(d){var y;let h=r?.Parent?new u:this;n(h,d),(y=h._zod).deferred??(y.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(l,"_"),Object.defineProperty(l,"init",{value:n}),Object.defineProperty(l,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(l,"name",{value:e}),l}o(b,"$constructor");var tu=Symbol("zod_brand"),se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ar={};function le(e){return e&&Object.assign(ar,e),ar}o(le,"config");function ur(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(ur,"getEnumValues");function xn(e,t){return typeof t=="bigint"?t.toString():t}o(xn,"jsonStringifyReplacer");function It(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(It,"cached");function _n(e){return e==null}o(_n,"nullish");function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Tt,"cleanRegex");var vn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ke,"isObject");var ru=It(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pn(e){if(Ke(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ke(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pn,"isPlainObject");var bn=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(we,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"clone");function V(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(V,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var nu={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 Re(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(Re,"aborted");function he(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(he,"prefixIssues");function bt(e){return typeof e=="string"?e:e?.message}o(bt,"unwrapMessage");function ve(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=bt(e.inst?._zod.def?.error?.(e))??bt(t?.error?.(e))??bt(r.customError?.(e))??bt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(ve,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function lr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(lr,"issue");var $n=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,xn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),En=b("$ZodError",$n),Je=b("$ZodError",$n,{Parent:Error});var iu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},u);if(l instanceof Promise)throw new se;if(l.issues.length){let d=new(i?.Err??e)(l.issues.map(y=>ve(y,u,le())));throw cr(d,i?.callee),d}return l.value},"_parse"),Et=iu(Je),au=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},u);if(l instanceof Promise&&(l=await l),l.issues.length){let d=new(i?.Err??e)(l.issues.map(y=>ve(y,u,le())));throw cr(d,i?.callee),d}return l.value},"_parseAsync"),At=au(Je),su=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 se;return u.issues.length?{success:!1,error:new(e??En)(u.issues.map(l=>ve(l,i,le())))}:{success:!0,data:u.value}},"_safeParse"),Xe=su(Je),uu=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(l=>ve(l,i,le())))}:{success:!0,data:u.value}},"_safeParseAsync"),Ye=uu(Je);var cu="(?:(?:\\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])))",lu=new RegExp(`^${cu}$`);var An=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+)?$/,zn=/^(?:true|false)$/i;var Ne=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var On=b("$ZodCheckMinLength",(e,t)=>{var r;Ne.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!_n(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 l=Tn(i);n.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var dr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ne.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=b("$ZodCheckRegex",(e,t)=>{dr.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 Rn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rn;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((l,d,y)=>{let h=Re(l),_;for(let $ of d){if($._zod.def.when){if(!$._zod.def.when(l))continue}else if(h)continue;let x=l.issues.length,s=$._zod.check(l);if(s instanceof Promise&&y?.async===!1)throw new se;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,l.issues.length!==x&&(h||(h=Re(l,x)))});else{if(l.issues.length===x)continue;h||(h=Re(l,x))}}return _?_.then(()=>l):l},"runChecks"),u=o((l,d,y)=>{if(Re(l))return l.aborted=!0,l;let h=i(d,n,y);if(h instanceof Promise){if(y.async===!1)throw new se;return h.then(_=>e._zod.parse(_,y))}return e._zod.parse(h,y)},"handleCanaryResult");e._zod.run=(l,d)=>{if(d.skipChecks)return e._zod.parse(l,d);if(d.direction==="backward"){let h=e._zod.parse({value:l.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(_=>u(_,l,d)):u(h,l,d)}let y=e._zod.parse(l,d);if(y instanceof Promise){if(d.async===!1)throw new se;return y.then(h=>i(h,n,d))}return i(y,n,d)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=Xe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Ye(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ot=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??An(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}}),mr=b("$ZodStringFormat",(e,t)=>{dr.init(e,t),Ot.init(e,t)});var Mn=b("$ZodURL",(e,t)=>{mr.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 jn=b("$ZodNumber",(e,t)=>{H.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 fr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=zn,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}}),Ln=b("$ZodBigInt",(e,t)=>{H.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 Fn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Bn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Zn=b("$ZodVoid",(e,t)=>{H.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}}),Vn=b("$ZodDate",(e,t)=>{H.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 Nn(e,t,r){e.issues.length&&t.issues.push(...he(r,e.issues)),t.value[r]=e.value}o(Nn,"handleArrayResult");var Hn=b("$ZodArray",(e,t)=>{H.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 l=0;l<i.length;l++){let d=i[l],y=t.element._zod.run({value:d,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Nn(h,r,l))):Nn(y,r,l)}return u.length?Promise.all(u).then(()=>r):r}});function zt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...he(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(zt,"handlePropertyResult");function pu(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=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(pu,"normalizeDef");function du(e,t,r,n,i,u){let l=[],d=i.keySet,y=i.catchall._zod,h=y.def.type,_=y.optout==="optional";for(let $ in t){if(d.has($))continue;if(h==="never"){l.push($);continue}let x=y.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>zt(s,r,$,t,_))):zt(x,r,$,t,_)}return l.length&&r.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(du,"handleCatchall");var Wn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...d};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=It(()=>pu(t));q(e._zod,"propValues",()=>{let d=t.shape,y={};for(let h in d){let _=d[h]._zod;if(_.values){y[h]??(y[h]=new Set);for(let $ of _.values)y[h].add($)}}return y});let i=Ke,u=t.catchall,l;e._zod.parse=(d,y)=>{l??(l=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let _=[],$=l.shape;for(let x of l.keys){let s=$[x],p=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?_.push(f.then(m=>zt(m,d,x,h,p))):zt(f,d,x,h,p)}return u?du(_,h,d,y,n.value,e):_.length?Promise.all(_).then(()=>d):d}});function Dn(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=>!Re(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(l=>ve(l,n,le())))}),t)}o(Dn,"handleUnionResults");var gr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(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=>Tt(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 l=!1,d=[];for(let y of t.options){let h=y._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)d.push(h),l=!0;else{if(h.issues.length===0)return h;d.push(h)}}return l?Promise.all(d).then(y=>Dn(y,i,e,u)):Dn(d,i,e,u)}});var Gn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let l=u._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,y]of Object.entries(l)){i[d]||(i[d]=new Set);for(let h of y)i[d].add(h)}}return i});let n=It(()=>{let i=t.options,u=new Map;for(let l of i){let d=l._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(let y of d){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,l)}}return u});e._zod.parse=(i,u)=>{let l=i.value;if(!Ke(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;let d=n.value.get(l?.[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:l,path:[t.discriminator],inst:e}),i)}});var qn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Pn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],l=t.keyType._zod.values;if(l){r.value={};let d=new Set;for(let h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?u.push(_.then($=>{$.issues.length&&r.issues.push(...he(h,$.issues)),r.value[h]=$.value})):(_.issues.length&&r.issues.push(...he(h,_.issues)),r.value[h]=_.value)}let y;for(let h in i)d.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let y=t.keyType._zod.run({value:d,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&pr.test(d)&&y.issues.length){let $=t.keyType._zod.run({value:Number(d),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(y=$)}if(y.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map($=>ve($,n,le())),input:d,path:[d],inst:e});continue}let _=t.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?u.push(_.then($=>{$.issues.length&&r.issues.push(...he(d,$.issues)),r.value[y.value]=$.value})):(_.issues.length&&r.issues.push(...he(d,_.issues)),r.value[y.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Kn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>bn.has(typeof i)).map(i=>typeof i=="string"?we(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let l=i.value;return n.has(l)||i.issues.push({code:"invalid_value",values:r,input:l,inst:e}),i}}),Jn=b("$ZodLiteral",(e,t)=>{if(H.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"?we(n):n?we(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 Xn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(r.value=l,r));if(i instanceof Promise)throw new se;return r.value=i,r}});function Cn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Cn,"handleOptionalResult");var Yn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(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=>Cn(u,r.value)):Cn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Qn=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)}|null)$`):void 0}),q(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 eo=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(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(l=>St(l,t.in,n)):St(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>St(u,t.out,n)):St(i,t.out,n)}});function St(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(St,"handlePipeResult");var to=b("$ZodCustom",(e,t)=>{Ne.init(e,t),H.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=>Un(u,r,n,e));Un(i,r,n,e)}});function Un(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(lr(i))}}o(Un,"handleRefineResult");var no,yu=Symbol("ZodOutput"),hu=Symbol("ZodInput"),yr=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 oo(){return new yr}o(oo,"registry");(no=globalThis).__zod_globalRegistry??(no.__zod_globalRegistry=oo());var hr=globalThis.__zod_globalRegistry;function io(e,t){return new e({type:"string",...V(t)})}o(io,"_string");function ao(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(ao,"_coercedString");function so(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(so,"_url");function uo(e,t){return new e({type:"number",checks:[],...V(t)})}o(uo,"_number");function co(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(co,"_coercedNumber");function lo(e,t){return new e({type:"boolean",...V(t)})}o(lo,"_boolean");function po(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(po,"_coercedBoolean");function mo(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(mo,"_coercedBigint");function fo(e){return new e({type:"any"})}o(fo,"_any");function go(e){return new e({type:"unknown"})}o(go,"_unknown");function yo(e,t){return new e({type:"void",...V(t)})}o(yo,"_void");function ho(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(ho,"_coercedDate");function oe(e,t){return new On({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function xe(e,t){return new kn({check:"string_format",format:"regex",...V(t),pattern:e})}o(xe,"_regex");function vo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(vo,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Et(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Xe(e,r,n),e.parseAsync=async(r,n)=>At(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ye(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)=>$t(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),wt=b("ZodMiniString",(e,t)=>{Ot.init(e,t),K.init(e,t)});function a(e){return io(wt,e)}o(a,"string");var xo=b("ZodMiniStringFormat",(e,t)=>{mr.init(e,t),wt.init(e,t)});var Au=b("ZodMiniURL",(e,t)=>{Mn.init(e,t),xo.init(e,t)});function _o(e){return so(Au,e)}o(_o,"url");var vr=b("ZodMiniNumber",(e,t)=>{jn.init(e,t),K.init(e,t)});function X(e){return uo(vr,e)}o(X,"number");var xr=b("ZodMiniBoolean",(e,t)=>{fr.init(e,t),K.init(e,t)});function B(e){return lo(xr,e)}o(B,"boolean");var Po=b("ZodMiniBigInt",(e,t)=>{Ln.init(e,t),K.init(e,t)});var Su=b("ZodMiniAny",(e,t)=>{Fn.init(e,t),K.init(e,t)});function et(){return fo(Su)}o(et,"any");var zu=b("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),K.init(e,t)});function O(){return go(zu)}o(O,"unknown");var Ou=b("ZodMiniVoid",(e,t)=>{Zn.init(e,t),K.init(e,t)});function bo(e){return yo(Ou,e)}o(bo,"_void");var Io=b("ZodMiniDate",(e,t)=>{Vn.init(e,t),K.init(e,t)});var ku=b("ZodMiniArray",(e,t)=>{Hn.init(e,t),K.init(e,t)});function R(e,t){return new ku({type:"array",element:e,...V(t)})}o(R,"array");var wu=b("ZodMiniObject",(e,t)=>{Wn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function c(e,t){let r={type:"object",shape:e??{},...V(t)};return new wu(r)}o(c,"object");var Ru=b("ZodMiniUnion",(e,t)=>{gr.init(e,t),K.init(e,t)});function N(e,t){return new Ru({type:"union",options:e,...V(t)})}o(N,"union");var Nu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Gn.init(e,t),K.init(e,t)});function De(e,t,r){return new Nu({type:"union",options:t,discriminator:e,...V(r)})}o(De,"discriminatedUnion");var Du=b("ZodMiniRecord",(e,t)=>{qn.init(e,t),K.init(e,t)});function k(e,t,r){return new Du({type:"record",keyType:e,valueType:t,...V(r)})}o(k,"record");var Cu=b("ZodMiniEnum",(e,t)=>{Kn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Cu({type:"enum",entries:r,...V(t)})}o(C,"_enum");var Uu=b("ZodMiniLiteral",(e,t)=>{Jn.init(e,t),K.init(e,t)});function E(e,t){return new Uu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(E,"literal");var Mu=b("ZodMiniTransform",(e,t)=>{Xn.init(e,t),K.init(e,t)});function _e(e){return new Mu({type:"transform",transform:e})}o(_e,"transform");var ju=b("ZodMiniOptional",(e,t)=>{Yn.init(e,t),K.init(e,t)});function g(e){return new ju({type:"optional",innerType:e})}o(g,"optional");var Lu=b("ZodMiniNullable",(e,t)=>{Qn.init(e,t),K.init(e,t)});function tt(e){return new Lu({type:"nullable",innerType:e})}o(tt,"nullable");var Fu=b("ZodMiniPipe",(e,t)=>{eo.init(e,t),K.init(e,t)});function Pe(e,t){return new Fu({type:"pipe",in:e,out:t})}o(Pe,"pipe");var Bu=b("ZodMiniCustom",(e,t)=>{to.init(e,t),K.init(e,t)});function Rt(e,t){return vo(Bu,e??(()=>!0),t)}o(Rt,"custom");var rt={};yn(rt,{bigint:()=>Ku,boolean:()=>qu,date:()=>Ju,number:()=>Gu,string:()=>Wu});function Wu(e){return ao(wt,e)}o(Wu,"string");function Gu(e){return co(vr,e)}o(Gu,"number");function qu(e){return po(xr,e)}o(qu,"boolean");function Ku(e){return mo(Po,e)}o(Ku,"bigint");function Ju(e){return ho(Io,e)}o(Ju,"date");var Pr=c({retryOnFailure:c({defaultValue:g(B()),hide:g(B())}),continueOnFailure:c({defaultValue:g(B()),hide:g(B())})}),_r=class{constructor(t,r,n,i,u,l,d,y,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=l;this.requireAuth=d;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{o(this,"IAction")}},be=o(e=>new _r(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 L=c({displayName:a(),description:g(a())}),D=o((e,t)=>c({type:E(t),required:B(),defaultValue:g(et())}),"TPropertyValue");var ee=c({...L.shape,...D(a(),"SHORT_TEXT").shape}),pe=c({...L.shape,...D(a(),"LONG_TEXT").shape});var $o=c({label:a(),value:O()}),Nt=c({disabled:g(B()),placeholder:g(a()),options:R($o)});var te=c({...L.shape,options:Nt,...D(O(),"STATIC_DROPDOWN").shape}),de=c({...L.shape,options:Nt,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var br=c({...L.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),nt=c({...L.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var me=c({...L.shape,...D(B(),"CHECKBOX").shape});var fe=c({...L.shape,...D(X(),"NUMBER").shape});var ot=c({...L.shape,...D(O(),"FILE").shape});var it=c({...L.shape,...D(a(),"DATE_TIME").shape});var Eo=k(a(),N([ee,pe,te,nt,de,me,fe,ot,it])),at=c({...L.shape,properties:Eo,...D(R(O()),"ARRAY").shape});var st=c({...L.shape,...D(N([k(a(),O())]),"JSON").shape});var Ao=N([ee,te,st,at,de]),Yu=k(a(),Ao),Ir=c({refreshers:R(a()),...L.shape,...D(O(),"DYNAMIC").shape});var Dt=c({...L.shape,...D(bo(),"MARKDOWN").shape});var ut=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ut||{}),Ce=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ce||{}),Ue=(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))(Ue||{});var ct=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ct||{}),Tr="both_client_credentials_and_authorization_code";var Ee=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ee||{}),lt=(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))(lt||{}),Qu=c({strategy:C(lt),paramName:g(a())}),pt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(pt||{});var Ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ct||{}),So=c({status:g(X()),body:g(O()),headers:g(k(a(),a()))}),zo=c({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(C(Ct))}),Oo=c({type:E("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:So,handlerId:g(a()),streamStepProgress:g(C(Ct))}),ec=N([zo,Oo]);var tc=c({body:O(),rawBody:g(O()),headers:k(a(),a()),queryParams:k(a(),a())});function ge(e){return e==null}o(ge,"isNil");function dt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(dt,"isEmpty");function Ut(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ut,"assertNotNullOrUndefined");async function mt(e){try{return{data:await e(),error:null}}catch(t){return{data:null,error:t}}}o(mt,"tryCatch");var $r=ke(require("crypto"),1);var rc=128,Ae,Me,nc=o(e=>{!Ae||Ae.length<e?(Ae=Buffer.allocUnsafe(e*rc),$r.default.randomFillSync(Ae),Me=0):Me+e>Ae.length&&($r.default.randomFillSync(Ae),Me=0),Me+=e},"fillPool"),oc=o(e=>(nc(e|=0),Ae.subarray(Me-e,Me)),"random"),ic=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 l="";for(;;){let d=r(i),y=i;for(;y--;)if(l+=e[d[y]&n]||"",l.length===u)return l}}},"customRandom"),wo=o((e,t=21)=>ic(e,t,oc),"customAlphabet");var ac="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ro=21,lb=a().check(xe(new RegExp(`^[0-9a-zA-Z]{${Ro}}$`))),sc=wo(ac,Ro);var Ie=Pe(_e(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Ie,updated:Ie},Z=o(e=>g(tt(e)),"Nullable");function Er(e){return g(tt(C(e)))}o(Er,"NullableEnum");var mb=Pe(_e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(B())),Mt=o(e=>Pe(_e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var yb=k(a(),O());var ft=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(ft||{});var Sb=a().check(xe(/^#[0-9A-Fa-f]{6}$/));var Ob=c({filename:a(),data:O(),type:E("file"),mimetype:g(a())});var uc=ke(Do());var Ub=c({...re,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:g(X())});var Co=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Co||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),Sr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Sr||{});var zr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(zr||{});var Or=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Or||{});var cc=c({mode:C(Co),value:O()}),lc=c({auth:g(a()),fields:k(a(),cc)}),pc=c({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(lc)}),dc=c({type:E("PIECE"),toolName:a().check(oe(1)),pieceMetadata:pc}),mc=c({type:E("none")}),fc=c({type:E("access_token"),accessToken:a()}),gc=c({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),yc=c({type:E("headers"),headers:k(a(),a())}),hc=De("type",[mc,fc,gc,yc]),Uo=c({type:E("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:g(a())}),Mo=c({type:E("MCP"),toolName:a().check(oe(1)),serverUrl:_o(),protocol:C(Sr),auth:hc}),jo=c({type:E("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:C(Ar),sourceId:a(),sourceName:a()}),vc=De("type",[dc,Uo,Mo,jo]),xc=c({displayName:a(),description:g(a()),type:C(zr)}),Lo=c({type:E("MARKDOWN"),markdown:a()}),je={type:E("TOOL_CALL"),input:Z(k(a(),O())),output:g(O()),toolName:a(),status:C(Or),toolCallId:a(),startTime:a(),endTime:g(a())},lI=c(je),Fo=De("toolCallType",[c({...je,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),c({...je,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),c({...je,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),c({...je,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),c({...je,toolCallType:E("UNKNOWN"),displayName:a()})]),_c=N([Lo,Fo]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),ye=c({apiKey:a()}),Pc=ye,bc=c({apiKey:a(),apiKeyHash:a()}),Ic=ye,Tc=ye,$c=ye,Ec=ye,Ac=ye,Sc=ye,zc=ye,Bo=c({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),Oc=c({}),kc=c({}),wc=c({}),Rc=c({}),Nc=c({}),Dc=c({}),Zo=c({modelId:a(),modelName:a(),modelType:C(kr)}),Vo=c({apiKeyHeader:a(),baseUrl:a(),models:R(Zo),defaultHeaders:g(k(a(),a()))}),Ho=c({accountId:a(),gatewayId:a(),models:R(Zo),vertexProject:g(a()),vertexRegion:g(a())}),Wo=c({resourceName:a(),apiVersion:Pe(_e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),Go=c({region:a().check(oe(1))}),Cc=N([Pc,$c,Ec,Ac,Sc,Tc,Ic,bc,Bo,zc]),qo=N([Vo,Ho,Wo,Go,Oc,wc,Rc,Nc,kc,Dc]),Uc=c({id:a(),name:a(),type:C(kr)}),Mc=c({id:a(),name:a(),provider:C(ft),config:qo,enabledForChat:B()}),jc=c({provider:C(ft),config:qo,auth:Cc,platformId:a()});var fI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Lc=c({base64Url:a(),fileName:a(),extension:g(a())}),Fc=c({mimeType:a(),url:a(),fileName:g(a())}),wr=N([Lc,Fc]);var Bc=N([c({type:E("file"),value:wr}),c({type:E("markdown"),value:a(),files:g(R(wr))})]),Zc=c({sessionId:a(),message:a(),files:g(R(a()))});var Jo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Jo||{}),Xo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Xo||{}),Rr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Rr||{});var Vc=N([c({...re,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:c({options:R(c({value:a()}))})}),c({...re,name:a(),externalId:a(),type:N([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),Hc=c({...re,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Er(Xo),trigger:Er(Jo)}),Wc=c({...re,tableId:a(),projectId:a(),cells:k(a(),c({updated:a(),created:a(),value:O(),fieldName:a()}))}),Gc=c({events:R(C(Rr)),webhookUrl:a(),flowId:a()}),qc=c({fields:R(c({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),Kc=c({projectId:a(),limit:g(rt.number()),cursor:g(a()),name:g(a()),externalIds:Mt(a()),folderId:g(a()),folderIds:Mt(a())}),Jc=c({records:R(R(c({fieldId:a(),value:Qo()}))),tableId:a()}),Xc=c({cells:g(R(c({fieldId:a(),value:Qo()}))),tableId:a(),agentUpdate:g(B())}),Yo=De("operator",[Se("eq"),Se("neq"),Se("gt"),Se("gte"),Se("lt"),Se("lte"),Se("co"),Ko("exists"),Ko("not_exists")]),Yc=c({tableId:a(),limit:g(rt.number()),cursor:g(a()),filters:Mt(Yo)});function Qo(){return Pe(_e(e=>e==null?e:String(e)),tt(a()))}o(Qo,"coerceToString");function Se(e){return c({fieldId:a(),operator:E(e),value:a()})}o(Se,"valueFilter");function Ko(e){return c({fieldId:a(),operator:E(e)})}o(Ko,"existenceFilter");var Qc=c({status:g(X()),body:g(O()),headers:g(k(a(),a()))}),el=c({...re,deleted:Z(Ie),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var ei=c({name:a(),description:g(a()),type:a(),required:B()}),tl=c({pieceName:a(),triggerName:a(),input:c({toolName:a(),toolDescription:a(),inputSchema:R(ei),returnsResponse:B()})});var ti="^[0-9]+\\.[0-9]+\\.[0-9]+$",RI=new RegExp(ti),nl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",NI=a().check(xe(new RegExp(ti))),DI=a().check(xe(new RegExp(nl))),ol=c({packageType:E("ARCHIVE"),pieceType:C(Ce),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ri=c({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ni=c({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),CI=N([ri,ni]),UI=N([ol,ri,ni]),oi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(oi||{}),il=c({type:C(oi),cronExpression:a(),timezone:a()}),MI=c({...re,type:C(Ee),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(il),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ii=(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))(ii||{}),ai=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ai||{}),si=(r=>(r.S3="S3",r.DB="DB",r))(si||{}),jI=c({...re,projectId:Z(a()),platformId:Z(a()),type:C(ii),compression:C(ai),data:g(O()),location:C(si),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),ui=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ui||{}),ci=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ci||{}),LI=c({id:a(),email:a(),firstName:a(),status:C(ci),externalId:Z(a()),platformId:Z(a()),platformRole:C(ui),lastName:a(),created:Ie,updated:Ie,lastActiveDate:Z(Ie),imageUrl:Z(a())});var Nr=c({...L.shape,...D(k(a(),O()),"OBJECT").shape});var mi=c({...L.shape,...D(a(),"COLOR").shape});var Dr=N([ee,pe,Dt,me,te,de,br,nt,Ir,fe,at,Nr,st,it,ot,mi]),F={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 ue=c({displayName:a(),description:g(a())});var fi=c({username:a(),password:a()}),Cr=c({...ue.shape,username:c({displayName:a(),description:g(a())}),password:c({displayName:a(),description:g(a())}),...D(fi,"BASIC_AUTH").shape});var cl=k(a(),N([ee,pe,fe,me,te])),Ur=c({...ue.shape,props:cl,...D(O(),"CUSTOM_AUTH").shape});var ze=c({...ue.shape,...D(c({auth:a()}),"SECRET_TEXT").shape});var ll=k(a(),N([ee,pe,ze,fe,me,te,de,Dt])),gi=c({...ue.shape,props:ll,...D(O(),"OIDC").shape});var Mr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Mr||{}),yi=N([ee,ze,te]),hi=k(a(),yi),pl=c({props:g(k(a(),yi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(N([E("none"),E("consent"),E("login"),E("omit")])),pkce:g(B()),pkceMethod:g(N([E("plain"),E("S256")])),authorizationMethod:g(C(Mr)),grantType:g(N([C(ct),E(Tr)])),extra:g(k(a(),a()))}),vi=c({access_token:a(),props:g(hi),data:k(a(),et())}),jr=c({...ue.shape,...pl.shape,...D(vi,"OAUTH2").shape});var Le=N([Cr,Ur,gi,jr,ze]),gt="Connection",Lt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||gt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||gt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||gt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||gt}},None(){}};var v$={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 dl=c({...L.shape,...D(O(),"CUSTOM").shape,code:a()});var ml=N([Dr,Le]),Lr=k(a(),ml),M$=k(a(),Dr);var xi=N([c({strategy:E("CRON"),cronExpression:a()}),c({strategy:E("NONE")})]);var _i="2",Ft="0.82.0";var Fr=class{constructor(t,r,n,i,u,l,d,y,h=Ft,_,$=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:_i}),"getContextInfo");(!fl(h)||gl(h,Ft))&&(this.minimumSupportedRelease=Ft),u.forEach(x=>this._actions[x.name]=x),l.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}},Pi=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 fl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(fl,"isValidSimpleSemver");function gl(e,t){let[r,n,i]=e.split(".").map(Number),[u,l,d]=t.split(".").map(Number);return r!==u?r<u:n!==l?n<l:i<d}o(gl,"isSemverLessThan");var yl=g(k(a(),k(a(),a()))),bi=c({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(N([Le,R(Le)])),version:a(),categories:g(R(C(Ue))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),i18n:yl}),hl=C(["human","ai","both"]),Ii=c({description:g(a()),idempotent:g(B())}),Ti=c({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:B(),errorHandlingOptions:g(Pr),outputSchema:g(Rt()),audience:g(hl),aiMetadata:g(Ii)}),$i=c({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:g(Pr),type:C(Ee),sampleData:O(),handshakeConfiguration:g(Rt()),renewConfiguration:g(xi),testStrategy:C(pt),outputSchema:g(Rt()),aiMetadata:g(Ii)}),vl=c({...bi.shape,actions:k(a(),Ti),triggers:k(a(),$i)}),xl=c({...bi.shape,actions:X(),triggers:X(),suggestedActions:g(R($i)),suggestedTriggers:g(R(Ti))}),Ei=c({projectUsage:X(),tags:g(R(a())),pieceType:C(Ce),packageType:C(ut),platformId:g(a()),archiveId:g(a())}),ME=c({...vl.shape,...Ei.shape}),jE=c({...xl.shape,...Ei.shape}),LE=c({name:a(),version:a()});var _l=ke(require("path")),Pl=ke(require("fs/promises"));var Bt=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,l)=>{i.append(l,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 Zt=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 Vt=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 Ht=class extends Bt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Zt){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),l=t.queryParams??{};for(let[M,Q]of Object.entries(l))i.append(M,Q);let d=i.toString(),y=d?`${n}?${d}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:p}=bl(t.body,u),f=Tl({...u,...s}),m=await Il(async()=>{let M=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:f,body:x,redirect:_?"follow":"manual",signal:M.signal};return p&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(y,ne)}finally{Q!==void 0&&clearTimeout(Q)}},$),v=_?300:400;if(m.status<200||m.status>=v){let M=await Ai(m,h),Q=new Vt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let P=await Ai(m,h);return{status:m.status,headers:$l(m.headers),body:P}}};function bl(e,t){return Al(e)?{body:void 0,extraHeaders:{},isStream:!1}:El(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(bl,"serializeBody");async function Ai(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(Ai,"parseResponseBody");async function Il(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(Il,"sendWithRetries");function Si(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Si,"backoff");function Tl(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(Tl,"normalizeHeaders");function $l(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o($l,"toHttpHeaders");function El(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(El,"isNodeFormData");function Al(e){return e==null}o(Al,"isNil");var Wt=new Ht;var Gt=(l=>(l.GET="GET",l.POST="POST",l.PATCH="PATCH",l.PUT="PUT",l.DELETE="DELETE",l.HEAD="HEAD",l))(Gt||{});var fd=ke(require("fs")),Ns=ke(Rs());var gd={"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 yd(e){let t=e.split(";")[0].trim().toLowerCase();return gd[t]??""}o(yd,"contentTypeToExtension");var hd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),vd=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 Ds({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:l,extraProps:d,authLocation:y="headers"}){return be({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:F.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:F.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${vd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...l?.url??{}})}),"props")}),method:F.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Gt).map(h=>({label:h,value:h}))},...l?.method??{}}),headers:F.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...l?.headers??{}}),queryParams:F.Object({displayName:"Query Parameters",required:!0,...l?.queryParams??{}}),body_type:F.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:F.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,$={};switch(_){case"none":break;case"json":$.data=F.Json({displayName:"JSON Body",required:!0,...l?.body??{}});break;case"raw":$.data=F.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=F.Array({displayName:"Form Data",required:!0,properties:{fieldName:F.ShortText({displayName:"Field Name",required:!0}),fieldType:F.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:F.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:F.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:F.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:F.Checkbox({displayName:"No Error on Failure",required:!1,...l?.failsafe??{}}),timeout:F.Number({displayName:"Timeout (in seconds)",required:!1,...l?.timeout??{}}),followRedirects:F.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:_,url:$,headers:x,queryParams:s,body:p,body_type:f,failsafe:m,timeout:v,response_is_binary:P,followRedirects:M}=h.propsValue;Ut(_,"Method"),Ut($,"URL");let Q=ge(r)?{}:await r(h.auth,h.propsValue),ne=$.url,Ge=ne.startsWith("http://")||ne.startsWith("https://")?ne:hd({baseUrl:t(h.auth),relativePath:ne}),$e={method:_,url:Ge,headers:{...x??{},...y==="headers"||!ge(y)?Q:{}},queryParams:{...y==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(P&&($e.responseType="arraybuffer"),p)if(f&&f!=="none"){let ce=p.data;if(f==="form_data"){let Gs=ce,_t=new Ns.default;for(let{fieldName:mn,fieldType:fn,textFieldValue:gn,fileFieldValue:ir}of Gs)fn==="text"&&!dt(gn)?_t.append(mn,gn):fn==="file"&&!dt(ir)&&_t.append(mn,ir.data,{filename:ir?.filename});$e.body=_t,$e.headers={...$e.headers,..._t.getHeaders()}}else $e.body=ce}else f||($e.body=p);try{let ce=await Wt.sendRequest($e);return await xd(h.files,ce.body,ce.status,ce.headers,P)}catch(ce){if(m)return ce.errorMessage();throw ce}},"run")})}o(Ds,"createCustomApiCallAction");var xd=o(async(e,t,r,n,i)=>{let u;if(i&&_d(t)){let l=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=yd(l??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),_d=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");async function Cs(e){await pn({auth:e,limit:1})}o(Cs,"validateAlgoliaAuth");async function pn({auth:e,limit:t=1e3}){let r=[],n=0;for(;r.length<t;){let i=t-r.length,u=await xt({auth:e,method:"GET",path:"/indexes",queryParams:{page:String(n),hitsPerPage:String(Math.min(i,bd))}});if(r.push(...u.items),u.items.length===0||n+1>=u.nbPages)break;n+=1}return r}o(pn,"listAlgoliaIndices");async function Us({auth:e,indexName:t,records:r}){let n=await xt({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/batch`,body:{requests:r.map(i=>({action:"addObject",body:i}))}});return await Ls({auth:e,indexName:t,taskId:n.taskID}),n}o(Us,"saveAlgoliaRecords");async function Ms({auth:e,indexName:t,limit:r=1e4}){let n=[],i;do{let u=await xt({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/browse`,body:i?{cursor:i}:{}});n.push(...u.hits),i=u.cursor}while(i&&n.length<r);return n.slice(0,r)}o(Ms,"browseAlgoliaRecords");async function js({auth:e,indexName:t,objectIDs:r}){let n=await xt({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/batch`,body:{requests:r.map(i=>({action:"deleteObject",body:{objectID:i}}))}});return await Ls({auth:e,indexName:t,taskId:n.taskID}),n}o(js,"deleteAlgoliaRecords");async function Ls({auth:e,indexName:t,taskId:r}){for(let n=0;n<Id;n+=1){if((await xt({auth:e,method:"GET",path:`/indexes/${encodeURIComponent(t)}/task/${r}`})).status==="published")return;await Pd(Td)}throw new Error("The Algolia operation is taking too long. Try again or check your Algolia dashboard for the task status.")}o(Ls,"waitForTask");async function xt({auth:e,method:t,path:r,body:n,queryParams:i}){let u={method:t,url:`https://${e.props.applicationId}.algolia.net/1${r}`,headers:{"x-algolia-application-id":e.props.applicationId,"x-algolia-api-key":e.props.apiKey,Accept:"application/json","Content-Type":"application/json"},...n?{body:n}:{},...i?{queryParams:i}:{}};return(await Wt.sendRequest(u)).body}o(xt,"sendRequest");function Pd(e){return new Promise(t=>{setTimeout(t,e)})}o(Pd,"sleep");var bd=1e3,Id=30,Td=1e3;var ae=Lt.CustomAuth({displayName:"Connection",description:"Authenticate with your Algolia Application ID and API key.\n\nTo get your credentials:\n1. Sign in to the Algolia dashboard.\n2. Open **Settings > API Keys**.\n3. Copy your **Application ID**.\n4. Copy an API key that can list indexes and manage records.\n\nThis piece needs permissions for `listIndexes`, `browse`, `addObject`, and `deleteObject`. Search-only API keys won't work for these actions.",required:!0,props:{applicationId:F.ShortText({displayName:"Application ID",description:"Your Algolia application ID.",required:!0}),apiKey:Lt.SecretText({displayName:"API Key",description:"An Algolia API key with index browsing and record write permissions.",required:!0})},validate:o(async({auth:e})=>{let{error:t}=await mt(()=>Cs({props:{applicationId:e.applicationId,apiKey:e.apiKey}}));return t?{valid:!1,error:"Invalid Algolia credentials or missing required index permissions."}:{valid:!0}},"validate")});function We(e,t){if(typeof e!="string"||e.trim().length===0)throw new Error(`${t} is required.`);return e.trim()}o(We,"parseRequiredString");function Fs(e,t){if(!Array.isArray(e)||e.length===0)throw new Error(`${t} must contain at least one value.`);return e.map((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`${t} item ${n+1} must be a non-empty string.`);return r.trim()})}o(Fs,"parseStringArray");function Bs(e){if(!Array.isArray(e)||e.length===0)throw new Error("Records must be a non-empty array of JSON objects.");return e.map((t,r)=>{if(!$d(t))throw new Error(`Record ${r+1} must be a JSON object with JSON-compatible values.`);return t})}o(Bs,"parseAlgoliaRecordArray");function Zs(e){if(!nr(e))return!1;let t=e.props;return nr(t)?typeof t.applicationId=="string"&&t.applicationId.trim().length>0&&typeof t.apiKey=="string"&&t.apiKey.trim().length>0:!1}o(Zs,"isAlgoliaAuthValue");function $d(e){return nr(e)?Object.values(e).every(dn):!1}o($d,"isAlgoliaRecord");function dn(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null?!0:Array.isArray(e)?e.every(dn):nr(e)&&Object.values(e).every(dn)}o(dn,"isAlgoliaJsonValue");function nr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(nr,"isObject");var or={index:o((e=!0)=>F.Dropdown({auth:ae,displayName:"Index",description:"Select the Algolia index to use.",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!Zs(t))return{disabled:!0,options:[],placeholder:"Connect your account first"};let{data:r,error:n}=await mt(()=>pn({auth:t}));return n?{disabled:!0,options:[],placeholder:"Failed to load indices. Check your connection."}:r.length===0?{disabled:!1,options:[],placeholder:"No indices found. Save records to a new index first."}:{disabled:!1,options:r.map(i=>({label:i.name,value:i.name}))}},"options")}),"index")};var Vs=be({auth:ae,name:"browse-records",displayName:"Browse Records",description:"Retrieves records from an Algolia index.",audience:"both",aiMetadata:{description:"Retrieves the raw records stored in an Algolia index, paging through them up to an optional limit (default 10,000). Use this to dump or inspect index contents; it is a read-only lookup, not a relevance-ranked query, so it does not accept a search term. Idempotent.",idempotent:!0},props:{indexName:or.index(),limit:F.Number({displayName:"Limit",description:"Maximum number of records to retrieve. Defaults to 10,000.",required:!1,defaultValue:1e4})},async run(e){let t=We(e.propsValue.indexName,"Index");return Ms({auth:e.auth,indexName:t,limit:e.propsValue.limit??1e4})}});var Hs=be({auth:ae,name:"delete-records",displayName:"Delete Records",description:"Deletes records from an Algolia index by objectID.",audience:"both",aiMetadata:{description:"Deletes records from an Algolia index by their objectIDs. Provide an array of the exact objectIDs to remove from the selected index. Idempotent: deleting the same IDs again leaves the index in the same state (already-absent IDs are simply no-ops).",idempotent:!0},props:{indexName:or.index(),recordIds:F.Array({displayName:"Record IDs",description:"Provide the Algolia objectIDs to delete from the selected index.",required:!0})},async run(e){let t=We(e.propsValue.indexName,"Index"),r=Fs(e.propsValue.recordIds,"Record IDs");return js({auth:e.auth,indexName:t,objectIDs:r})}});var Ws=be({auth:ae,name:"save-records",displayName:"Save Records",description:"Adds or updates records in an Algolia index.",audience:"both",aiMetadata:{description:"Adds or updates one or more records in an Algolia search index (creating the index if it does not yet exist). Pass an array of JSON objects; include an `objectID` on a record to overwrite that existing record, or omit it to have Algolia generate a new one. Not idempotent: records without an `objectID` create a fresh record on every call, so repeating the call appends duplicates.",idempotent:!1},props:{indexName:F.ShortText({displayName:"Index Name",description:"Enter an existing index name or a new one \u2014 Algolia creates it automatically.",required:!0}),records:F.Json({displayName:"Records",description:"Provide an array of JSON objects to save. Include `objectID` to update an existing record, or omit it to let Algolia create one.",required:!0})},async run(e){let t=We(e.propsValue.indexName,"Index Name"),r=Bs(e.propsValue.records);return Us({auth:e.auth,indexName:t,records:r})}});var Ed=Pi({displayName:"Algolia",description:"Manage your Algolia search indices \u2014 add, browse, and delete records.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/algolia.png",categories:["DEVELOPER_TOOLS"],authors:["veri5ied"],auth:ae,actions:[Ws,Vs,Hs,Ds({auth:ae,baseUrl:o(e=>e?`https://${e.props.applicationId}.algolia.net/1`:"","baseUrl"),authMapping:o(async e=>({"x-algolia-application-id":e.props.applicationId,"x-algolia-api-key":e.props.apiKey}),"authMapping")})],triggers:[]});0&&(module.exports={algolia});
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
mime-types/index.js:
|
|
7
|
+
(*!
|
|
8
|
+
* mime-types
|
|
9
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*)
|
|
13
|
+
*/
|
package/src/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const algolia: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>>;
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AAErD,iEAAmE;AACnE,iEAAmE;AACnE,6DAA+D;AAC/D,4CAAgD;AAEnC,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,uEAAuE;IACzE,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,IAAI,EAAE,kBAAW;IACjB,OAAO,EAAE;QACP,gCAAiB;QACjB,oCAAmB;QACnB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAW;YACjB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC;gBAED,OAAO,WAAW,IAAI,CAAC,KAAK,CAAC,aAAa,gBAAgB,CAAC;YAC7D,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;oBACpD,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;iBACvC,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const browseRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>>;
|
|
12
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
-
}>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.browseRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const utils_1 = require("../common/utils");
|
|
10
|
-
exports.browseRecordsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.algoliaAuth,
|
|
12
|
-
name: 'browse-records',
|
|
13
|
-
displayName: 'Browse Records',
|
|
14
|
-
description: 'Retrieves records from an Algolia index.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Retrieves the raw records stored in an Algolia index, paging through them up to an optional limit (default 10,000). Use this to dump or inspect index contents; it is a read-only lookup, not a relevance-ranked query, so it does not accept a search term. Idempotent.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
indexName: props_1.algoliaProps.index(),
|
|
22
|
-
limit: pieces_framework_1.Property.Number({
|
|
23
|
-
displayName: 'Limit',
|
|
24
|
-
description: 'Maximum number of records to retrieve. Defaults to 10,000.',
|
|
25
|
-
required: false,
|
|
26
|
-
defaultValue: 10000,
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
run(context) {
|
|
30
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a;
|
|
32
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index');
|
|
33
|
-
return (0, client_1.browseAlgoliaRecords)({
|
|
34
|
-
auth: context.auth,
|
|
35
|
-
indexName,
|
|
36
|
-
limit: (_a = context.propsValue.limit) !== null && _a !== void 0 ? _a : 10000,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=browse-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browse-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/browse-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAwD;AACxD,2CAA+C;AAC/C,2CAAsD;AAEzC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,0QAA0Q;QACvR,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,oBAAY,CAAC,KAAK,EAAE;QAC/B,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAM;SACrB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAE7E,OAAO,IAAA,6BAAoB,EAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,KAAK,EAAE,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,KAAM;aAC1C,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const deleteRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>>;
|
|
12
|
-
recordIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
13
|
-
}>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const utils_1 = require("../common/utils");
|
|
10
|
-
exports.deleteRecordsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.algoliaAuth,
|
|
12
|
-
name: 'delete-records',
|
|
13
|
-
displayName: 'Delete Records',
|
|
14
|
-
description: 'Deletes records from an Algolia index by objectID.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Deletes records from an Algolia index by their objectIDs. Provide an array of the exact objectIDs to remove from the selected index. Idempotent: deleting the same IDs again leaves the index in the same state (already-absent IDs are simply no-ops).',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
indexName: props_1.algoliaProps.index(),
|
|
22
|
-
recordIds: pieces_framework_1.Property.Array({
|
|
23
|
-
displayName: 'Record IDs',
|
|
24
|
-
description: 'Provide the Algolia objectIDs to delete from the selected index.',
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
},
|
|
28
|
-
run(context) {
|
|
29
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index');
|
|
31
|
-
const objectIDs = (0, utils_1.parseStringArray)(context.propsValue.recordIds, 'Record IDs');
|
|
32
|
-
return (0, client_1.deleteAlgoliaRecords)({
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
indexName,
|
|
35
|
-
objectIDs,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=delete-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAwD;AACxD,2CAA+C;AAC/C,2CAAwE;AAE3D,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,yPAAyP;QACtQ,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,oBAAY,CAAC,KAAK,EAAE;QAC/B,SAAS,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7E,MAAM,SAAS,GAAG,IAAA,wBAAgB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAE/E,OAAO,IAAA,6BAAoB,EAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,SAAS;aACV,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const saveRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
records: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
7
|
-
}>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const utils_1 = require("../common/utils");
|
|
9
|
-
exports.saveRecordsAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.algoliaAuth,
|
|
11
|
-
name: 'save-records',
|
|
12
|
-
displayName: 'Save Records',
|
|
13
|
-
description: 'Adds or updates records in an Algolia index.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Adds or updates one or more records in an Algolia search index (creating the index if it does not yet exist). Pass an array of JSON objects; include an `objectID` on a record to overwrite that existing record, or omit it to have Algolia generate a new one. Not idempotent: records without an `objectID` create a fresh record on every call, so repeating the call appends duplicates.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
indexName: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Index Name',
|
|
22
|
-
description: 'Enter an existing index name or a new one — Algolia creates it automatically.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
records: pieces_framework_1.Property.Json({
|
|
26
|
-
displayName: 'Records',
|
|
27
|
-
description: 'Provide an array of JSON objects to save. Include `objectID` to update an existing record, or omit it to let Algolia create one.',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index Name');
|
|
34
|
-
const records = (0, utils_1.parseAlgoliaRecordArray)(context.propsValue.records);
|
|
35
|
-
return (0, client_1.saveAlgoliaRecords)({
|
|
36
|
-
auth: context.auth,
|
|
37
|
-
indexName,
|
|
38
|
-
records,
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=save-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/save-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAsD;AACtD,2CAA+E;AAElE,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,+XAA+X;QAC5Y,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,+EAA+E;YACjF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACrB,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,kIAAkI;YACpI,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAClF,MAAM,OAAO,GAAG,IAAA,+BAAuB,EAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAEpE,OAAO,IAAA,2BAAkB,EAAC;gBACxB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/auth.d.ts
DELETED
package/src/lib/common/auth.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algoliaAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
exports.algoliaAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
9
|
-
displayName: 'Connection',
|
|
10
|
-
description: `Authenticate with your Algolia Application ID and API key.
|
|
11
|
-
|
|
12
|
-
To get your credentials:
|
|
13
|
-
1. Sign in to the Algolia dashboard.
|
|
14
|
-
2. Open **Settings > API Keys**.
|
|
15
|
-
3. Copy your **Application ID**.
|
|
16
|
-
4. Copy an API key that can list indexes and manage records.
|
|
17
|
-
|
|
18
|
-
This piece needs permissions for \`listIndexes\`, \`browse\`, \`addObject\`, and \`deleteObject\`. Search-only API keys won't work for these actions.`,
|
|
19
|
-
required: true,
|
|
20
|
-
props: {
|
|
21
|
-
applicationId: pieces_framework_1.Property.ShortText({
|
|
22
|
-
displayName: 'Application ID',
|
|
23
|
-
description: 'Your Algolia application ID.',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
27
|
-
displayName: 'API Key',
|
|
28
|
-
description: 'An Algolia API key with index browsing and record write permissions.',
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
33
|
-
const { error } = yield (0, shared_1.tryCatch)(() => (0, client_1.validateAlgoliaAuth)({
|
|
34
|
-
props: {
|
|
35
|
-
applicationId: auth.applicationId,
|
|
36
|
-
apiKey: auth.apiKey,
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
if (error) {
|
|
40
|
-
return {
|
|
41
|
-
valid: false,
|
|
42
|
-
error: 'Invalid Algolia credentials or missing required index permissions.',
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
valid: true,
|
|
47
|
-
};
|
|
48
|
-
}),
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,iDAAgD;AAEhD,qCAA+C;AAElC,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE;;;;;;;;sJAQuI;IACpJ,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,CACpC,IAAA,4BAAmB,EAAC;YAClB,KAAK,EAAE;gBACL,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;SACF,CAAC,CACH,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EACH,oEAAoE;aACvE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AlgoliaAuthValue, AlgoliaBatchResponse, AlgoliaIndex, AlgoliaRecord } from './types';
|
|
2
|
-
export declare function validateAlgoliaAuth(auth: AlgoliaAuthValue): Promise<void>;
|
|
3
|
-
export declare function listAlgoliaIndices({ auth, limit, }: {
|
|
4
|
-
auth: AlgoliaAuthValue;
|
|
5
|
-
limit?: number;
|
|
6
|
-
}): Promise<AlgoliaIndex[]>;
|
|
7
|
-
export declare function saveAlgoliaRecords({ auth, indexName, records, }: {
|
|
8
|
-
auth: AlgoliaAuthValue;
|
|
9
|
-
indexName: string;
|
|
10
|
-
records: AlgoliaRecord[];
|
|
11
|
-
}): Promise<AlgoliaBatchResponse>;
|
|
12
|
-
export declare function browseAlgoliaRecords({ auth, indexName, limit, }: {
|
|
13
|
-
auth: AlgoliaAuthValue;
|
|
14
|
-
indexName: string;
|
|
15
|
-
limit?: number;
|
|
16
|
-
}): Promise<AlgoliaRecord[]>;
|
|
17
|
-
export declare function deleteAlgoliaRecords({ auth, indexName, objectIDs, }: {
|
|
18
|
-
auth: AlgoliaAuthValue;
|
|
19
|
-
indexName: string;
|
|
20
|
-
objectIDs: string[];
|
|
21
|
-
}): Promise<AlgoliaBatchResponse>;
|
package/src/lib/common/client.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAlgoliaAuth = validateAlgoliaAuth;
|
|
4
|
-
exports.listAlgoliaIndices = listAlgoliaIndices;
|
|
5
|
-
exports.saveAlgoliaRecords = saveAlgoliaRecords;
|
|
6
|
-
exports.browseAlgoliaRecords = browseAlgoliaRecords;
|
|
7
|
-
exports.deleteAlgoliaRecords = deleteAlgoliaRecords;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
-
function validateAlgoliaAuth(auth) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
yield listAlgoliaIndices({
|
|
13
|
-
auth,
|
|
14
|
-
limit: 1,
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function listAlgoliaIndices(_a) {
|
|
19
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, limit = 1000, }) {
|
|
20
|
-
const indices = [];
|
|
21
|
-
let page = 0;
|
|
22
|
-
while (indices.length < limit) {
|
|
23
|
-
const remaining = limit - indices.length;
|
|
24
|
-
const response = yield sendRequest({
|
|
25
|
-
auth,
|
|
26
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
27
|
-
path: '/indexes',
|
|
28
|
-
queryParams: {
|
|
29
|
-
page: String(page),
|
|
30
|
-
hitsPerPage: String(Math.min(remaining, ALGOLIA_MAX_PAGE_SIZE)),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
indices.push(...response.items);
|
|
34
|
-
if (response.items.length === 0 || page + 1 >= response.nbPages) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
page += 1;
|
|
38
|
-
}
|
|
39
|
-
return indices;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function saveAlgoliaRecords(_a) {
|
|
43
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, records, }) {
|
|
44
|
-
const response = yield sendRequest({
|
|
45
|
-
auth,
|
|
46
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
47
|
-
path: `/indexes/${encodeURIComponent(indexName)}/batch`,
|
|
48
|
-
body: {
|
|
49
|
-
requests: records.map((record) => ({
|
|
50
|
-
action: 'addObject',
|
|
51
|
-
body: record,
|
|
52
|
-
})),
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
yield waitForTask({
|
|
56
|
-
auth,
|
|
57
|
-
indexName,
|
|
58
|
-
taskId: response.taskID,
|
|
59
|
-
});
|
|
60
|
-
return response;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function browseAlgoliaRecords(_a) {
|
|
64
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, limit = 10000, }) {
|
|
65
|
-
const records = [];
|
|
66
|
-
let cursor;
|
|
67
|
-
do {
|
|
68
|
-
const response = yield sendRequest({
|
|
69
|
-
auth,
|
|
70
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
71
|
-
path: `/indexes/${encodeURIComponent(indexName)}/browse`,
|
|
72
|
-
body: cursor ? { cursor } : {},
|
|
73
|
-
});
|
|
74
|
-
records.push(...response.hits);
|
|
75
|
-
cursor = response.cursor;
|
|
76
|
-
} while (cursor && records.length < limit);
|
|
77
|
-
return records.slice(0, limit);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function deleteAlgoliaRecords(_a) {
|
|
81
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, objectIDs, }) {
|
|
82
|
-
const response = yield sendRequest({
|
|
83
|
-
auth,
|
|
84
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
85
|
-
path: `/indexes/${encodeURIComponent(indexName)}/batch`,
|
|
86
|
-
body: {
|
|
87
|
-
requests: objectIDs.map((objectID) => ({
|
|
88
|
-
action: 'deleteObject',
|
|
89
|
-
body: {
|
|
90
|
-
objectID,
|
|
91
|
-
},
|
|
92
|
-
})),
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
yield waitForTask({
|
|
96
|
-
auth,
|
|
97
|
-
indexName,
|
|
98
|
-
taskId: response.taskID,
|
|
99
|
-
});
|
|
100
|
-
return response;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function waitForTask(_a) {
|
|
104
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, taskId, }) {
|
|
105
|
-
for (let attempt = 0; attempt < ALGOLIA_TASK_MAX_ATTEMPTS; attempt += 1) {
|
|
106
|
-
const response = yield sendRequest({
|
|
107
|
-
auth,
|
|
108
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
109
|
-
path: `/indexes/${encodeURIComponent(indexName)}/task/${taskId}`,
|
|
110
|
-
});
|
|
111
|
-
if (response.status === 'published') {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
yield sleep(ALGOLIA_TASK_POLL_INTERVAL_MILLISECONDS);
|
|
115
|
-
}
|
|
116
|
-
throw new Error('The Algolia operation is taking too long. Try again or check your Algolia dashboard for the task status.');
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function sendRequest(_a) {
|
|
120
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, method, path, body, queryParams, }) {
|
|
121
|
-
const request = Object.assign(Object.assign({ method, url: `https://${auth.props.applicationId}.algolia.net/1${path}`, headers: {
|
|
122
|
-
'x-algolia-application-id': auth.props.applicationId,
|
|
123
|
-
'x-algolia-api-key': auth.props.apiKey,
|
|
124
|
-
Accept: 'application/json',
|
|
125
|
-
'Content-Type': 'application/json',
|
|
126
|
-
} }, (body ? { body } : {})), (queryParams ? { queryParams } : {}));
|
|
127
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
128
|
-
return response.body;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function sleep(milliseconds) {
|
|
132
|
-
return new Promise((resolve) => {
|
|
133
|
-
setTimeout(resolve, milliseconds);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
const ALGOLIA_MAX_PAGE_SIZE = 1000;
|
|
137
|
-
const ALGOLIA_TASK_MAX_ATTEMPTS = 30;
|
|
138
|
-
const ALGOLIA_TASK_POLL_INTERVAL_MILLISECONDS = 1000;
|
|
139
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const algoliaProps: {
|
|
2
|
-
index: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
|
9
|
-
};
|
package/src/lib/common/props.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algoliaProps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const auth_1 = require("./auth");
|
|
8
|
-
const client_1 = require("./client");
|
|
9
|
-
const utils_1 = require("./utils");
|
|
10
|
-
exports.algoliaProps = {
|
|
11
|
-
index: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
12
|
-
auth: auth_1.algoliaAuth,
|
|
13
|
-
displayName: 'Index',
|
|
14
|
-
description: 'Select the Algolia index to use.',
|
|
15
|
-
required,
|
|
16
|
-
refreshers: ['auth'],
|
|
17
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
18
|
-
if (!(0, utils_1.isAlgoliaAuthValue)(auth)) {
|
|
19
|
-
return {
|
|
20
|
-
disabled: true,
|
|
21
|
-
options: [],
|
|
22
|
-
placeholder: 'Connect your account first',
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const { data: indices, error } = yield (0, shared_1.tryCatch)(() => (0, client_1.listAlgoliaIndices)({
|
|
26
|
-
auth,
|
|
27
|
-
}));
|
|
28
|
-
if (error) {
|
|
29
|
-
return {
|
|
30
|
-
disabled: true,
|
|
31
|
-
options: [],
|
|
32
|
-
placeholder: 'Failed to load indices. Check your connection.',
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (indices.length === 0) {
|
|
36
|
-
return {
|
|
37
|
-
disabled: false,
|
|
38
|
-
options: [],
|
|
39
|
-
placeholder: 'No indices found. Save records to a new index first.',
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
disabled: false,
|
|
44
|
-
options: indices.map((index) => ({
|
|
45
|
-
label: index.name,
|
|
46
|
-
value: index.name,
|
|
47
|
-
})),
|
|
48
|
-
};
|
|
49
|
-
}),
|
|
50
|
-
}),
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,iDAAgD;AAEhD,iCAAqC;AACrC,qCAA8C;AAC9C,mCAA6C;AAEhC,QAAA,YAAY,GAAG;IAC1B,KAAK,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE,CACzB,2BAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,kBAAW;QACjB,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,kCAAkC;QAC/C,QAAQ;QACR,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;YACtB,IAAI,CAAC,IAAA,0BAAkB,EAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,4BAA4B;iBAC1C,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,CACnD,IAAA,2BAAkB,EAAC;gBACjB,IAAI;aACL,CAAC,CACH,CAAC;YAEF,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,gDAAgD;iBAC9D,CAAC;YACJ,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,sDAAsD;iBACpE,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBAC/B,KAAK,EAAE,KAAK,CAAC,IAAI;oBACjB,KAAK,EAAE,KAAK,CAAC,IAAI;iBAClB,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;CACL,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export type AlgoliaAuthValue = {
|
|
2
|
-
props: {
|
|
3
|
-
applicationId: string;
|
|
4
|
-
apiKey: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export type AlgoliaRecord = {
|
|
8
|
-
[key: string]: AlgoliaJsonValue;
|
|
9
|
-
};
|
|
10
|
-
export type AlgoliaJsonValue = string | number | boolean | null | AlgoliaRecord | AlgoliaJsonValue[];
|
|
11
|
-
export type AlgoliaIndex = {
|
|
12
|
-
name: string;
|
|
13
|
-
entries?: number;
|
|
14
|
-
dataSize?: number;
|
|
15
|
-
updatedAt?: string;
|
|
16
|
-
};
|
|
17
|
-
export type AlgoliaIndexListResponse = {
|
|
18
|
-
items: AlgoliaIndex[];
|
|
19
|
-
nbPages: number;
|
|
20
|
-
};
|
|
21
|
-
export type AlgoliaBrowseResponse = {
|
|
22
|
-
hits: AlgoliaRecord[];
|
|
23
|
-
cursor?: string;
|
|
24
|
-
};
|
|
25
|
-
export type AlgoliaBatchResponse = {
|
|
26
|
-
taskID: number;
|
|
27
|
-
objectIDs?: string[];
|
|
28
|
-
};
|
|
29
|
-
export type AlgoliaTaskStatusResponse = {
|
|
30
|
-
status: 'published' | 'notPublished';
|
|
31
|
-
};
|
package/src/lib/common/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AlgoliaAuthValue, AlgoliaRecord } from './types';
|
|
2
|
-
export declare function parseRequiredString(value: unknown, fieldName: string): string;
|
|
3
|
-
export declare function parseStringArray(value: unknown, fieldName: string): string[];
|
|
4
|
-
export declare function parseAlgoliaRecordArray(value: unknown): AlgoliaRecord[];
|
|
5
|
-
export declare function isAlgoliaAuthValue(value: unknown): value is AlgoliaAuthValue;
|
package/src/lib/common/utils.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseRequiredString = parseRequiredString;
|
|
4
|
-
exports.parseStringArray = parseStringArray;
|
|
5
|
-
exports.parseAlgoliaRecordArray = parseAlgoliaRecordArray;
|
|
6
|
-
exports.isAlgoliaAuthValue = isAlgoliaAuthValue;
|
|
7
|
-
function parseRequiredString(value, fieldName) {
|
|
8
|
-
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
9
|
-
throw new Error(`${fieldName} is required.`);
|
|
10
|
-
}
|
|
11
|
-
return value.trim();
|
|
12
|
-
}
|
|
13
|
-
function parseStringArray(value, fieldName) {
|
|
14
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
15
|
-
throw new Error(`${fieldName} must contain at least one value.`);
|
|
16
|
-
}
|
|
17
|
-
return value.map((entry, index) => {
|
|
18
|
-
if (typeof entry !== 'string' || entry.trim().length === 0) {
|
|
19
|
-
throw new Error(`${fieldName} item ${index + 1} must be a non-empty string.`);
|
|
20
|
-
}
|
|
21
|
-
return entry.trim();
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function parseAlgoliaRecordArray(value) {
|
|
25
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
26
|
-
throw new Error('Records must be a non-empty array of JSON objects.');
|
|
27
|
-
}
|
|
28
|
-
return value.map((entry, index) => {
|
|
29
|
-
if (!isAlgoliaRecord(entry)) {
|
|
30
|
-
throw new Error(`Record ${index + 1} must be a JSON object with JSON-compatible values.`);
|
|
31
|
-
}
|
|
32
|
-
return entry;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function isAlgoliaAuthValue(value) {
|
|
36
|
-
if (!isObject(value)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
const props = value['props'];
|
|
40
|
-
if (!isObject(props)) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return (typeof props['applicationId'] === 'string' &&
|
|
44
|
-
props['applicationId'].trim().length > 0 &&
|
|
45
|
-
typeof props['apiKey'] === 'string' &&
|
|
46
|
-
props['apiKey'].trim().length > 0);
|
|
47
|
-
}
|
|
48
|
-
function isAlgoliaRecord(value) {
|
|
49
|
-
if (!isObject(value)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return Object.values(value).every(isAlgoliaJsonValue);
|
|
53
|
-
}
|
|
54
|
-
function isAlgoliaJsonValue(value) {
|
|
55
|
-
if (typeof value === 'string' ||
|
|
56
|
-
typeof value === 'number' ||
|
|
57
|
-
typeof value === 'boolean' ||
|
|
58
|
-
value === null) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
if (Array.isArray(value)) {
|
|
62
|
-
return value.every(isAlgoliaJsonValue);
|
|
63
|
-
}
|
|
64
|
-
return isObject(value) && Object.values(value).every(isAlgoliaJsonValue);
|
|
65
|
-
}
|
|
66
|
-
function isObject(value) {
|
|
67
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/lib/common/utils.ts"],"names":[],"mappings":";;AAEA,kDAMC;AAED,4CAYC;AAED,0DAcC;AAED,gDAgBC;AAtDD,SAAgB,mBAAmB,CAAC,KAAc,EAAE,SAAiB;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,eAAe,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc,EAAE,SAAiB;IAChE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mCAAmC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,SAAS,KAAK,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,uBAAuB,CAAC,KAAc;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,UAAU,KAAK,GAAG,CAAC,qDAAqD,CACzE,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAc;IAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CACL,OAAO,KAAK,CAAC,eAAe,CAAC,KAAK,QAAQ;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ;QACnC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,KAAK,KAAK,IAAI,EACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|