@cwhit-io/piece-bitfocus-companion 0.0.1

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 ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@cwhit-io/piece-bitfocus-companion",
3
+ "version": "0.0.1",
4
+ "main": "./src/index.js",
5
+ "dependencies": {},
6
+ "files": [
7
+ "src/index.js",
8
+ "package.json",
9
+ "src/i18n"
10
+ ]
11
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "Bitfocus Companion": "Bitfocus Companion",
3
+ "Trigger Companion buttons and discover page layouts via HTTP and Satellite APIs.": "Trigger Companion buttons and discover page layouts via HTTP and Satellite APIs.",
4
+ "Companion Connection": "Companion Connection",
5
+ "Enter the host and HTTP port where Bitfocus Companion is running (default 8000). Button label scanning uses the Satellite port (default 16622).": "Enter the host and HTTP port where Bitfocus Companion is running (default 8000). Button label scanning uses the Satellite port (default 16622).",
6
+ "Host": "Host",
7
+ "IP address or hostname of the Companion instance (e.g. 192.168.1.50 or companion.local).": "IP address or hostname of the Companion instance (e.g. 192.168.1.50 or companion.local).",
8
+ "Port": "Port",
9
+ "HTTP port Companion listens on. Default is 8000.": "HTTP port Companion listens on. Default is 8000.",
10
+ "Satellite Port": "Satellite Port",
11
+ "TCP port for the Companion Satellite API used to scan button labels. Default is 16622. Enable HTTP API and Satellite button subscriptions in Companion settings.": "TCP port for the Companion Satellite API used to scan button labels. Default is 16622. Enable HTTP API and Satellite button subscriptions in Companion settings.",
12
+ "Trigger Button": "Trigger Button",
13
+ "Press, release, or press-and-release a Companion button by label or grid location.": "Press, release, or press-and-release a Companion button by label or grid location.",
14
+ "List Buttons on Page": "List Buttons on Page",
15
+ "Scans a Companion page and returns button labels with row/column locations.": "Scans a Companion page and returns button labels with row/column locations.",
16
+ "List Active Pages": "List Active Pages",
17
+ "Scans page numbers and returns which pages contain buttons. Page names are not available via the HTTP API.": "Scans page numbers and returns which pages contain buttons. Page names are not available via the HTTP API.",
18
+ "Page": "Page",
19
+ "Companion button page number (1-based). Use List Active Pages to discover which pages have buttons. Companion does not expose page names over HTTP.": "Companion button page number (1-based). Use List Active Pages to discover which pages have buttons. Companion does not expose page names over HTTP.",
20
+ "Button Selection": "Button Selection",
21
+ "Pick a button by scanning its on-screen label, or enter row and column manually.": "Pick a button by scanning its on-screen label, or enter row and column manually.",
22
+ "Button": "Button",
23
+ "Scans the selected page through the Satellite API (port 16622 by default). Requires Satellite button subscriptions to be enabled in Companion settings.": "Scans the selected page through the Satellite API (port 16622 by default). Requires Satellite button subscriptions to be enabled in Companion settings.",
24
+ "Row": "Row",
25
+ "Button row on the page (0-based). Row 0 is the top row of the button grid.": "Button row on the page (0-based). Row 0 is the top row of the button grid.",
26
+ "Column": "Column",
27
+ "Button column on the page (0-based). Column 0 is the leftmost column.": "Button column on the page (0-based). Column 0 is the leftmost column.",
28
+ "Action": "Action",
29
+ "Press & Release runs both down and up actions. Press holds the button until you release it separately.": "Press & Release runs both down and up actions. Press holds the button until you release it separately.",
30
+ "Press & Release": "Press & Release",
31
+ "Press": "Press",
32
+ "Release": "Release",
33
+ "By button label (scan page)": "By button label (scan page)",
34
+ "By row and column": "By row and column",
35
+ "Max Row to Scan": "Max Row to Scan",
36
+ "Highest row index to scan when listing buttons (0-based).": "Highest row index to scan when listing buttons (0-based).",
37
+ "Max Column to Scan": "Max Column to Scan",
38
+ "Highest column index to scan when listing buttons (0-based).": "Highest column index to scan when listing buttons (0-based).",
39
+ "Max Page to Scan": "Max Page to Scan",
40
+ "Highest page number to check when discovering active pages.": "Highest page number to check when discovering active pages.",
41
+ "Custom API Call": "Custom API Call"
42
+ }
package/src/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";var Vs=Object.create;var Je=Object.defineProperty;var Hs=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var Gs=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ws(t))!qs.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=Hs(t,i))||n.enumerable});return e};var Ae=(e,t,r)=>(r=e!=null?Vs(Gs(e)):{},yn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),Ks=e=>yn(Je({},"__esModule",{value:!0}),e);var No=$((Ro,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"),s="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(c,d){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let y=0,m=-1,v=(c.match(p.zoneIndex)||[])[0],_,M;for(v&&(v=v.substring(1),c=c.replace(/%.+$/,""));(m=c.indexOf(":",m+1))>=0;)y++;if(c.substr(0,2)==="::"&&y--,c.substr(-2,2)==="::"&&y--,y>d)return null;for(M=d-y,_=":";M--;)_+="0:";return c=c.replace("::",_),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),d=function(){let te=c.split(":"),ie=[];for(let Ke=0;Ke<te.length;Ke++)ie.push(parseInt(te[Ke],16));return ie}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function g(c,d,y,m){if(c.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=y-m,_<0&&(_=0),c[v]>>_!==d[v]>>_)return!1;m-=y,v+=1}return!0}o(g,"matchCIDR");function P(c){if(i.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}o(P,"parseIntAuto");function b(c,d){for(;c.length<d;)c=`0${c}`;return c}o(b,"padPart");let x={};x.IPv4=function(){function c(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,M;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(M=m[_],y&&M!==0)return null;M!==8&&(y=!0),d+=M}else return null;return 32-d},c.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c}(),x.IPv4.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(y[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(c){return this.parser(c)!==null},x.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(c){return!!(x.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(c){let d=c.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(c)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(c){let d,y,m,v,_;try{for(d=this.parseCIDR(c),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(_[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(c){let d=this.parser(c);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(c){let d;if(d=c.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(c){let d,y,m;if(d=c.match(r.fourOctet))return function(){let v=d.slice(1,6),_=[];for(let M=0;M<v.length;M++)y=v[M],_.push(P(y));return _}();if(d=c.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v}().reverse()}else return(d=c.match(r.twoOctet))?function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_}():(d=c.match(r.threeOctet))?function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_}():null},x.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(c/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},x.IPv6=function(){function c(d,y){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(_=m[v],y&&_!==0)return null;_!==16&&(y=!0),d+=_}else return null;return 128-d},c.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},c.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(b(this.parts[v].toString(16),4));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new x.IPv4([y>>8,y&255,m>>8,m&255])},c.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(y);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},c.prototype.toString=function(){return this.toRFC5952String()},c}(),x.IPv6.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(y[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(c){return this.parser(c)!==null},x.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let d=this.parser(c);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(c){let d,y,m,v,_;try{for(d=this.parseCIDR(c),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(_[y],10)),y++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(c){let d=this.parser(c);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(c){let d,y,m;if((y=c.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(c){let d,y,m,v,_,M;if(m=c.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(c))return f(c,8);if((m=c.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+M,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<_.length;y++)if(v=_[y],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(c/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},x.fromByteArray=function(c){let d=c.length;if(d===4)return new x.IPv4(c);if(d===16)return new x.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(c){return x.IPv6.isValid(c)||x.IPv4.isValid(c)},x.isValidCIDR=function(c){return x.IPv6.isValidCIDR(c)||x.IPv4.isValidCIDR(c)},x.parse=function(c){if(x.IPv6.isValid(c))return x.IPv6.parse(c);if(x.IPv4.isValid(c))return x.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(c){try{return x.IPv6.parseCIDR(c)}catch{try{return x.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(c){let d=this.parse(c);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(c,d,y){let m,v,_,M;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(M=_[m],c.kind()===M[0].kind()&&c.match.apply(c,M))return v}return y},typeof jt<"u"&&jt.exports?jt.exports=x:e.ipaddr=x})(Ro)});var wi=$((fA,zi)=>{var Ai=require("stream").Stream,Tl=require("util");zi.exports=se;function se(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(se,"DelayedStream");Tl.inherits(se,Ai);se.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(se.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});se.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};se.prototype.resume=function(){this._released||this.release(),this.source.resume()};se.prototype.pause=function(){this.source.pause()};se.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};se.prototype.pipe=function(){var e=Ai.prototype.pipe.apply(this,arguments);return this.resume(),e};se.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)};se.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ni=$((yA,Ri)=>{var $l=require("util"),ki=require("stream").Stream,Oi=wi();Ri.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");$l.inherits(G,ki);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 Oi)){var r=Oi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};G.prototype.pipe=function(e,t){return ki.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 Ci=$((vA,Di)=>{"use strict";Di.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var ji=$(ee=>{"use strict";var Wt=Ci(),El=require("path").extname,Ui=/^\s*([^;\s]*)(?:;|\s|$)/,Sl=/^text\//i;ee.charset=Mi;ee.charsets={lookup:Mi};ee.contentType=Al;ee.extension=zl;ee.extensions=Object.create(null);ee.lookup=wl;ee.types=Object.create(null);Ol(ee.extensions,ee.types);function Mi(e){if(!e||typeof e!="string")return!1;var t=Ui.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Sl.test(t[1])?"UTF-8":!1}o(Mi,"charset");function Al(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ee.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ee.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Al,"contentType");function zl(e){if(!e||typeof e!="string")return!1;var t=Ui.exec(e),r=t&&ee.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(zl,"extension");function wl(e){if(!e||typeof e!="string")return!1;var t=El("x."+e).toLowerCase().substr(1);return t&&ee.types[t]||!1}o(wl,"lookup");function Ol(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var s=Wt[i],u=s.extensions;if(!(!u||!u.length)){e[i]=u;for(var p=0;p<u.length;p++){var f=u[p];if(t[f]){var g=r.indexOf(Wt[t[f]].source),P=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(g>P||g===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Ol,"populateMaps")});var Bi=$((_A,Li)=>{Li.exports=kl;function kl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(kl,"defer")});var Fr=$((IA,Zi)=>{var Fi=Bi();Zi.exports=Rl;function Rl(e){var t=!1;return Fi(function(){t=!0}),o(function(n,i){t?e(n,i):Fi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Rl,"async")});var Zr=$(($A,Vi)=>{Vi.exports=Nl;function Nl(e){Object.keys(e.jobs).forEach(Dl.bind(e)),e.jobs={}}o(Nl,"abort");function Dl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Dl,"clean")});var Vr=$((SA,Wi)=>{var Hi=Fr(),Cl=Zr();Wi.exports=Ul;function Ul(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Ml(t,i,e[i],function(s,u){i in r.jobs&&(delete r.jobs[i],s?Cl(r):r.results[i]=u,n(s,r.results))})}o(Ul,"iterate");function Ml(e,t,r,n){var i;return e.length==2?i=e(r,Hi(n)):i=e(r,t,Hi(n)),i}o(Ml,"runJob")});var Hr=$((zA,Gi)=>{Gi.exports=jl;function jl(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,s){return t(e[i],e[s])}),n}o(jl,"state")});var Wr=$((OA,qi)=>{var Ll=Zr(),Bl=Fr();qi.exports=Fl;function Fl(e){Object.keys(this.jobs).length&&(this.index=this.size,Ll(this),Bl(e)(null,this.results))}o(Fl,"terminator")});var Ji=$((RA,Ki)=>{var Zl=Vr(),Vl=Hr(),Hl=Wr();Ki.exports=Wl;function Wl(e,t,r){for(var n=Vl(e);n.index<(n.keyedList||e).length;)Zl(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Hl.bind(n,r)}o(Wl,"parallel")});var Gr=$((DA,Gt)=>{var Xi=Vr(),Gl=Hr(),ql=Wr();Gt.exports=Kl;Gt.exports.ascending=Yi;Gt.exports.descending=Jl;function Kl(e,t,r,n){var i=Gl(e,r);return Xi(e,t,i,o(function s(u,p){if(u){n(u,p);return}if(i.index++,i.index<(i.keyedList||e).length){Xi(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),ql.bind(i,n)}o(Kl,"serialOrdered");function Yi(e,t){return e<t?-1:e>t?1:0}o(Yi,"ascending");function Jl(e,t){return-1*Yi(e,t)}o(Jl,"descending")});var ea=$((UA,Qi)=>{var Xl=Gr();Qi.exports=Yl;function Yl(e,t,r){return Xl(e,t,null,r)}o(Yl,"serial")});var ra=$((jA,ta)=>{ta.exports={parallel:Ji(),serial:ea(),serialOrdered:Gr()}});var qr=$((LA,na)=>{"use strict";na.exports=Object});var ia=$((BA,oa)=>{"use strict";oa.exports=Error});var sa=$((FA,aa)=>{"use strict";aa.exports=EvalError});var ca=$((ZA,ua)=>{"use strict";ua.exports=RangeError});var pa=$((VA,la)=>{"use strict";la.exports=ReferenceError});var ma=$((HA,da)=>{"use strict";da.exports=SyntaxError});var qt=$((WA,fa)=>{"use strict";fa.exports=TypeError});var ya=$((GA,ga)=>{"use strict";ga.exports=URIError});var va=$((qA,ha)=>{"use strict";ha.exports=Math.abs});var Pa=$((KA,xa)=>{"use strict";xa.exports=Math.floor});var ba=$((JA,_a)=>{"use strict";_a.exports=Math.max});var Ta=$((XA,Ia)=>{"use strict";Ia.exports=Math.min});var Ea=$((YA,$a)=>{"use strict";$a.exports=Math.pow});var Aa=$((QA,Sa)=>{"use strict";Sa.exports=Math.round});var wa=$((ez,za)=>{"use strict";za.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ka=$((rz,Oa)=>{"use strict";var Ql=wa();Oa.exports=o(function(t){return Ql(t)||t===0?t:t<0?-1:1},"sign")});var Na=$((oz,Ra)=>{"use strict";Ra.exports=Object.getOwnPropertyDescriptor});var Kr=$((iz,Da)=>{"use strict";var Kt=Na();if(Kt)try{Kt([],"length")}catch{Kt=null}Da.exports=Kt});var Ua=$((az,Ca)=>{"use strict";var Jt=Object.defineProperty||!1;if(Jt)try{Jt({},"a",{value:1})}catch{Jt=!1}Ca.exports=Jt});var Jr=$((sz,Ma)=>{"use strict";Ma.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s 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 u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ba=$((cz,La)=>{"use strict";var ja=typeof Symbol<"u"&&Symbol,ep=Jr();La.exports=o(function(){return typeof ja!="function"||typeof Symbol!="function"||typeof ja("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ep()},"hasNativeSymbols")});var Xr=$((pz,Fa)=>{"use strict";Fa.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Yr=$((dz,Za)=>{"use strict";var tp=qr();Za.exports=tp.getPrototypeOf||null});var Wa=$((mz,Ha)=>{"use strict";var rp="Function.prototype.bind called on incompatible ",np=Object.prototype.toString,op=Math.max,ip="[object Function]",Va=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),ap=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),sp=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ha.exports=o(function(t){var r=this;if(typeof r!="function"||np.apply(r)!==ip)throw new TypeError(rp+r);for(var n=ap(arguments,1),i,s=o(function(){if(this instanceof i){var P=r.apply(this,Va(n,arguments));return Object(P)===P?P:this}return r.apply(t,Va(n,arguments))},"binder"),u=op(0,r.length-n.length),p=[],f=0;f<u;f++)p[f]="$"+f;if(i=Function("binder","return function ("+sp(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ve=$((gz,Ga)=>{"use strict";var up=Wa();Ga.exports=Function.prototype.bind||up});var Xt=$((yz,qa)=>{"use strict";qa.exports=Function.prototype.call});var Qr=$((hz,Ka)=>{"use strict";Ka.exports=Function.prototype.apply});var Xa=$((vz,Ja)=>{"use strict";Ja.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Qa=$((xz,Ya)=>{"use strict";var cp=Ve(),lp=Qr(),pp=Xt(),dp=Xa();Ya.exports=dp||cp.call(pp,lp)});var ts=$((Pz,es)=>{"use strict";var mp=Ve(),fp=qt(),gp=Xt(),yp=Qa();es.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new fp("a function is required");return yp(mp,gp,t)},"callBindBasic")});var ss=$((bz,as)=>{"use strict";var hp=ts(),rs=Kr(),os;try{os=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var en=!!os&&rs&&rs(Object.prototype,"__proto__"),is=Object,ns=is.getPrototypeOf;as.exports=en&&typeof en.get=="function"?hp([en.get]):typeof ns=="function"?o(function(t){return ns(t==null?t:is(t))},"getDunder"):!1});var ds=$((Tz,ps)=>{"use strict";var us=Xr(),cs=Yr(),ls=ss();ps.exports=us?o(function(t){return us(t)},"getProto"):cs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return cs(t)},"getProto"):ls?o(function(t){return ls(t)},"getProto"):null});var tn=$((Ez,ms)=>{"use strict";var vp=Function.prototype.call,xp=Object.prototype.hasOwnProperty,Pp=Ve();ms.exports=Pp.call(vp,xp)});var Ps=$((Sz,xs)=>{"use strict";var U,_p=qr(),bp=ia(),Ip=sa(),Tp=ca(),$p=pa(),qe=ma(),Ge=qt(),Ep=ya(),Sp=va(),Ap=Pa(),zp=ba(),wp=Ta(),Op=Ea(),kp=Aa(),Rp=ka(),hs=Function,rn=o(function(e){try{return hs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),ht=Kr(),Np=Ua(),nn=o(function(){throw new Ge},"throwTypeError"),Dp=ht?function(){try{return arguments.callee,nn}catch{try{return ht(arguments,"callee").get}catch{return nn}}}():nn,He=Ba()(),J=ds(),Cp=Yr(),Up=Xr(),vs=Qr(),vt=Xt(),We={},Mp=typeof Uint8Array>"u"||!J?U:J(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":He&&J?J([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%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%":bp,"%eval%":eval,"%EvalError%":Ip,"%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%":hs,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":He&&J?J(J([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!He||!J?U:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_p,"%Object.getOwnPropertyDescriptor%":ht,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Tp,"%ReferenceError%":$p,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!He||!J?U:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":He&&J?J(""[Symbol.iterator]()):U,"%Symbol%":He?Symbol:U,"%SyntaxError%":qe,"%ThrowTypeError%":Dp,"%TypedArray%":Mp,"%TypeError%":Ge,"%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%":Ep,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":vt,"%Function.prototype.apply%":vs,"%Object.defineProperty%":Np,"%Object.getPrototypeOf%":Cp,"%Math.abs%":Sp,"%Math.floor%":Ap,"%Math.max%":zp,"%Math.min%":wp,"%Math.pow%":Op,"%Math.round%":kp,"%Math.sign%":Rp,"%Reflect.getPrototypeOf%":Up};if(J)try{null.error}catch(e){fs=J(J(e)),Re["%Error.prototype%"]=fs}var fs,jp=o(function e(t){var r;if(t==="%AsyncFunction%")r=rn("async function () {}");else if(t==="%GeneratorFunction%")r=rn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rn("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 Re[t]=r,r},"doEval"),gs={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xt=Ve(),Yt=tn(),Lp=xt.call(vt,Array.prototype.concat),Bp=xt.call(vs,Array.prototype.splice),ys=xt.call(vt,String.prototype.replace),Qt=xt.call(vt,String.prototype.slice),Fp=xt.call(vt,RegExp.prototype.exec),Zp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Vp=/\\(\\)?/g,Hp=o(function(t){var r=Qt(t,0,1),n=Qt(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return ys(t,Zp,function(s,u,p,f){i[i.length]=p?ys(f,Vp,"$1"):u||s}),i},"stringToPath"),Wp=o(function(t,r){var n=t,i;if(Yt(gs,n)&&(i=gs[n],n="%"+i[0]+"%"),Yt(Re,n)){var s=Re[n];if(s===We&&(s=jp(n)),typeof s>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");xs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Fp(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Hp(t),i=n.length>0?n[0]:"",s=Wp("%"+i+"%",r),u=s.name,p=s.value,f=!1,g=s.alias;g&&(i=g[0],Bp(n,Lp([0,1],g)));for(var P=1,b=!0;P<n.length;P+=1){var x=n[P],c=Qt(x,0,1),d=Qt(x,-1);if((c==='"'||c==="'"||c==="`"||d==='"'||d==="'"||d==="`")&&c!==d)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(f=!0),i+="."+x,u="%"+i+"%",Yt(Re,u))p=Re[u];else if(p!=null){if(!(x in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(ht&&P+1>=n.length){var y=ht(p,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[x]}else b=Yt(p,x),p=p[x];b&&!f&&(Re[u]=p)}}return p},"GetIntrinsic")});var bs=$((zz,_s)=>{"use strict";var Gp=Jr();_s.exports=o(function(){return Gp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=$((Oz,Ts)=>{"use strict";var qp=Ps(),Is=qp("%Object.defineProperty%",!0),Kp=bs()(),Jp=tn(),Xp=qt(),er=Kp?Symbol.toStringTag:null;Ts.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 Xp("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");er&&(n||!Jp(t,er))&&(Is?Is(t,er,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[er]=r)},"setToStringTag")});var Ss=$((Rz,Es)=>{"use strict";var Yp=Function.prototype.call,Qp=Object.prototype.hasOwnProperty,ed=Ve();Es.exports=ed.call(Yp,Qp)});var zs=$((Nz,As)=>{"use strict";As.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ks=$((Dz,Os)=>{"use strict";var un=Ni(),td=require("util"),on=require("path"),rd=require("http"),nd=require("https"),od=require("url").parse,id=require("fs"),ad=require("stream").Stream,sd=require("crypto"),an=ji(),ud=ra(),cd=$s(),Ee=Ss(),sn=zs();function ws(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(ws,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],un.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");td.inherits(L,un);L.LINE_BREAK=`\r
2
+ `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=un.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),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ee(t,"httpVersion"))&&!(t instanceof ad))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Ee(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):id.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ee(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ee(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",u={"Content-Disposition":["form-data",'name="'+ws(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&sn(u,r.header);var p;for(var f in u)if(Ee(u,f)){if(p=u[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=f+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+s+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=on.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=on.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ee(e,"httpVersion")&&(r=on.basename(e.client._httpMessage.path||"")),r)return'filename="'+ws(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=an.lookup(e.name)),!r&&e&&e.path&&(r=an.lookup(e.path)),!r&&e&&e.readable&&Ee(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=an.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ee(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+sd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}ud.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=od(e),n=sn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=sn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=nd.request(n):r=rd.request(n),this.getLength(function(s,u){if(s&&s!=="Unknown stream"){this._error(s);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var p,f=o(function(g,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,P)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};cd(L.prototype,"FormData");Os.exports=L});var Ud={};gn(Ud,{bitfocusCompanion:()=>Cd});module.exports=Ks(Ud);var Js=Object.freeze({status:"aborted"});function I(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:u,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=u.prototype,P=Object.keys(g);for(let b=0;b<P.length;b++){let x=P[b];x in p||(p[x]=g[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function u(p){var f;let g=r?.Parent?new s:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let P of g._zod.deferred)P();return g}return o(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}o(I,"$constructor");var Xs=Symbol("zod_brand"),ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_t=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},nr={};function de(e){return e&&Object.assign(nr,e),nr}o(de,"config");function ir(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(ir,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"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 xn(e){return e==null}o(xn,"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 hn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var Ys=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(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pn,"isPlainObject");var _n=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"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 bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var Qs={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 De(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(De,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function bt(e){return typeof e=="string"?e:e?.message}o(bt,"unwrapMessage");function Pe(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(Pe,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(In,"getLengthableOrigin");function sr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(sr,"issue");var Tn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$n=I("$ZodError",Tn),Ye=I("$ZodError",Tn,{Parent:Error});var tu=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new ce;if(u.issues.length){let p=new(i?.Err??e)(u.issues.map(f=>Pe(f,s,de())));throw ar(p,i?.callee),p}return u.value},"_parse"),Et=tu(Ye),ru=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let p=new(i?.Err??e)(u.issues.map(f=>Pe(f,s,de())));throw ar(p,i?.callee),p}return u.value},"_parseAsync"),St=ru(Ye),nu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ce;return s.issues.length?{success:!1,error:new(e??$n)(s.issues.map(u=>Pe(u,i,de())))}:{success:!0,data:s.value}},"_safeParse"),Qe=nu(Ye),ou=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>Pe(u,i,de())))}:{success:!0,data:s.value}},"_safeParseAsync"),et=ou(Ye);var iu="(?:(?:\\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])))",au=new RegExp(`^${iu}$`);var En=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var ur=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Ce=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=I("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let u=In(i);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var cr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.init(e,t),e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.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=()=>{})}),wn=I("$ZodCheckRegex",(e,t)=>{cr.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 kn={major:4,minor:3,patch:6};var H=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._zod.onattach)s(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((u,p,f)=>{let g=De(u),P;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(g)continue;let x=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&f?.async===!1)throw new ce;if(P||c instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await c,u.issues.length!==x&&(g||(g=De(u,x)))});else{if(u.issues.length===x)continue;g||(g=De(u,x))}}return P?P.then(()=>u):u},"runChecks"),s=o((u,p,f)=>{if(De(u))return u.aborted=!0,u;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new ce;return g.then(P=>e._zod.parse(P,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(u,p)=>{if(p.skipChecks)return e._zod.parse(u,p);if(p.direction==="backward"){let g=e._zod.parse({value:u.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(P=>s(P,u,p)):s(g,u,p)}let f=e._zod.parse(u,p);if(f instanceof Promise){if(p.async===!1)throw new ce;return f.then(g=>i(g,n,p))}return i(f,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let s=Qe(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return et(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??En(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}}),lr=I("$ZodStringFormat",(e,t)=>{cr.init(e,t),wt.init(e,t)});var Un=I("$ZodURL",(e,t)=>{lr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Mn=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??ur,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 s=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,...s?{received:s}:{}}),r}});var pr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jn=I("$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 Ln=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Bn=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Fn=I("$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}}),Zn=I("$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,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Rn(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=I("$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 s=[];for(let u=0;u<i.length;u++){let p=i[u],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?s.push(f.then(g=>Rn(g,r,u))):Rn(f,r,u)}return s.length?Promise.all(s).then(()=>r):r}});function zt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(zt,"handlePropertyResult");function su(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(su,"normalizeDef");function uu(e,t,r,n,i,s){let u=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,P=f.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){u.push(b);continue}let x=f.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(c=>zt(c,r,b,t,P))):zt(x,r,b,t,P)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(uu,"handleCatchall");var Hn=I("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=It(()=>su(t));q(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let P=p[g]._zod;if(P.values){f[g]??(f[g]=new Set);for(let b of P.values)f[g].add(b)}}return f});let i=Xe,s=t.catchall,u;e._zod.parse=(p,f)=>{u??(u=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let P=[],b=u.shape;for(let x of u.keys){let c=b[x],d=c._zod.optout==="optional",y=c._zod.run({value:g[x],issues:[]},f);y instanceof Promise?P.push(y.then(m=>zt(m,p,x,g,d))):zt(y,p,x,g,d)}return s?uu(P,g,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function Nn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!De(s));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(s=>s.issues.map(u=>Pe(u,n,de())))}),t)}o(Nn,"handleUnionResults");var dr=I("$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(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Tt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let u=!1,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},s);if(g instanceof Promise)p.push(g),u=!0;else{if(g.issues.length===0)return g;p.push(g)}}return u?Promise.all(p).then(f=>Nn(f,i,e,s)):Nn(p,i,e,s)}});var Wn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,dr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let s of t.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,f]of Object.entries(u)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=It(()=>{let i=t.options,s=new Map;for(let u of i){let p=u._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let f of p){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,u)}}return s});e._zod.parse=(i,s)=>{let u=i.value;if(!Xe(u))return i.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),i;let p=n.value.get(u?.[t.discriminator]);return p?p._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),i)}});var Gn=I("$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 s=[],u=t.keyType._zod.values;if(u){r.value={};let p=new Set;for(let g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let P=t.valueType._zod.run({value:i[g],issues:[]},n);P instanceof Promise?s.push(P.then(b=>{b.issues.length&&r.issues.push(...xe(g,b.issues)),r.value[g]=b.value})):(P.issues.length&&r.issues.push(...xe(g,P.issues)),r.value[g]=P.value)}let f;for(let g in i)p.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&ur.test(p)&&f.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>Pe(b,n,de())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?s.push(P.then(b=>{b.issues.length&&r.issues.push(...xe(p,b.issues)),r.value[f.value]=b.value})):(P.issues.length&&r.issues.push(...xe(p,P.issues)),r.value[f.value]=P.value)}}return s.length?Promise.all(s).then(()=>r):r}});var qn=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=ir(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>_n.has(typeof i)).map(i=>typeof i=="string"?Ne(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let u=i.value;return n.has(u)||i.issues.push({code:"invalid_value",values:r,input:u,inst:e}),i}}),Kn=I("$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"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Jn=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _t(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(r.value=u,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=I("$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(s=>Dn(s,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=I("$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 Qn=I("$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 s=t.out._zod.run(r,n);return s instanceof Promise?s.then(u=>At(u,t.in,n)):At(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>At(s,t.out,n)):At(i,t.out,n)}});function At(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(At,"handlePipeResult");var eo=I("$ZodCustom",(e,t)=>{Ce.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(s=>Cn(s,r,n,e));Cn(i,r,n,e)}});function Cn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(sr(i))}}o(Cn,"handleRefineResult");var ro,du=Symbol("ZodOutput"),mu=Symbol("ZodInput"),mr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function no(){return new mr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var fr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...V(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...V(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...V(t)})}o(co,"_boolean");function lo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(lo,"_coercedBoolean");function po(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(po,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...V(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(yo,"_coercedDate");function ae(e,t){return new zn({check:"min_length",...V(t),minimum:e})}o(ae,"_minLength");function _e(e,t){return new wn({check:"string_format",format:"regex",...V(t),pattern:e})}o(_e,"_regex");function ho(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var K=I("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)=>Qe(e,r,n),e.parseAsync=async(r,n)=>St(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(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)}),kt=I("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return oo(kt,e)}o(a,"string");var vo=I("ZodMiniStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var Iu=I("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(Iu,e)}o(xo,"url");var gr=I("ZodMiniNumber",(e,t)=>{Mn.init(e,t),K.init(e,t)});function X(e){return so(gr,e)}o(X,"number");var yr=I("ZodMiniBoolean",(e,t)=>{pr.init(e,t),K.init(e,t)});function F(e){return co(yr,e)}o(F,"boolean");var Po=I("ZodMiniBigInt",(e,t)=>{jn.init(e,t),K.init(e,t)});var Tu=I("ZodMiniAny",(e,t)=>{Ln.init(e,t),K.init(e,t)});function rt(){return mo(Tu)}o(rt,"any");var $u=I("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),K.init(e,t)});function w(){return fo($u)}o(w,"unknown");var Eu=I("ZodMiniVoid",(e,t)=>{Fn.init(e,t),K.init(e,t)});function _o(e){return go(Eu,e)}o(_o,"_void");var bo=I("ZodMiniDate",(e,t)=>{Zn.init(e,t),K.init(e,t)});var Su=I("ZodMiniArray",(e,t)=>{Vn.init(e,t),K.init(e,t)});function R(e,t){return new Su({type:"array",element:e,...V(t)})}o(R,"array");var Au=I("ZodMiniObject",(e,t)=>{Hn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new Au(r)}o(l,"object");var zu=I("ZodMiniUnion",(e,t)=>{dr.init(e,t),K.init(e,t)});function N(e,t){return new zu({type:"union",options:e,...V(t)})}o(N,"union");var wu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),K.init(e,t)});function Ue(e,t,r){return new wu({type:"union",options:t,discriminator:e,...V(r)})}o(Ue,"discriminatedUnion");var Ou=I("ZodMiniRecord",(e,t)=>{Gn.init(e,t),K.init(e,t)});function O(e,t,r){return new Ou({type:"record",keyType:e,valueType:t,...V(r)})}o(O,"record");var ku=I("ZodMiniEnum",(e,t)=>{qn.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 ku({type:"enum",entries:r,...V(t)})}o(C,"_enum");var Ru=I("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),K.init(e,t)});function E(e,t){return new Ru({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(E,"literal");var Nu=I("ZodMiniTransform",(e,t)=>{Jn.init(e,t),K.init(e,t)});function be(e){return new Nu({type:"transform",transform:e})}o(be,"transform");var Du=I("ZodMiniOptional",(e,t)=>{Xn.init(e,t),K.init(e,t)});function h(e){return new Du({type:"optional",innerType:e})}o(h,"optional");var Cu=I("ZodMiniNullable",(e,t)=>{Yn.init(e,t),K.init(e,t)});function nt(e){return new Cu({type:"nullable",innerType:e})}o(nt,"nullable");var Uu=I("ZodMiniPipe",(e,t)=>{Qn.init(e,t),K.init(e,t)});function Ie(e,t){return new Uu({type:"pipe",in:e,out:t})}o(Ie,"pipe");var Mu=I("ZodMiniCustom",(e,t)=>{eo.init(e,t),K.init(e,t)});function Rt(e,t){return ho(Mu,e??(()=>!0),t)}o(Rt,"custom");var ot={};gn(ot,{bigint:()=>Hu,boolean:()=>Vu,date:()=>Wu,number:()=>Zu,string:()=>Fu});function Fu(e){return io(kt,e)}o(Fu,"string");function Zu(e){return uo(gr,e)}o(Zu,"number");function Vu(e){return lo(yr,e)}o(Vu,"boolean");function Hu(e){return po(Po,e)}o(Hu,"bigint");function Wu(e){return yo(bo,e)}o(Wu,"date");var vr=l({retryOnFailure:l({defaultValue:h(F()),hide:h(F())}),continueOnFailure:l({defaultValue:h(F()),hide:h(F())})}),hr=class{constructor(t,r,n,i,s,u,p,f,g,P,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=u;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=P;this.aiMetadata=b}static{o(this,"IAction")}},Te=o(e=>new hr(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 B=l({displayName:a(),description:h(a())}),D=o((e,t)=>l({type:E(t),required:F(),defaultValue:h(rt())}),"TPropertyValue");var re=l({...B.shape,...D(a(),"SHORT_TEXT").shape}),me=l({...B.shape,...D(a(),"LONG_TEXT").shape});var To=l({label:a(),value:w()}),Nt=l({disabled:h(F()),placeholder:h(a()),options:R(To)});var ne=l({...B.shape,options:Nt,...D(w(),"STATIC_DROPDOWN").shape}),fe=l({...B.shape,options:Nt,...D(R(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var xr=l({...B.shape,...D(w(),"DROPDOWN").shape,refreshers:R(a())}),it=l({...B.shape,...D(R(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var ge=l({...B.shape,...D(F(),"CHECKBOX").shape});var ye=l({...B.shape,...D(X(),"NUMBER").shape});var at=l({...B.shape,...D(w(),"FILE").shape});var st=l({...B.shape,...D(a(),"DATE_TIME").shape});var $o=O(a(),N([re,me,ne,it,fe,ge,ye,at,st])),ut=l({...B.shape,properties:$o,...D(R(w()),"ARRAY").shape});var ct=l({...B.shape,...D(N([O(a(),w())]),"JSON").shape});var Eo=N([re,ne,ct,ut,fe]),qu=O(a(),Eo),Pr=l({refreshers:R(a()),...B.shape,...D(w(),"DYNAMIC").shape});var Dt=l({...B.shape,...D(_o(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),je=(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))(je||{});var pt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(pt||{}),_r="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),dt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(dt||{}),Ku=l({strategy:C(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ct||{}),So=l({status:h(X()),body:h(w()),headers:h(O(a(),a()))}),Ao=l({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(C(Ct))}),zo=l({type:E("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:So,handlerId:h(a()),streamStepProgress:h(C(Ct))}),Ju=N([Ao,zo]);var Xu=l({body:w(),rawBody:h(w()),headers:O(a(),a()),queryParams:O(a(),a())});function he(e){return e==null}o(he,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Ut(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ut,"assertNotNullOrUndefined");var br=Ae(require("crypto"),1);var Yu=128,we,Le,Qu=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*Yu),br.default.randomFillSync(we),Le=0):Le+e>we.length&&(br.default.randomFillSync(we),Le=0),Le+=e},"fillPool"),ec=o(e=>(Qu(e|=0),we.subarray(Le-e,Le)),"random"),tc=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(s=t)=>{let u="";for(;;){let p=r(i),f=i;for(;f--;)if(u+=e[p[f]&n]||"",u.length===s)return u}}},"customRandom"),Oo=o((e,t=21)=>tc(e,t,ec),"customAlphabet");var rc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ko=21,Pb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${ko}}$`))),nc=Oo(rc,ko);var $e=Ie(be(e=>e instanceof Date?e.toISOString():e),a()),oe={id:a(),created:$e,updated:$e},Z=o(e=>h(nt(e)),"Nullable");function Ir(e){return h(nt(C(e)))}o(Ir,"NullableEnum");var Ib=Ie(be(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(F())),Mt=o(e=>Ie(be(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(R(e))),"OptionalArrayFromQuery");var Eb=O(a(),w());var gt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(gt||{});var Mb=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var Lb=l({filename:a(),data:w(),type:E("file"),mimetype:h(a())});var oc=Ae(No());var Gb=l({...oe,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:h(X())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Tr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Tr||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Er=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Er||{});var Sr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Sr||{});var ic=l({mode:C(Do),value:w()}),ac=l({auth:h(a()),fields:O(a(),ic)}),sc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(ac)}),uc=l({type:E("PIECE"),toolName:a().check(ae(1)),pieceMetadata:sc}),cc=l({type:E("none")}),lc=l({type:E("access_token"),accessToken:a()}),pc=l({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),dc=l({type:E("headers"),headers:O(a(),a())}),mc=Ue("type",[cc,lc,pc,dc]),Co=l({type:E("FLOW"),toolName:a().check(ae(1)),externalFlowId:a(),flowDisplayName:h(a())}),Uo=l({type:E("MCP"),toolName:a().check(ae(1)),serverUrl:xo(),protocol:C($r),auth:mc}),Mo=l({type:E("KNOWLEDGE_BASE"),toolName:a().check(ae(1)),sourceType:C(Tr),sourceId:a(),sourceName:a()}),fc=Ue("type",[uc,Co,Uo,Mo]),gc=l({displayName:a(),description:h(a()),type:C(Er)}),jo=l({type:E("MARKDOWN"),markdown:a()}),Be={type:E("TOOL_CALL"),input:Z(O(a(),w())),output:h(w()),toolName:a(),status:C(Sr),toolCallId:a(),startTime:a(),endTime:h(a())},PI=l(Be),Lo=Ue("toolCallType",[l({...Be,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:E("UNKNOWN"),displayName:a()})]),yc=N([jo,Lo]);var Ar=(r=>(r.IMAGE="image",r.TEXT="text",r))(Ar||{}),ve=l({apiKey:a()}),hc=ve,vc=l({apiKey:a(),apiKeyHash:a()}),xc=ve,Pc=ve,_c=ve,bc=ve,Ic=ve,Tc=ve,$c=ve,Bo=l({accessKeyId:a().check(ae(1)),secretAccessKey:a().check(ae(1))}),Ec=l({}),Sc=l({}),Ac=l({}),zc=l({}),wc=l({}),Oc=l({}),Fo=l({modelId:a(),modelName:a(),modelType:C(Ar)}),Zo=l({apiKeyHeader:a(),baseUrl:a(),models:R(Fo),defaultHeaders:h(O(a(),a()))}),Vo=l({accountId:a(),gatewayId:a(),models:R(Fo),vertexProject:h(a()),vertexRegion:h(a())}),Ho=l({resourceName:a(),apiVersion:Ie(be(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Wo=l({region:a().check(ae(1))}),kc=N([hc,_c,bc,Ic,Tc,Pc,xc,vc,Bo,$c]),Go=N([Zo,Vo,Ho,Wo,Ec,Ac,zc,wc,Sc,Oc]),Rc=l({id:a(),name:a(),type:C(Ar)}),Nc=l({id:a(),name:a(),provider:C(gt),config:Go,enabledForChat:F()}),Dc=l({provider:C(gt),config:Go,auth:kc,platformId:a()});var TI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Cc=l({base64Url:a(),fileName:a(),extension:h(a())}),Uc=l({mimeType:a(),url:a(),fileName:h(a())}),zr=N([Cc,Uc]);var Mc=N([l({type:E("file"),value:zr}),l({type:E("markdown"),value:a(),files:h(R(zr))})]),jc=l({sessionId:a(),message:a(),files:h(R(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var Lc=N([l({...oe,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...oe,name:a(),externalId:a(),type:N([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),Bc=l({...oe,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Ir(Jo),trigger:Ir(Ko)}),Fc=l({...oe,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),Zc=l({events:R(C(wr)),webhookUrl:a(),flowId:a()}),Vc=l({fields:R(l({id:a(),name:a()})),rows:R(O(a(),a())),name:a()}),Hc=l({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Mt(a()),folderId:h(a()),folderIds:Mt(a())}),Wc=l({records:R(R(l({fieldId:a(),value:Yo()}))),tableId:a()}),Gc=l({cells:h(R(l({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:h(F())}),Xo=Ue("operator",[Oe("eq"),Oe("neq"),Oe("gt"),Oe("gte"),Oe("lt"),Oe("lte"),Oe("co"),qo("exists"),qo("not_exists")]),qc=l({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Mt(Xo)});function Yo(){return Ie(be(e=>e==null?e:String(e)),nt(a()))}o(Yo,"coerceToString");function Oe(e){return l({fieldId:a(),operator:E(e),value:a()})}o(Oe,"valueFilter");function qo(e){return l({fieldId:a(),operator:E(e)})}o(qo,"existenceFilter");var Kc=l({status:h(X()),body:h(w()),headers:h(O(a(),a()))}),Jc=l({...oe,deleted:Z($e),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Qo=l({name:a(),description:h(a()),type:a(),required:F()}),Xc=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(Qo),returnsResponse:F()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",ZI=new RegExp(ei),Qc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",VI=a().check(_e(new RegExp(ei))),HI=a().check(_e(new RegExp(Qc))),el=l({packageType:E("ARCHIVE"),pieceType:C(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=l({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=l({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),WI=N([ti,ri]),GI=N([el,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),tl=l({type:C(ni),cronExpression:a(),timezone:a()}),qI=l({...oe,type:C(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(tl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:F()}),oi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),KI=l({...oe,projectId:Z(a()),platformId:Z(a()),type:C(oi),compression:C(ii),data:h(w()),location:C(ai),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),JI=l({id:a(),email:a(),firstName:a(),status:C(ui),externalId:Z(a()),platformId:Z(a()),platformRole:C(si),lastName:a(),created:$e,updated:$e,lastActiveDate:Z($e),imageUrl:Z(a())});var Or=l({...B.shape,...D(O(a(),w()),"OBJECT").shape});var di=l({...B.shape,...D(a(),"COLOR").shape});var kr=N([re,me,Dt,ge,ne,fe,xr,it,Pr,ye,ut,Or,ct,st,at,di]),j={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var le=l({displayName:a(),description:h(a())});var mi=l({username:a(),password:a()}),Rr=l({...le.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...D(mi,"BASIC_AUTH").shape});var il=O(a(),N([re,me,ye,ge,ne])),Nr=l({...le.shape,props:il,...D(w(),"CUSTOM_AUTH").shape});var ke=l({...le.shape,...D(l({auth:a()}),"SECRET_TEXT").shape});var al=O(a(),N([re,me,ke,ye,ge,ne,fe,Dt])),fi=l({...le.shape,props:al,...D(w(),"OIDC").shape});var Dr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Dr||{}),gi=N([re,ke,ne]),yi=O(a(),gi),sl=l({props:h(O(a(),gi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:h(N([E("none"),E("consent"),E("login"),E("omit")])),pkce:h(F()),pkceMethod:h(N([E("plain"),E("S256")])),authorizationMethod:h(C(Dr)),grantType:h(N([C(pt),E(_r)])),extra:h(O(a(),a()))}),hi=l({access_token:a(),props:h(yi),data:O(a(),rt())}),Cr=l({...le.shape,...sl.shape,...D(hi,"OAUTH2").shape});var Fe=N([Rr,Nr,fi,Cr,ke]),yt="Connection",Ur={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var A$={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 ul=l({...B.shape,...D(w(),"CUSTOM").shape,code:a()});var cl=N([kr,Fe]),Mr=O(a(),cl),q$=O(a(),kr);var vi=N([l({strategy:E("CRON"),cronExpression:a()}),l({strategy:E("NONE")})]);var xi="2",Lt="0.82.0";var jr=class{constructor(t,r,n,i,s,u,p,f,g=Lt,P,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=P;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:xi}),"getContextInfo");(!ll(g)||pl(g,Lt))&&(this.minimumSupportedRelease=Lt),s.forEach(x=>this._actions[x.name]=x),u.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(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new jr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function ll(e){return/^\d+\.\d+\.\d+$/.test(e)}o(ll,"isValidSimpleSemver");function pl(e,t){let[r,n,i]=e.split(".").map(Number),[s,u,p]=t.split(".").map(Number);return r!==s?r<s:n!==u?n<u:i<p}o(pl,"isSemverLessThan");var dl=h(O(a(),O(a(),a()))),_i=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:h(a()),directoryPath:h(a()),auth:h(N([Fe,R(Fe)])),version:a(),categories:h(R(C(je))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:dl}),ml=C(["human","ai","both"]),bi=l({description:h(a()),idempotent:h(F())}),Ii=l({name:a(),displayName:a(),description:a(),props:Mr,requireAuth:F(),errorHandlingOptions:h(vr),outputSchema:h(Rt()),audience:h(ml),aiMetadata:h(bi)}),Ti=l({name:a(),displayName:a(),description:a(),props:Mr,errorHandlingOptions:h(vr),type:C(ze),sampleData:w(),handshakeConfiguration:h(Rt()),renewConfiguration:h(vi),testStrategy:C(mt),outputSchema:h(Rt()),aiMetadata:h(bi)}),fl=l({..._i.shape,actions:O(a(),Ii),triggers:O(a(),Ti)}),gl=l({..._i.shape,actions:X(),triggers:X(),suggestedActions:h(R(Ti)),suggestedTriggers:h(R(Ii))}),$i=l({projectUsage:X(),tags:h(R(a())),pieceType:C(Me),packageType:C(lt),platformId:h(a()),archiveId:h(a())}),qE=l({...fl.shape,...$i.shape}),KE=l({...gl.shape,...$i.shape}),JE=l({name:a(),version:a()});var yl=Ae(require("path")),hl=Ae(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((s,u)=>{i.append(u,s)}),{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 Ft=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Lr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Lr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=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 Zt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}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 Vt=class extends Bt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ft){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),u=t.queryParams??{};for(let[M,te]of Object.entries(u))i.append(M,te);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",P=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:c,isStream:d}=vl(t.body,s),y=Pl({...s,...c}),m=await xl(async()=>{let M=new AbortController,te=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ie={method:t.method.toString(),headers:y,body:x,redirect:P?"follow":"manual",signal:M.signal};return d&&(ie.duplex="half"),r?.dispatcher!==void 0&&(ie.dispatcher=r.dispatcher),await fetch(f,ie)}finally{te!==void 0&&clearTimeout(te)}},b),v=P?300:400;if(m.status<200||m.status>=v){let M=await Ei(m,g),te=new Zt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",te),te}let _=await Ei(m,g);return{status:m.status,headers:_l(m.headers),body:_}}};function vl(e,t){return Il(e)?{body:void 0,extraHeaders:{},isStream:!1}:bl(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(vl,"serializeBody");async function Ei(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(Ei,"parseResponseBody");async function xl(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(xl,"sendWithRetries");function Si(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Si,"backoff");function Pl(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(Pl,"normalizeHeaders");function _l(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(_l,"toHttpHeaders");function bl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(bl,"isNodeFormData");function Il(e){return e==null}o(Il,"isNil");var Ze=new Vt;var Ht=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(Ht||{});var ld=Ae(require("fs")),Rs=Ae(ks());var pd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function dd(e){let t=e.split(";")[0].trim().toLowerCase();return pd[t]??""}o(dd,"contentTypeToExtension");var md=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),fd=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 Ns({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:u,extraProps:p,authLocation:f="headers"}){return Te({audience:"human",name:s||"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:j.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:j.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${fd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...u?.url??{}})}),"props")}),method:j.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ht).map(g=>({label:g,value:g}))},...u?.method??{}}),headers:j.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:j.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:j.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:j.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let P=g,b={};switch(P){case"none":break;case"json":b.data=j.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":b.data=j.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=j.Array({displayName:"Form Data",required:!0,properties:{fieldName:j.ShortText({displayName:"Field Name",required:!0}),fieldType:j.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:j.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:j.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:j.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:j.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:j.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:j.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:P,url:b,headers:x,queryParams:c,body:d,body_type:y,failsafe:m,timeout:v,response_is_binary:_,followRedirects:M}=g.propsValue;Ut(P,"Method"),Ut(b,"URL");let te=he(r)?{}:await r(g.auth,g.propsValue),ie=b.url,Ke=ie.startsWith("http://")||ie.startsWith("https://")?ie:md({baseUrl:t(g.auth),relativePath:ie}),Se={method:P,url:Ke,headers:{...x??{},...f==="headers"||!he(f)?te:{}},queryParams:{...f==="queryParams"?te:{},...c??{}},timeout:v?v*1e3:0,followRedirects:M};if(_&&(Se.responseType="arraybuffer"),d)if(y&&y!=="none"){let pe=d.data;if(y==="form_data"){let Zs=pe,Pt=new Rs.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:rr}of Zs)mn==="text"&&!ft(fn)?Pt.append(dn,fn):mn==="file"&&!ft(rr)&&Pt.append(dn,rr.data,{filename:rr?.filename});Se.body=Pt,Se.headers={...Se.headers,...Pt.getHeaders()}}else Se.body=pe}else y||(Se.body=d);try{let pe=await Ze.sendRequest(Se);return await gd(g.files,pe.body,pe.status,pe.headers,_)}catch(pe){if(m)return pe.errorMessage();throw pe}},"run")})}o(Ns,"createCustomApiCallAction");var gd=o(async(e,t,r,n,i)=>{let s;if(i&&yd(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=dd(u??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:f})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),yd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ds=Ae(require("node:net"));function hd(e){return e.trim().replace(/^https?:\/\//,"").replace(/\/$/,"")}o(hd,"normalizeHost");function vd(e){let t={},r=0;for(;r<e.length;){for(;r<e.length&&e[r]===" ";)r+=1;if(r>=e.length)break;let n=e.indexOf("=",r);if(n===-1)break;let i=e.slice(r,n);if(r=n+1,e[r]==='"'){r+=1;let u=r;for(;u<e.length&&!(e[u]==='"'&&e[u-1]!=="\\");)u+=1;t[i]=e.slice(r,u),r=u+1;continue}let s=r;for(;s<e.length&&e[s]!==" ";)s+=1;t[i]=e.slice(r,s),r=s}return t}o(vd,"parseSatelliteArgs");function xd(e){let t=e.trim();if(t.length===0)return null;let r=t.indexOf(" ");if(r===-1)return{command:t,status:null,args:{}};let n=t.slice(0,r),i=t.slice(r+1).trim(),s=null;return i==="OK"||i.startsWith("OK ")?(s="OK",i=i==="OK"?"":i.slice(3).trim()):i.startsWith("ERROR ")&&(s="ERROR",i=i.slice(6).trim()),{command:n,status:s,args:vd(i)}}o(xd,"parseSatelliteLine");function Pd(e){if(!e)return null;try{let t=Buffer.from(e,"base64").toString("utf8").trim();return t.length>0?t:null}catch{return null}}o(Pd,"decodeSatelliteText");function _d({type:e,text:t}){return t?!0:e==="PAGEUP"||e==="PAGEDOWN"||e==="PAGENUM"}o(_d,"isPopulatedButton");var cn=class{constructor(t){this.buffer="";this.waiters=[];this.socket=t,this.socket.on("data",r=>{this.buffer+=r.toString("utf8"),this.drainBuffer()})}static{o(this,"SatelliteSession")}close(){for(let t of this.waiters)clearTimeout(t.timer),t.reject(new Error("Satellite connection closed."));this.waiters.length=0,this.socket.destroy()}send(t){this.socket.write(`${t}
4
+ `)}waitFor({predicate:t,timeoutMs:r}){return new Promise((n,i)=>{let s=setTimeout(()=>{let u=this.waiters.findIndex(p=>p.resolve===n);u>=0&&this.waiters.splice(u,1),i(new Error("Timed out waiting for a Satellite API response."))},r);this.waiters.push({predicate:t,resolve:n,reject:i,timer:s})})}drainBuffer(){for(;;){let t=this.buffer.indexOf(`
5
+ `);if(t===-1)return;let r=this.buffer.slice(0,t);this.buffer=this.buffer.slice(t+1);let n=xd(r);if(!n)continue;if(n.command==="PING"){let u=n.args.payload??"";this.send(`PONG ${u}`.trim());continue}let i=this.waiters.findIndex(u=>u.predicate(n));if(i===-1)continue;let[s]=this.waiters.splice(i,1);clearTimeout(s.timer),s.resolve(n)}}};async function bd({connection:e,timeoutMs:t}){let r=hd(e.host),n=Number(e.satellitePort);return await new Promise((i,s)=>{let u=new Ds.Socket,p=setTimeout(()=>{u.destroy(),s(new Error(`Timed out connecting to Companion Satellite API on port ${e.satellitePort}.`))},t);u.once("error",f=>{clearTimeout(p),s(f)}),u.connect(n,r,()=>{clearTimeout(p);let f=new cn(u);f.waitFor({predicate:o(g=>g.command==="BEGIN","predicate"),timeoutMs:t}).then(()=>i(f)).catch(g=>{f.close(),s(g)})})})}o(bd,"openSatelliteSession");async function Id({session:e,subId:t,location:r}){e.send(`ADD-SUB SUBID=${t} LOCATION=${r} TEXT=true`);let n=await e.waitFor({predicate:o(c=>c.command==="ADD-SUB","predicate"),timeoutMs:3e3});if(n.status==="ERROR")throw new Error(n.args.MESSAGE??"Companion rejected a Satellite button subscription. Enable Satellite button subscriptions in Companion settings.");let i=await e.waitFor({predicate:o(c=>c.command==="SUB-STATE"&&c.args.SUBID===t,"predicate"),timeoutMs:3e3});e.send(`REMOVE-SUB SUBID=${t}`),await e.waitFor({predicate:o(c=>c.command==="REMOVE-SUB","predicate"),timeoutMs:3e3});let[s,u,p]=r.split("/"),f=Number(s),g=Number(u),P=Number(p),b=Pd(i.args.TEXT),x=i.args.TYPE??null;return _d({type:x,text:b})?{page:f,row:g,column:P,text:b,type:x}:null}o(Id,"subscribeToLocation");async function Cs({connection:e,page:t,maxRow:r=31,maxColumn:n=31}){let i=await bd({connection:e,timeoutMs:5e3});try{let s=[];for(let u=0;u<=r;u+=1)for(let p=0;p<=n;p+=1){let f=`scan-${t}-${u}-${p}`,g=`${t}/${u}/${p}`,P=await Id({session:i,subId:f,location:g});P&&s.push(P)}return s.sort((u,p)=>u.row!==p.row?u.row-p.row:u.column-p.column)}finally{i.send("QUIT"),i.close()}}o(Cs,"listButtonsOnPage");async function Td({connection:e,maxPage:t=20,maxRow:r=7,maxColumn:n=7}){let i=[];for(let s=1;s<=t;s+=1){let u=await Cs({connection:e,page:s,maxRow:r,maxColumn:n});u.length>0&&i.push({page:s,buttonCount:u.length})}return i}o(Td,"discoverActivePages");var ln={listButtonsOnPage:Cs,discoverActivePages:Td};function $d(e){return e.trim().replace(/^https?:\/\//,"").replace(/\/$/,"")}o($d,"normalizeHost");function tr({host:e,port:t}){let r=$d(e),n=t.trim();return`http://${r}:${n}`}o(tr,"baseUrlFromConnection");function Ed({host:e,port:t,satellitePort:r}){return{host:e,port:t,satellitePort:r?.trim()||"16622"}}o(Ed,"connectionFromAuth");async function Sd({connection:e,page:t,row:r,column:n,command:i}){let s=tr(e);return await Ze.sendRequest({method:"POST",url:`${s}/api/location/${t}/${r}/${n}/${i}`})}o(Sd,"sendLocationCommand");async function Ad({connection:e}){let t=tr(e);try{return await Ze.sendRequest({method:"GET",url:t}),!0}catch{return!1}}o(Ad,"validateConnection");async function zd({connection:e}){let t=tr(e),r=await Ze.sendRequest({method:"GET",url:`${t}/api/connections`});return Array.isArray(r.body)?r.body:[]}o(zd,"listConnections");async function wd({connection:e,page:t,maxRow:r,maxColumn:n}){return await ln.listButtonsOnPage({connection:e,page:t,maxRow:r,maxColumn:n})}o(wd,"listButtonsOnPage");async function Od({connection:e,maxPage:t,maxRow:r,maxColumn:n}){return await ln.discoverActivePages({connection:e,maxPage:t,maxRow:r,maxColumn:n})}o(Od,"discoverActivePages");var Y={baseUrlFromConnection:tr,connectionFromAuth:Ed,sendLocationCommand:Sd,validateConnection:Ad,listConnections:zd,listButtonsOnPage:wd,discoverActivePages:Od};var ue=Ur.CustomAuth({displayName:"Companion Connection",description:"Enter the host and HTTP port where Bitfocus Companion is running (default 8000). Button label scanning uses the Satellite port (default 16622).",required:!0,props:{host:j.ShortText({displayName:"Host",description:"IP address or hostname of the Companion instance (e.g. 192.168.1.50 or companion.local).",required:!0}),port:j.ShortText({displayName:"Port",description:"HTTP port Companion listens on. Default is 8000.",required:!0,defaultValue:"8000"}),satellite_port:j.ShortText({displayName:"Satellite Port",description:"TCP port for the Companion Satellite API used to scan button labels. Default is 16622. Enable HTTP API and Satellite button subscriptions in Companion settings.",required:!1,defaultValue:"16622"})},validate:o(async({auth:e})=>{if(!e.host?.trim())return{valid:!1,error:"Host is required."};if(!e.port?.trim())return{valid:!1,error:"Port is required."};let t=Number(e.port);return!Number.isInteger(t)||t<1||t>65535?{valid:!1,error:"Port must be a whole number between 1 and 65535."}:await Y.validateConnection({connection:{host:e.host,port:e.port}})?{valid:!0}:{valid:!1,error:"Could not reach Companion at that host and port. Verify Companion is running and the address is correct."}},"validate")});function pn({start:e,end:t,label:r}){let n=[];for(let i=e;i<=t;i+=1)n.push({label:`${r} ${i}`,value:String(i)});return n}o(pn,"buildNumericOptions");function kd(e){return e.text?`${e.text} (row ${e.row}, col ${e.column})`:e.type?`${e.type} (row ${e.row}, col ${e.column})`:`row ${e.row}, col ${e.column}`}o(kd,"formatButtonLabel");var Us=pn({start:1,end:99,label:"Page"}),Ms=pn({start:0,end:31,label:"Row"}),js=pn({start:0,end:31,label:"Column"}),Q={page:j.StaticDropdown({displayName:"Page",description:"Companion button page number (1-based). Use List Active Pages to discover which pages have buttons. Companion does not expose page names over HTTP.",required:!0,defaultValue:"1",options:{options:Us}}),selectionMode:j.StaticDropdown({displayName:"Button Selection",description:"Pick a button by scanning its on-screen label, or enter row and column manually.",required:!0,defaultValue:"label",options:{options:[{label:"By button label (scan page)",value:"label"},{label:"By row and column",value:"coordinates"}]}}),button:j.Dropdown({displayName:"Button",description:"Scans the selected page through the Satellite API. Used when Button Selection is set to label mode.",auth:ue,required:!1,refreshers:["page","selection_mode"],options:o(async({auth:e,page:t,selection_mode:r})=>{if(r==="coordinates")return{disabled:!0,options:[],placeholder:"Switch Button Selection to label mode, or use row and column."};if(!e?.props.host||!t)return{disabled:!0,options:[]};try{let n=Y.connectionFromAuth({host:e.props.host,port:e.props.port,satellitePort:e.props.satellite_port}),i=await Y.listButtonsOnPage({connection:n,page:Number(t),maxRow:15,maxColumn:15});return i.length===0?{disabled:!0,options:[],placeholder:"No labeled buttons found on this page in the scanned grid (rows 0-15, columns 0-15)."}:{options:i.map(s=>({label:kd(s),value:`${s.row}:${s.column}`}))}}catch(n){let i=n instanceof Error?n.message:"Failed to scan buttons from Companion.";return{disabled:!0,options:[],placeholder:i}}},"options")}),row:j.StaticDropdown({displayName:"Row",description:"Button row on the page (0-based). Used when Button Selection is set to row and column.",required:!1,defaultValue:"0",options:{options:Ms}}),column:j.StaticDropdown({displayName:"Column",description:"Button column on the page (0-based). Used when Button Selection is set to row and column.",required:!1,defaultValue:"0",options:{options:js}}),buttonAction:j.StaticDropdown({displayName:"Action",description:"Press & Release runs both down and up actions. Press holds the button until you release it separately.",required:!0,defaultValue:"press_and_release",options:{options:[{label:"Press & Release",value:"press_and_release"},{label:"Press",value:"press"},{label:"Release",value:"release"}]}}),scanMaxRow:j.StaticDropdown({displayName:"Max Row to Scan",description:"Highest row index to scan when listing buttons (0-based).",required:!1,defaultValue:"15",options:{options:Ms}}),scanMaxColumn:j.StaticDropdown({displayName:"Max Column to Scan",description:"Highest column index to scan when listing buttons (0-based).",required:!1,defaultValue:"15",options:{options:js}}),scanMaxPage:j.StaticDropdown({displayName:"Max Page to Scan",description:"Highest page number to check when discovering active pages.",required:!1,defaultValue:"20",options:{options:Us.slice(0,20)}})};var Ls=Te({auth:ue,name:"list_active_pages",displayName:"List Active Pages",description:"Scans page numbers and returns which pages contain buttons. Page names are not available via the HTTP API.",audience:"both",aiMetadata:{description:"Discover which Companion pages have at least one button in the scanned grid. Returns page numbers and button counts, not page names. Read-only and safe to retry.",idempotent:!0},props:{max_page:Q.scanMaxPage,max_row:Q.scanMaxRow,max_column:Q.scanMaxColumn},async run(e){let{max_page:t,max_row:r,max_column:n}=e.propsValue,i=Y.connectionFromAuth({host:e.auth.props.host,port:e.auth.props.port,satellitePort:e.auth.props.satellite_port});return(await Y.discoverActivePages({connection:i,maxPage:t!==void 0?Number(t):void 0,maxRow:r!==void 0?Number(r):void 0,maxColumn:n!==void 0?Number(n):void 0})).map(u=>({page:u.page,button_count:u.buttonCount,label:`Page ${u.page} (${u.buttonCount} buttons)`}))}});var Bs=Te({auth:ue,name:"list_buttons_on_page",displayName:"List Buttons on Page",description:"Scans a Companion page and returns button labels with row/column locations.",audience:"both",aiMetadata:{description:"Discover buttons on a Companion page using the Satellite API. Returns each button text label (when set), type, row, and column. Read-only and safe to retry.",idempotent:!0},props:{page:Q.page,max_row:Q.scanMaxRow,max_column:Q.scanMaxColumn},async run(e){let{page:t,max_row:r,max_column:n}=e.propsValue,i=Y.connectionFromAuth({host:e.auth.props.host,port:e.auth.props.port,satellitePort:e.auth.props.satellite_port});return(await Y.listButtonsOnPage({connection:i,page:Number(t),maxRow:r!==void 0?Number(r):void 0,maxColumn:n!==void 0?Number(n):void 0})).map(u=>({page:u.page,row:u.row,column:u.column,text:u.text,type:u.type,label:u.text??(u.type?`${u.type} @ ${u.row}/${u.column}`:null)}))}});function Rd({selectionMode:e,button:t,row:r,column:n}){if(e==="coordinates")return{row:Number(r??0),column:Number(n??0)};if(typeof t!="string"||!t.includes(":"))throw new Error("Select a button from the scanned list, or switch to row and column mode.");let[i,s]=t.split(":");return{row:Number(i),column:Number(s)}}o(Rd,"resolveButtonCoordinates");function Nd(e){switch(e){case"press":return"down";case"release":return"up";case"press_and_release":return"press";default:return"press"}}o(Nd,"resolveHttpCommand");var Fs=Te({auth:ue,name:"trigger_button",displayName:"Trigger Button",description:"Press, release, or press-and-release a Companion button by label or grid location.",audience:"both",aiMetadata:{description:"Trigger a Bitfocus Companion button on a page. Choose Press & Release for a normal tap, Press to hold, or Release to let go. Pick the button by scanned label or by row/column. Not idempotent \u2014 retries may re-trigger button actions.",idempotent:!1},props:{page:Q.page,selection_mode:Q.selectionMode,button:Q.button,row:Q.row,column:Q.column,action:Q.buttonAction},async run(e){let{page:t,selection_mode:r,button:n,row:i,column:s,action:u}=e.propsValue,p=Number(t),f=Rd({selectionMode:r,button:n,row:i,column:s}),{row:g,column:P}=f,b=Nd(u),x=await Y.sendLocationCommand({connection:{host:e.auth.props.host,port:e.auth.props.port},page:p,row:g,column:P,command:b});return{page:p,row:g,column:P,action:u??"press_and_release",http_command:b,status:x.status}}});var Dd=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#1A1A1A"/><rect x="10" y="14" width="44" height="36" rx="6" fill="#2D2D2D"/><rect x="14" y="18" width="10" height="10" rx="2" fill="#F5A623"/><rect x="27" y="18" width="10" height="10" rx="2" fill="#4A90D9"/><rect x="40" y="18" width="10" height="10" rx="2" fill="#7ED321"/><rect x="14" y="31" width="10" height="10" rx="2" fill="#BD10E0"/><rect x="27" y="31" width="10" height="10" rx="2" fill="#F5A623"/><rect x="40" y="31" width="10" height="10" rx="2" fill="#4A90D9"/></svg>')}`,Cd=Pi({displayName:"Bitfocus Companion",description:"Trigger Companion buttons and discover page layouts via HTTP and Satellite APIs.",minimumSupportedRelease:"0.36.1",logoUrl:Dd,categories:["DEVELOPER_TOOLS"],auth:ue,authors:["activepieces"],actions:[Fs,Bs,Ls,Ns({auth:ue,baseUrl:o(e=>e?Y.baseUrlFromConnection({host:e.props.host,port:e.props.port}):"","baseUrl"),authMapping:o(async()=>({}),"authMapping")})],triggers:[]});0&&(module.exports={bitfocusCompanion});
6
+ /*! Bundled license information:
7
+
8
+ mime-types/index.js:
9
+ (*!
10
+ * mime-types
11
+ * Copyright(c) 2014 Jonathan Ong
12
+ * Copyright(c) 2015 Douglas Christopher Wilson
13
+ * MIT Licensed
14
+ *)
15
+ */