fern-api 3.22.3 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.cjs +3 -3
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1100,7 +1100,7 @@ ${e}`)}return e}getContent(){let e=this.stringifyImports();return e.length>0?e+`
1100
1100
  `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function Dzs(e){return Array.isArray(e)}function Wfo(e){return typeof e=="boolean"}function pya(e){return e===null}function Atp(e){return e==null}function Bzs(e){return typeof e=="number"}function _ya(e){return typeof e=="string"}function mtp(e){return typeof e=="symbol"}function DVt(e){return e===void 0}function _ha(e){return tGi(e)&&Izs(e)==="[object RegExp]"}function tGi(e){return typeof e=="object"&&e!==null}function Flo(e){return tGi(e)&&Izs(e)==="[object Date]"}function hha(e){return tGi(e)&&(Izs(e)==="[object Error]"||e instanceof Error)}function yha(e){return typeof e=="function"}function Ptp(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function jtp(e){return Yi.isBuffer(e)}function Izs(e){return Object.prototype.toString.call(e)}function kIs(e){return e<10?"0"+e.toString(10):e.toString(10)}function SuE(){var e=new Date,t=[kIs(e.getHours()),kIs(e.getMinutes()),kIs(e.getSeconds())].join(":");return[e.getDate(),Mtp[e.getMonth()],t].join(" ")}function wtp(){console.log("%s - %s",SuE(),Vfo.apply(null,arguments))}function Czs(e,t){if(!t||!tGi(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}function Etp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Stp,B_a,eCs,Mtp,Dtp,MuE=zIn(()=>{"use strict";Ir(),Cr(),guE(),OuE(),Stp=/%[sdj%]/g,B_a={},NVt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},NVt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Mtp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Dtp={inherits:Szs,_extend:Czs,log:wtp,isBuffer:jtp,isPrimitive:Ptp,isFunction:yha,isError:hha,isDate:Flo,isObject:tGi,isRegExp:_ha,isUndefined:DVt,isSymbol:mtp,isString:_ya,isNumber:Bzs,isNullOrUndefined:Atp,isNull:pya,isBoolean:Wfo,isArray:Dzs,inspect:NVt,deprecate:Mzs,format:Vfo,debuglog:Otp}}),DuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=(MuE(),yiE(gtp));if(r&&r.default){t.exports=r.default;for(let i in r)t.exports[i]=r[i]}else r&&(t.exports=r)}),BuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=DuE().inspect}),xfo=wn((e,t)=>{"use strict";Ir(),Cr();var r=typeof Map=="function"&&Map.prototype,i=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&i&&typeof i.get=="function"?i.get:null,a=r&&Map.prototype.forEach,o=typeof Set=="function"&&Set.prototype,c=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,f=o&&c&&typeof c.get=="function"?c.get:null,s=o&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,l=u?WeakMap.prototype.has:null,p=typeof WeakSet=="function"&&WeakSet.prototype,_=p?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,y=h?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,v=Object.prototype.toString,O=Function.prototype.toString,A=String.prototype.match,g=String.prototype.slice,m=String.prototype.replace,j=String.prototype.toUpperCase,M=String.prototype.toLowerCase,E=RegExp.prototype.test,D=Array.prototype.concat,B=Array.prototype.join,F=Array.prototype.slice,N=Math.floor,R=typeof BigInt=="function"?BigInt.prototype.valueOf:null,z=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,W=typeof Symbol=="function"&&typeof Symbol.iterator=="object",K=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===W||!0)?Symbol.toStringTag:null,fe=Object.prototype.propertyIsEnumerable,pe=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ft){return Ft.__proto__}:null);function L(Ft,Q){if(Ft===1/0||Ft===-1/0||Ft!==Ft||Ft&&Ft>-1e3&&Ft<1e3||E.call(/e/,Q))return Q;var Z=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ft=="number"){var ut=Ft<0?-N(-Ft):N(Ft);if(ut!==Ft){var yt=String(ut),Wt=g.call(Q,yt.length+1);return m.call(yt,Z,"$&_")+"."+m.call(m.call(Wt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(Q,Z,"$&_")}var G=BuE(),Re=G.custom,le=ae(Re)?Re:null,De={__proto__:null,double:'"',single:"'"},Ke={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function Ft(Q,Z,ut,yt){var Wt=Z||{};if(lt(Wt,"quoteStyle")&&!lt(De,Wt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lt(Wt,"maxStringLength")&&(typeof Wt.maxStringLength=="number"?Wt.maxStringLength<0&&Wt.maxStringLength!==1/0:Wt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Nt=lt(Wt,"customInspect")?Wt.customInspect:!0;if(typeof Nt!="boolean"&&Nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lt(Wt,"indent")&&Wt.indent!==null&&Wt.indent!==" "&&!(parseInt(Wt.indent,10)===Wt.indent&&Wt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lt(Wt,"numericSeparator")&&typeof Wt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var $=Wt.numericSeparator;if(typeof Q>"u")return"undefined";if(Q===null)return"null";if(typeof Q=="boolean")return Q?"true":"false";if(typeof Q=="string")return H(Q,Wt);if(typeof Q=="number"){if(Q===0)return 1/0/Q>0?"0":"-0";var Se=String(Q);return $?L(Q,Se):Se}if(typeof Q=="bigint"){var he=String(Q)+"n";return $?L(Q,he):he}var Te=typeof Wt.depth>"u"?5:Wt.depth;if(typeof ut>"u"&&(ut=0),ut>=Te&&Te>0&&typeof Q=="object")return Je(Q)?"[Array]":"[Object]";var _t=fr(Wt,ut);if(typeof yt>"u")yt=[];else if($t(yt,Q)>=0)return"[Circular]";function yr(Cw,Tg,qE){if(Tg&&(yt=F.call(yt),yt.push(Tg)),qE){var JOe={depth:Wt.depth};return lt(Wt,"quoteStyle")&&(JOe.quoteStyle=Wt.quoteStyle),Ft(Cw,JOe,ut+1,yt)}return Ft(Cw,Wt,ut+1,yt)}if(typeof Q=="function"&&!Dr(Q)){var Pr=Xt(Q),Ri=Mi(Q,yr);return"[Function"+(Pr?": "+Pr:" (anonymous)")+"]"+(Ri.length>0?" { "+B.call(Ri,", ")+" }":"")}if(ae(Q)){var Mn=W?m.call(String(Q),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(Q);return typeof Q=="object"&&!W?J(Mn):Mn}if(k(Q)){for(var zc="<"+M.call(String(Q.nodeName)),Wl=Q.attributes||[],VA=0;VA<Wl.length;VA++)zc+=" "+Wl[VA].name+"="+se(ne(Wl[VA].value),"double",Wt);return zc+=">",Q.childNodes&&Q.childNodes.length&&(zc+="..."),zc+="</"+M.call(String(Q.nodeName))+">",zc}if(Je(Q)){if(Q.length===0)return"[]";var CO=Mi(Q,yr);return _t&&!Jt(CO)?"["+Hr(CO,_t)+"]":"[ "+B.call(CO,", ")+" ]"}if(Lt(Q)){var Iw=Mi(Q,yr);return!("cause"in Error.prototype)&&"cause"in Q&&!fe.call(Q,"cause")?"{ ["+String(Q)+"] "+B.call(D.call("[cause]: "+yr(Q.cause),Iw),", ")+" }":Iw.length===0?"["+String(Q)+"]":"{ ["+String(Q)+"] "+B.call(Iw,", ")+" }"}if(typeof Q=="object"&&Nt){if(le&&typeof Q[le]=="function"&&G)return G(Q,{depth:Te-ut});if(Nt!=="symbol"&&typeof Q.inspect=="function")return Q.inspect()}if(rr(Q)){var CE=[];return a&&a.call(Q,function(Cw,Tg){CE.push(yr(Tg,Q,!0)+" => "+yr(Cw,Q))}),it("Map",n.call(Q),CE,_t)}if(gn(Q)){var qP=[];return s&&s.call(Q,function(Cw){qP.push(yr(Cw,Q))}),it("Set",f.call(Q),qP,_t)}if(nn(Q))return Oe("WeakMap");if(q(Q))return Oe("WeakSet");if(Gr(Q))return Oe("WeakRef");if(Qt(Q))return J(yr(Number(Q)));if(je(Q))return J(yr(R.call(Q)));if(Ht(Q))return J(b.call(Q));if(zt(Q))return J(yr(String(Q)));if(typeof window<"u"&&Q===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Q===globalThis||typeof globalThis<"u"&&Q===globalThis)return"{ [object globalThis] }";if(!et(Q)&&!Dr(Q)){var xF=Mi(Q,yr),tC=pe?pe(Q)===Object.prototype:Q instanceof Object||Q.constructor===Object,GF=Q instanceof Object?"":"null prototype",$D=!tC&&K&&Object(Q)===Q&&K in Q?g.call(Ee(Q),8,-1):GF?"Object":"",CL=tC||typeof Q.constructor!="function"?"":Q.constructor.name?Q.constructor.name+" ":"",f7=CL+($D||GF?"["+B.call(D.call([],$D||[],GF||[]),": ")+"] ":"");return xF.length===0?f7+"{}":_t?f7+"{"+Hr(xF,_t)+"}":f7+"{ "+B.call(xF,", ")+" }"}return String(Q)};function se(Ft,Q,Z){var ut=Z.quoteStyle||Q,yt=De[ut];return yt+Ft+yt}function ne(Ft){return m.call(String(Ft),/"/g,"&quot;")}function Je(Ft){return Ee(Ft)==="[object Array]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function et(Ft){return Ee(Ft)==="[object Date]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function Dr(Ft){return Ee(Ft)==="[object RegExp]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function Lt(Ft){return Ee(Ft)==="[object Error]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function zt(Ft){return Ee(Ft)==="[object String]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function Qt(Ft){return Ee(Ft)==="[object Number]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function Ht(Ft){return Ee(Ft)==="[object Boolean]"&&(!K||!(typeof Ft=="object"&&K in Ft))}function ae(Ft){if(W)return Ft&&typeof Ft=="object"&&Ft instanceof Symbol;if(typeof Ft=="symbol")return!0;if(!Ft||typeof Ft!="object"||!U)return!1;try{return U.call(Ft),!0}catch{}return!1}function je(Ft){if(!Ft||typeof Ft!="object"||!R)return!1;try{return R.call(Ft),!0}catch{}return!1}var ht=Object.prototype.hasOwnProperty||function(Ft){return Ft in this};function lt(Ft,Q){return ht.call(Ft,Q)}function Ee(Ft){return v.call(Ft)}function Xt(Ft){if(Ft.name)return Ft.name;var Q=A.call(O.call(Ft),/^function\s*([\w$]+)/);return Q?Q[1]:null}function $t(Ft,Q){if(Ft.indexOf)return Ft.indexOf(Q);for(var Z=0,ut=Ft.length;Z<ut;Z++)if(Ft[Z]===Q)return Z;return-1}function rr(Ft){if(!n||!Ft||typeof Ft!="object")return!1;try{n.call(Ft);try{f.call(Ft)}catch{return!0}return Ft instanceof Map}catch{}return!1}function nn(Ft){if(!l||!Ft||typeof Ft!="object")return!1;try{l.call(Ft,l);try{_.call(Ft,_)}catch{return!0}return Ft instanceof WeakMap}catch{}return!1}function Gr(Ft){if(!y||!Ft||typeof Ft!="object")return!1;try{return y.call(Ft),!0}catch{}return!1}function gn(Ft){if(!f||!Ft||typeof Ft!="object")return!1;try{f.call(Ft);try{n.call(Ft)}catch{return!0}return Ft instanceof Set}catch{}return!1}function q(Ft){if(!_||!Ft||typeof Ft!="object")return!1;try{_.call(Ft,_);try{l.call(Ft,l)}catch{return!0}return Ft instanceof WeakSet}catch{}return!1}function k(Ft){return!Ft||typeof Ft!="object"?!1:typeof HTMLElement<"u"&&Ft instanceof HTMLElement?!0:typeof Ft.nodeName=="string"&&typeof Ft.getAttribute=="function"}function H(Ft,Q){if(Ft.length>Q.maxStringLength){var Z=Ft.length-Q.maxStringLength,ut="... "+Z+" more character"+(Z>1?"s":"");return H(g.call(Ft,0,Q.maxStringLength),Q)+ut}var yt=Ke[Q.quoteStyle||"single"];yt.lastIndex=0;var Wt=m.call(m.call(Ft,yt,"\\$1"),/[\x00-\x1f]/g,re);return se(Wt,"single",Q)}function re(Ft){var Q=Ft.charCodeAt(0),Z={8:"b",9:"t",10:"n",12:"f",13:"r"}[Q];return Z?"\\"+Z:"\\x"+(Q<16?"0":"")+j.call(Q.toString(16))}function J(Ft){return"Object("+Ft+")"}function Oe(Ft){return Ft+" { ? }"}function it(Ft,Q,Z,ut){var yt=ut?Hr(Z,ut):B.call(Z,", ");return Ft+" ("+Q+") {"+yt+"}"}function Jt(Ft){for(var Q=0;Q<Ft.length;Q++)if($t(Ft[Q],`
1101
1101
  `)>=0)return!1;return!0}function fr(Ft,Q){var Z;if(Ft.indent===" ")Z=" ";else if(typeof Ft.indent=="number"&&Ft.indent>0)Z=B.call(Array(Ft.indent+1)," ");else return null;return{base:Z,prev:B.call(Array(Q+1),Z)}}function Hr(Ft,Q){if(Ft.length===0)return"";var Z=`
1102
1102
  `+Q.prev+Q.base;return Z+B.call(Ft,","+Z)+`
1103
- `+Q.prev}function Mi(Ft,Q){var Z=Je(Ft),ut=[];if(Z){ut.length=Ft.length;for(var yt=0;yt<Ft.length;yt++)ut[yt]=lt(Ft,yt)?Q(Ft[yt],Ft):""}var Wt=typeof z=="function"?z(Ft):[],Nt;if(W){Nt={};for(var $=0;$<Wt.length;$++)Nt["$"+Wt[$]]=Wt[$]}for(var Se in Ft)lt(Ft,Se)&&(Z&&String(Number(Se))===Se&&Se<Ft.length||W&&Nt["$"+Se]instanceof Symbol||(E.call(/[^\w$]/,Se)?ut.push(Q(Se,Ft)+": "+Q(Ft[Se],Ft)):ut.push(Se+": "+Q(Ft[Se],Ft))));if(typeof z=="function")for(var he=0;he<Wt.length;he++)fe.call(Ft,Wt[he])&&ut.push("["+Q(Wt[he])+"]: "+Q(Ft[Wt[he]],Ft));return ut}}),qzs=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){return typeof r=="string"||typeof r=="symbol"}}),IuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=xfo(),n=qzs();t.exports=function(a,o){if(!n(o))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+i(o));return a[o]}}),CuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Function.prototype.toString,i=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof i=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},i(function(){throw 42},null,n)}catch(g){g!==a&&(i=null)}else i=null;var o=/^\s*class\b/,c=function(g){try{var m=r.call(g);return o.test(m)}catch{return!1}},f=function(g){try{return c(g)?!1:(r.call(g),!0)}catch{return!1}},s=Object.prototype.toString,u="[object Object]",l="[object Function]",p="[object GeneratorFunction]",_="[object HTMLAllCollection]",h="[object HTML document.all class]",y="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),O=function(){return!1};typeof document=="object"&&(A=document.all,s.call(A)===s.call(document.all)&&(O=function(g){if((v||!g)&&(typeof g>"u"||typeof g=="object"))try{var m=s.call(g);return(m===_||m===h||m===y||m===u)&&g("")==null}catch{}return!1}));var A;t.exports=i?function(g){if(O(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;try{i(g,null,n)}catch(m){if(m!==a)return!1}return!c(g)&&f(g)}:function(g){if(O(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;if(b)return f(g);if(c(g))return!1;var m=s.call(g);return m!==l&&m!==p&&!/^\[object HTML/.test(m)?!1:f(g)}}),Btp=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=CuE()}),quE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=IuE(),n=Btp(),a=qzs(),o=xfo();t.exports=function(c,f){if(!a(f))throw new r("Assertion failed: IsPropertyKey(P) is not true");var s=i(c,f);if(s!=null){if(!n(s))throw new r(o(f)+" is not a function: "+o(s));return s}}}),TuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=itp();t.exports=function(){return r()&&!!Symbol.toStringTag}}),Itp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=TuE()(),n,a,o,c;i&&(n=r("Object.prototype.hasOwnProperty"),a=r("RegExp.prototype.exec"),o={},f=function(){throw o},c={toString:f,valueOf:f},typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=f));var f,s=r("Object.prototype.toString"),u=Object.getOwnPropertyDescriptor,l="[object RegExp]";t.exports=i?function(p){if(!p||typeof p!="object")return!1;var _=u(p,"lastIndex"),h=_&&n(_,"value");if(!h)return!1;try{a(p,c)}catch(y){return y===o}}:function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:s(p)===l}}),Ctp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=Itp(),n=r("RegExp.prototype.exec"),a=MR();t.exports=function(o){if(!i(o))throw new a("`regex` must be a RegExp");return function(c){return n(o,c)!==null}}}),RuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r,i){for(var n=0;n<r.length;n+=1)if(!i(r[n],n,r))return!1;return!0}}),zuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){if(r===null)return"Null";if(typeof r>"u")return"Undefined";if(typeof r=="function"||typeof r=="object")return"Object";if(typeof r=="number")return"Number";if(typeof r=="boolean")return"Boolean";if(typeof r=="string")return"String"}}),qtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=zuE();t.exports=function(i){return typeof i=="symbol"?"Symbol":typeof i=="bigint"?"BigInt":r(i)}}),NuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=xfo(),n=qzs(),a=qtp();t.exports=function(o,c){if(a(o)!=="Object")throw new r("Assertion failed: Type(O) is not Object");if(!n(c))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+i(c));return o[c]}}),FuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi();t.exports=r("%Math.min%")}),Ttp=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=Number.isNaN||function(r){return r!==r}}),QuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ttp();t.exports=function(i){return(typeof i=="number"||typeof i=="bigint")&&!r(i)&&i!==1/0&&i!==-1/0}}),Tzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%Math.abs%"),n=r("%Math.floor%"),a=Ttp(),o=QuE();t.exports=function(c){if(typeof c!="number"||a(c)||!o(c))return!1;var f=i(c);return n(f)===f}}),Rtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=MR(),n=Tzs(),a=r("String.prototype.slice");t.exports=function(o,c,f){if(typeof o!="string")throw new i("Assertion failed: `string` must be a String");if(typeof c!="string")throw new i("Assertion failed: `searchValue` must be a String");if(!n(f)||f<0)throw new i("Assertion failed: `fromIndex` must be a non-negative integer");var s=o.length;if(c===""&&f<=s)return f;for(var u=c.length,l=f;l<=s-u;l+=1){var p=a(o,l,l+u);if(p===c)return l}return-1}}),Rzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR();t.exports=function(i){if(i==null)throw new r(arguments.length>0&&arguments[1]||"Cannot call method on "+i);return i}}),zzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%String%"),n=MR();t.exports=function(a){if(typeof a=="symbol")throw new n("Cannot convert a Symbol value to a string");return i(a)}}),ztp=wn((e,t)=>{"use strict";Ir(),Cr();var r=Rzs(),i=zzs(),n=QVt(),a=n("String.prototype.replace"),o=/^\s$/.test("\u180E"),c=o?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,f=o?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var s=i(r(this));return a(a(s,c,""),f,"")}}),Ntp=wn((e,t)=>{"use strict";Ir(),Cr();var r=ztp(),i="\u200B",n="\u180E";t.exports=function(){return String.prototype.trim&&i.trim()===i&&n.trim()===n&&("_"+n).trim()==="_"+n&&(n+"_").trim()===n+"_"?String.prototype.trim:r}}),UuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Lfo(),i=Ntp();t.exports=function(){var n=i();return r(String.prototype,{trim:n},{trim:function(){return String.prototype.trim!==n}}),n}}),LuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ezs(),i=Lfo(),n=Rzs(),a=ztp(),o=Ntp(),c=UuE(),f=r(o()),s=function(u){return n(u),f(u)};i(s,{getPolyfill:o,implementation:a,shim:c}),t.exports=s}),VuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%Number%"),n=r("%RegExp%"),a=MR(),o=r("%parseInt%"),c=QVt(),f=Ctp(),s=c("String.prototype.slice"),u=f(/^0b[01]+$/i),l=f(/^0o[0-7]+$/i),p=f(/^[-+]0x[0-9a-f]+$/i),_=["\x85","\u200B","\uFFFE"].join(""),h=new n("["+_+"]","g"),y=f(h),b=LuE();t.exports=function v(O){if(typeof O!="string")throw new a("Assertion failed: `argument` is not a String");if(u(O))return i(o(s(O,2),2));if(l(O))return i(o(s(O,2),8));if(y(O)||p(O))return NaN;var A=b(O);return A!==O?v(A):i(O)}}),WuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=Tzs(),n=QVt(),a=n("String.prototype.slice");t.exports=function(o,c,f){if(typeof o!="string"||!i(c)||arguments.length>2&&!i(f))throw new r("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return a(o,c,arguments.length>2?f:o.length)}}),xuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){return typeof r=="string"||typeof r>"u"}}),GuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt()("String.prototype.slice");t.exports=function(i,n){return i===n?!0:i.length>n.length?!1:r(n,0,i.length)===i}}),HuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=Ctp(),n=RuE(),a=xfo(),o=NuE(),c=ftp(),f=FuE(),s=Rtp(),u=VuE(),l=WuE(),p=zzs(),_=qtp(),h=Tzs(),y=xuE(),b=GuE(),v=i(/^\$[0-9]/),O=i(/^\$[0-9][0-9]/);t.exports=function(A,g,m,j,M,E){if(typeof A!="string")throw new r("Assertion failed: `matched` must be a String");if(typeof g!="string")throw new r("Assertion failed: `str` must be a String");if(!h(m)||m<0)throw new r("Assertion failed: `position` must be a nonnegative integer, got "+a(m));if(!c(j)||!n(j,y))throw new r("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+a(j));if(typeof M<"u"&&_(M)!=="Object")throw new r("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof E!="string")throw new r("Assertion failed: `replacementTemplate` must be a String");var D=g.length;if(m>D)throw new r("Assertion failed: position > stringLength, got "+a(m));for(var B=E,F="";B!=="";){var N,R,z;if(b("$$",B))N="$$",R="$";else if(b("$`",B))N="$`",R=l(g,0,m);else if(b("$&",B))N="$&",R=A;else if(b("$'",B)){N="$'";var U=A.length,W=m+U;R=l(g,f(W,D))}else if(v(B)){var K=O(B)?2:1,fe=l(B,1,1+K),pe=u(fe);if(pe<0||pe>99)throw new r("Assertion failed: `index` must be >= 0 and <= 99");var L=j.length;pe>L&&K===2&&(K=1,fe=l(fe,0,1),pe=u(fe)),N=l(B,0,1+K),1<=pe&&pe<=L?(z=j[pe-1],typeof z>"u"?R="":R=z):R=N}else if(b("$<",B)){var G=s(B,">",0);if(G===-1||typeof M>"u")N="$<",R=N;else{N=l(B,0,G+1);var Re=l(B,2,G);if(_(M)!=="Object")throw new r("Assertion failed: Type(namedCaptures) is not Object");z=o(M,Re),typeof z>"u"?R="":R=p(z)}}else N=l(B,0,1),R=N;var le=N.length;B=l(B,le),F+=R}return F}}),Ftp=wn((e,t)=>{"use strict";Ir(),Cr();var r=cuE(),i=quE(),n=HuE(),a=Btp(),o=Rzs(),c=zzs(),f=Rtp(),s=xyi(),u=QVt(),l=etp()(),p=Itp(),_=s("%Math.max%"),h=MR(),y=u("Array.prototype.push"),b=u("String.prototype.slice"),v=u("String.prototype.indexOf"),O=u("String.prototype.replace");t.exports=function(A,g){var m=o(this),j=p(A);if(j&&v(b(A,A.source.length+2),"g")===-1)throw new h("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(l&&Symbol.replace){if(A!=null){var M=i(A,Symbol.replace);if(typeof M<"u")return r(M,A,[m,g])}}else if(j)return O(m,A,g);var E=c(m),D=c(A),B=a(g);B||(g=c(g));for(var F=D.length,N=_(1,F),R=[],z=f(E,D,0);z!==-1;)y(R,z),z=f(E,D,z+N);for(var U=0,W="",K=0;K<R.length;K+=1){var fe;if(B)fe=c(r(g,void 0,[D,R[K],E]));else{if(typeof g!="string")throw new h("Assertion failed: `replaceValue` should be a string at this point");var pe=[];fe=n(D,E,R[K],pe,void 0,g)}var L=b(E,U,R[K]);W+=L+fe,U=R[K]+F}return U<E.length&&(W+=b(E,U)),W}}),Qtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ftp();t.exports=function(){return String.prototype.replaceAll||r}}),KuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Lfo(),i=Qtp();t.exports=function(){var n=i();return r(String.prototype,{replaceAll:n},{replaceAll:function(){return String.prototype.replaceAll!==n}}),n}}),JuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ezs(),i=Lfo(),n=Ftp(),a=Qtp(),o=KuE(),c=r(n);i(c,{getPolyfill:a,implementation:n,shim:o}),t.exports=c});Ir();Cr();var kMV=hiE(JuE(),1),$uE=Object.defineProperty,YuE=Object.defineProperties,XuE=Object.getOwnPropertyDescriptors,x6d=Object.getOwnPropertySymbols,ZuE=Object.prototype.hasOwnProperty,kuE=Object.prototype.propertyIsEnumerable,G6d=(e,t,r)=>t in e?$uE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,esE=(e,t)=>{for(var r in t||(t={}))ZuE.call(t,r)&&G6d(e,r,t[r]);if(x6d)for(var r of x6d(t))kuE.call(t,r)&&G6d(e,r,t[r]);return e},tsE=(e,t)=>YuE(e,XuE(t)),rsE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"nuget",registryUrl:"",packageName:"",apiKeyEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},isE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},nsE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"maven",registryUrl:"",coordinate:"",usernameEnvironmentVariable:"",passwordEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},asE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},osE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"pypi",registryUrl:"https://pypi.org",packageName:"",usernameEnvironmentVariable:"",passwordEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},usE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"rubygems",registryUrl:"https://rubygems.org",packageName:"",apiKeyEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},ssE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},csE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"npm",registryUrl:"https://registry.npmjs.org",packageName:"",tokenEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},lsE=class{constructor(){this.REFERENCE_REGEX=/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9/{}_-]*)$/}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let r=e.match(this.REFERENCE_REGEX);if(!(!r?.[1]||!r?.[2]))return{method:r[1],path:r[2]}}},fsE=class{constructor({generator:e,endpoint:t}){this.generator=e,this.endpoint=t}async generate(e){let t=e??this.resolveDefaultRequestOrThrow();return this.generator.generate({endpoint:this.endpoint.location,baseURL:t.baseURL,environment:t.environment,auth:t.auth,pathParameters:t.pathParameters,queryParameters:t.queryParameters,headers:t.headers,requestBody:t.requestBody})}generateSync(e){let t=e??this.resolveDefaultRequestOrThrow();return this.generator.generateSync({endpoint:this.endpoint.location,baseURL:t.baseURL,environment:t.environment,auth:t.auth,pathParameters:t.pathParameters,queryParameters:t.queryParameters,headers:t.headers,requestBody:t.requestBody})}resolveDefaultRequestOrThrow(){var e;for(let t of(e=this.endpoint.examples)!=null?e:[])return tsE(esE({},t),{environment:void 0});throw new Error("No default example found for endpoint; please specify a request payload")}},dsE=class{constructor({config:e,language:t,ir:r}){this.config=e,this.language=t,this.ir=r,this.httpEndpointReferenceParser=new lsE}endpoint(e,t={}){let r=this.parseEndpointOrThrow({endpoint:e}),i=this.getGenerator({ir:this.ir}),n=this.resolveEndpointOrThrow({ir:this.ir,parsedEndpoint:r});return new fsE({generator:i,endpoint:n})}getGenerator({ir:e}){switch(this.language){case"python":return new D$w({ir:e,config:this.config});case"typescript":return new QoE({ir:e,config:this.config});case"java":return new yLw({ir:e,config:this.config});case"php":return new CGw({ir:e,config:this.config});case"ruby":return new ZZw({ir:e,config:this.config});case"csharp":return new kTw({ir:e,config:this.config});case"go":return new uNw({ir:e,config:this.config});case"swift":return new ZtE({ir:e,config:this.config});default:throw new Error(`Unsupported language: ${this.language}`)}}parseEndpointOrThrow({endpoint:e}){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Invalid endpoint reference: "${e}"`);return t}resolveEndpointOrThrow({ir:e,parsedEndpoint:t}){for(let r of Object.values(e.endpoints))if(this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t}))return r;throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`)}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}},psE=class{constructor(e){this.snippetInputs=e.snippetInputs}sdk(e,t={}){return this.getGeneratorForLanguage({language:e})}getGeneratorForLanguage({language:e}){let t=this.snippetInputs.find(i=>i.language===e);if(!t)throw new Error(`No configuration found for language: ${e}`);let r=this.getGeneratorConfigForLanguage({language:e,customConfig:t.ir.generatorConfig});return new dsE({config:r,language:e,ir:t.ir})}getGeneratorConfigForLanguage({language:e,customConfig:t}){var r,i,n,a,o,c;let s={python:osE,typescript:csE,java:nsE,php:asE,ruby:usE,csharp:rsE,go:isE,swift:ssE}[e];if(!s)throw new Error(`Unsupported language: ${e}`);return t?.apiName&&(s.workspaceName=t.apiName),t?.organization&&(s.organization=t.organization),t?.customConfig&&(s.customConfig=t.customConfig),t?.outputConfig&&s.output.mode.type==="github"&&t.outputConfig.type==="publish"&&(t.outputConfig.value.type==="maven"&&((r=s.output.mode.publishInfo)==null?void 0:r.type)==="maven"?s.output.mode.publishInfo.coordinate=t.outputConfig.value.coordinate:t.outputConfig.value.type==="nuget"&&((i=s.output.mode.publishInfo)==null?void 0:i.type)==="nuget"||t.outputConfig.value.type==="npm"&&((n=s.output.mode.publishInfo)==null?void 0:n.type)==="npm"||t.outputConfig.value.type==="pypi"&&((a=s.output.mode.publishInfo)==null?void 0:a.type)==="pypi"||t.outputConfig.value.type==="rubygems"&&((o=s.output.mode.publishInfo)==null?void 0:o.type)==="rubygems"?s.output.mode.publishInfo.packageName=t.outputConfig.value.packageName:e==="go"&&(s.output.mode.repoUrl=(c=t.outputConfig.value.repoUrl)!=null?c:"")),s}};function _sE(e,t,r,i){let n={httpVersion:"1.1",method:"GET",url:"",headers:[],headersSize:-1,queryString:[],cookies:[],bodySize:-1};n.url=I9d({endpoint:e,pathParameters:t.pathParameters}),n.method=e.method;let a=Wlo(t.queryParameters,e.queryParameters)??{};n.queryString=Object.entries(a).map(([f,s])=>({name:f,value:G9i(s)})),n.headers=Object.entries(t.headers??{}).map(([f,s])=>({name:f,value:G9i(s)}));let o=e.requests?.[0]?.contentType;if(i!=null)if(o==null&&(o=i.type==="json"?"application/json":"multipart/form-data"),n.postData={mimeType:o},i.value&&typeof i.value=="object"&&!Array.isArray(i.value)&&(i.value=Object.fromEntries(Object.entries(i.value).filter(([f,s])=>Array.isArray(s)||typeof s!="object"||s==null?!0:Object.keys(s).length>0))),i.type==="json")n.postData.text=JSON.stringify(i.value,null,2);else if(i.type==="form"){n.postData.params=[];for(let[f,s]of Object.entries(i.value))if(s.type==="json")n.postData.params.push({name:f,value:typeof s.value=="string"?s.value:JSON.stringify(s.value,null,2)});else if(s.type==="filename")n.postData.params.push({name:f,fileName:s.value});else if(s.type==="filenameWithData")n.postData.params.push({name:f,fileName:s.filename});else if(s.type==="filenames")for(let u of s.value)n.postData.params.push({name:f,fileName:u});else if(s.type==="filenamesWithData")for(let{filename:u}of s.value)n.postData.params.push({name:f,fileName:u})}else i.type==="bytes"&&(n.postData.params=[{name:"file",value:i.value.value}]);let c=e.auth?.[0]!=null?r[e.auth[0]]:void 0;return c!=null&&Cco(c)._visit({basicAuth:({usernameName:f="username",passwordName:s="password"})=>{n.headers.push({name:"Authorization",value:`Basic <${f}>:<${s}>`})},bearerAuth:({tokenName:f="token"})=>{n.headers.push({name:"Authorization",value:`Bearer <${f}>`})},header:({headerWireValue:f,nameOverride:s=f,prefix:u})=>{n.headers.push({name:f,value:u!=null?`${u} <${s}>`:`<${s}>`})},oAuth:f=>{Cco(f.value,"type")._visit({clientCredentials:s=>{Cco(s.value,"type")._visit({referencedEndpoint:()=>{n.headers.push({name:s.value.headerName||"Authorization",value:`${s.value.tokenPrefix?`${s.value.tokenPrefix??"Bearer"} `:""}<token>.`})}})}})}}),o!=null&&n.headers.push({name:"Content-Type",value:o}),n}var hsE=[{targetId:"python",clientId:"requests"},{targetId:"javascript",clientId:"fetch"},{targetId:"go",clientId:"native"},{targetId:"ruby",clientId:"native"},{targetId:"java",clientId:"unirest"},{targetId:"php",clientId:"guzzle"},{targetId:"csharp",clientId:"restsharp"},{targetId:"swift",clientId:"nsurlsession"}];async function ysE(e,t,r){return{...e,endpoints:await Promise.all(Object.entries(e.endpoints).map(async([i,n])=>{let a={};try{t&&(a=vsE({endpoint:n,dynamicIr:t}))}catch(o){console.log("[backfill] error creating dynamic snippet generators:",o)}return[i,{...n,examples:await Promise.all(n.examples?.map(o=>bsE(e,a,n,o,r))??[])}]})).then(i=>Object.fromEntries(i))}}async function bsE(e,t,r,i,{httpSnippets:n,alwaysEnableJavaScriptFetch:a}){let o={...i.snippets},c=l=>{(o[l.language]??=[]).push(l)},f=n!==!1,s=Array.isArray(n)?n:null,u=l=>f?s==null||s.includes(l):l==="curl";if(!o.curl?.length&&u("curl")){let l=r.auth?.[0],p=dTs(pTs(r,i,l!=null?e.auths[l]:void 0));c({name:void 0,language:"curl",install:void 0,code:p,generated:!0,description:void 0})}o.curl?.length&&!u("curl")&&delete o.curl;for(let[l,p]of Object.entries(t))if(!(!p||r.method==="HEAD"))try{let _,h=r.auth?.[0];if(h){let O=e.auths[h];O?.type==="bearerAuth"?_={type:"bearer",token:"YOUR_TOKEN_HERE"}:_=O}let y;i.requestBody!=null&&i.requestBody.type==="json"&&i.requestBody.value&&(typeof i.requestBody.value=="object"&&!Array.isArray(i.requestBody.value)?y=Object.fromEntries(Object.entries(i.requestBody.value).filter(([A,g])=>Array.isArray(g)||typeof g!="object"||g==null?!0:Object.keys(g).length>0)):y=i.requestBody.value);let b={baseURL:r?.environments?.find(O=>O.id===r.defaultEnvironment)?.baseUrl??r?.environments?.[0]?.baseUrl,auth:_,pathParameters:i.pathParameters,queryParameters:i.queryParameters,headers:i.headers,requestBody:y,method:r.method},v;try{v=p.generateSync(b)}catch(O){console.error("Failed to generate snippet:",O);continue}v?.snippet&&c({name:void 0,language:l,install:void 0,code:v.snippet,generated:!0,description:void 0})}catch(_){console.error(`Error generating ${l} snippet:`,_)}if(f){let l=new kso(_sE(r,i,e.auths,i.requestBody));for(let{clientId:p,targetId:_}of hsE){if(o[_]?.length||t[_==="javascript"?"typescript":_]||_==="javascript"&&o.typescript?.length&&!a||!u(_))continue;let h=await l.convert(_,p),y=typeof h=="string"?h:h?.[0];y!=null&&c({name:void 0,language:_,install:void 0,code:y,generated:!0,description:void 0})}}return{...i,snippets:o}}function vsE({endpoint:e,dynamicIr:t}){if(e.method==="HEAD")return{};let r=[],i={};t.typescript&&r.push({language:"typescript",ir:t.typescript}),t.python&&r.push({language:"python",ir:t.python}),t.java&&r.push({language:"java",ir:t.java}),t.ruby&&r.push({language:"ruby",ir:t.ruby}),t.swift&&r.push({language:"swift",ir:t.swift}),t.csharp&&r.push({language:"csharp",ir:t.csharp}),t.go&&r.push({language:"go",ir:t.go}),t.php&&r.push({language:"php",ir:t.php});let n=new psE({snippetInputs:r}),a=`${e.method} ${e.path.map(o=>o.type==="pathParameter"?`{${o.value}}`:o.value).join("")}`;if(t.typescript){let o=n.sdk("typescript");i.typescript=o?.endpoint(a)}if(t.python){let o=n.sdk("python");i.python=o?.endpoint(a)}if(t.java){let o=n.sdk("java");i.java=o?.endpoint(a)}if(t.ruby){let o=n.sdk("ruby");i.ruby=o?.endpoint(a)}if(t.swift){let o=n.sdk("swift");i.swift=o?.endpoint(a)}if(t.csharp){let o=n.sdk("csharp");i.csharp=o?.endpoint(a)}if(t.go){let o=n.sdk("go");i.go=o?.endpoint(a)}if(t.php){let o=n.sdk("php");i.php=o?.endpoint(a)}return i}var gsE=class Gco{static with(t){return new Gco({EndpointDefinition:t.EndpointDefinition??Lm,HttpRequest:t.HttpRequest??Lm,HttpResponse:t.HttpResponse??Lm,ErrorResponse:t.ErrorResponse??Lm,ExampleEndpointCall:t.ExampleEndpointCall??Lm,CodeSnippet:t.CodeSnippet??Lm,ErrorExample:t.ErrorExample??Lm,WebhookDefinition:t.WebhookDefinition??Lm,WebhookPayload:t.WebhookPayload??Lm,WebSocketChannel:t.WebSocketChannel??Lm,WebSocketMessage:t.WebSocketMessage??Lm,ExampleWebSocketSession:t.ExampleWebSocketSession??Lm,TypeDefinition:t.TypeDefinition??Lm,TypeShape:t.TypeShape??Lm,ObjectType:t.ObjectType??Lm,ObjectProperty:t.ObjectProperty??Lm,EnumValue:t.EnumValue??Lm,UndiscriminatedUnionVariant:t.UndiscriminatedUnionVariant??Lm,DiscriminatedUnionVariant:t.DiscriminatedUnionVariant??Lm,FormDataRequest:t.FormDataRequest??Lm,FormDataField:t.FormDataField??Lm,FormDataFile:t.FormDataFile??Lm,FormDataFiles:t.FormDataFiles??Lm})}static descriptions(t){function r(i,n){let a=i.description!=null?t(i.description,n):void 0;return{...i,description:a}}return Gco.with({EndpointDefinition:r,HttpRequest:r,HttpResponse:r,ErrorResponse:r,ExampleEndpointCall:r,CodeSnippet:r,ErrorExample:r,WebhookDefinition:r,WebhookPayload:r,WebSocketChannel:r,WebSocketMessage:r,ExampleWebSocketSession:r,TypeDefinition:r,ObjectProperty:r,EnumValue:r,UndiscriminatedUnionVariant:r,DiscriminatedUnionVariant:r,FormDataRequest:r,FormDataField:r,FormDataFile:r,FormDataFiles:r})}static keys(t){function r(i,n){return t(n),i}return Gco.with({EndpointDefinition:r,HttpRequest:r,HttpResponse:r,ErrorResponse:r,ExampleEndpointCall:r,CodeSnippet:r,ErrorExample:r,WebhookDefinition:r,WebhookPayload:r,WebSocketChannel:r,WebSocketMessage:r,ExampleWebSocketSession:r,TypeDefinition:r,TypeShape:r,ObjectType:r,ObjectProperty:r,EnumValue:r,UndiscriminatedUnionVariant:r,DiscriminatedUnionVariant:r,FormDataRequest:r,FormDataField:r,FormDataFile:r,FormDataFiles:r})}visitor;constructor(t){this.visitor=this.#e(t)}apiDefinition=t=>{let r=Object.entries(t.endpoints).map(([c,f])=>[c,this.visitor.EndpointDefinition(f,`${t.id}/endpoint/${c}`)]),i=Object.entries(t.websockets).map(([c,f])=>[c,this.visitor.WebSocketChannel(f,`${t.id}/websocket/${c}`)]),n=Object.entries(t.webhooks).map(([c,f])=>[c,this.visitor.WebhookDefinition(f,`${t.id}/webhoook/${c}`)]),a=Object.entries(t.types).map(([c,f])=>[c,this.visitor.TypeDefinition(f,`${t.id}/type-definition/${c}`)]),o=t.globalHeaders?.map(c=>this.visitor.ObjectProperty(c,`${t.id}/global-headers/${c.key}`))??[];return{id:t.id,endpoints:Object.fromEntries(r),websockets:Object.fromEntries(i),webhooks:Object.fromEntries(n),types:Object.fromEntries(a),globalHeaders:o,auths:t.auths,subpackages:t.subpackages,snippetsConfiguration:t.snippetsConfiguration}};#e=t=>({CodeSnippet:t.CodeSnippet,ErrorExample:t.ErrorExample,ExampleWebSocketSession:t.ExampleWebSocketSession,ObjectProperty:t.ObjectProperty,EnumValue:t.EnumValue,UndiscriminatedUnionVariant:t.UndiscriminatedUnionVariant,FormDataFile:t.FormDataFile,FormDataFiles:t.FormDataFiles,EndpointDefinition:(i,n)=>t.EndpointDefinition(this.endpoint(i,n),n),HttpRequest:(i,n)=>t.HttpRequest(this.httpRequest(i,n),n),HttpResponse:(i,n)=>t.HttpResponse(this.httpResponse(i,n),n),ErrorResponse:(i,n)=>t.ErrorResponse(this.errorResponse(i,n),n),ExampleEndpointCall:(i,n)=>t.ExampleEndpointCall(this.exampleEndpointCall(i,n),n),WebhookDefinition:(i,n)=>t.WebhookDefinition(this.webhookDefinition(i,n),n),WebhookPayload:(i,n)=>t.WebhookPayload(this.webhookPayload(i,n),n),WebSocketChannel:(i,n)=>t.WebSocketChannel(this.webSocketChannel(i,n),n),WebSocketMessage:(i,n)=>t.WebSocketMessage(this.webSocketMessage(i,n),n),TypeDefinition:(i,n)=>t.TypeDefinition(this.typeDefinition(i,n),n),TypeShape:(i,n)=>t.TypeShape(this.typeShape(i,n),n),ObjectType:(i,n)=>t.ObjectType(this.objectType(i,n),n),DiscriminatedUnionVariant:(i,n)=>t.DiscriminatedUnionVariant(this.objectType(i,n),n),FormDataRequest:(i,n)=>t.FormDataRequest(this.formDataRequest(i,n),n),FormDataField:(i,n)=>t.FormDataField(this.formDataField(i,n),n)});endpoint=(t,r)=>{let i=t.pathParameters?.map(l=>({...this.visitor.ObjectProperty(l,`${r}/path/${l.key}`),explode:l.explode}))??[],n=t.queryParameters?.map(l=>({...this.visitor.ObjectProperty(l,`${r}/query/${l.key}`),explode:l.explode}))??[],a=t.requestHeaders?.map(l=>this.visitor.ObjectProperty(l,`${r}/requestHeader/${l.key}`))??[],o=t.responseHeaders?.map(l=>this.visitor.ObjectProperty(l,`${r}/responseHeader/${l.key}`))??[],c=t.requests?.map((l,p)=>this.visitor.HttpRequest(l,`${r}/request/${p}`)),f=t.responses?.map((l,p)=>this.visitor.HttpResponse(l,`${r}/response/${p}/${l.statusCode}`)),s=t.errors?.map((l,p)=>this.visitor.ErrorResponse(l,`${r}/error/${p}/${l.statusCode}`))??[],u=t.examples?.map((l,p)=>this.visitor.ExampleEndpointCall(l,`${r}/example/${p}`))??[];return{...t,pathParameters:i.length>0?i:void 0,queryParameters:n.length>0?n:void 0,requestHeaders:a.length>0?a:void 0,responseHeaders:o.length>0?o:void 0,requests:c,responses:f,errors:s.length>0?s:void 0,examples:u.length>0?u:void 0}};httpRequest=(t,r)=>{let i=jf(t.body)._visit({object:n=>({...n,...this.visitor.ObjectType(n,`${r}/object`)}),alias:Lm,bytes:Lm,formData:n=>({...n,...this.visitor.FormDataRequest(n,`${r}/formdata`)})});return{...t,body:i}};formDataField=(t,r)=>jf(t)._visit({file:i=>({...i,...this.visitor.FormDataFile(i,`${r}/file/${i.key}`)}),files:i=>({...i,...this.visitor.FormDataFiles(i,`${r}/files/${i.key}`)}),property:i=>({...i,...this.visitor.ObjectProperty(i,`${r}/property/${i.key}`)})});httpResponse=(t,r)=>{let i=jf(t.body)._visit({object:n=>({...n,...this.visitor.ObjectType(n,`${r}/object`)}),alias:Lm,fileDownload:Lm,streamingText:Lm,stream:n=>({...n,shape:this.visitor.TypeShape(n.shape,`${r}/stream/shape`)}),empty:Lm});return{...t,body:i}};objectType=(t,r)=>{let i=t.properties.map(n=>this.visitor.ObjectProperty(n,`${r}/property/${n.key}`));return{...t,properties:i}};errorResponse=(t,r)=>{let i=t.shape?this.visitor.TypeShape(t.shape,`${r}/error/shape`):void 0,n=t.examples?.map((a,o)=>this.visitor.ErrorExample(a,`${r}/example/${o}`))??[];return{...t,shape:i,examples:n.length>0?n:void 0}};exampleEndpointCall=(t,r)=>{let i=Object.entries(t.snippets??{}).map(([a,o])=>[a,o.map((c,f)=>this.visitor.CodeSnippet(c,`${r}/snippet/${a}/${f}`))]).filter(([,a])=>a.length>0),n=Object.fromEntries(i);return{...t,snippets:i.length>0?n:void 0}};webhookDefinition=(t,r)=>{let i=t.payloads?.[0]!=null?this.visitor.WebhookPayload(t.payloads[0],`${r}/payload`):void 0,n=t.headers?.map(o=>this.visitor.ObjectProperty(o,`${r}/header/${o.key}`))??[],a=t.responses?.map((o,c)=>this.visitor.HttpResponse(o,`${r}/response/${c}/${o.statusCode}`));return{...t,payloads:i!=null?[i]:void 0,headers:n.length>0?n:void 0,responses:a}};webhookPayload=(t,r)=>{let i=this.visitor.TypeShape(t.shape,`${r}/shape`);return{...t,shape:i}};webSocketChannel=(t,r)=>{let i=t.pathParameters?.map(f=>({...this.visitor.ObjectProperty(f,`${r}/path/${f.key}`),explode:f.explode}))??[],n=t.queryParameters?.map(f=>({...this.visitor.ObjectProperty(f,`${r}/query/${f.key}`),explode:f.explode}))??[],a=t.requestHeaders?.map(f=>this.visitor.ObjectProperty(f,`${r}/requestHeader/${f.key}`))??[],o=t.messages.map(f=>this.visitor.WebSocketMessage(f,`${r}/message/${f.origin}/${f.type}`)),c=t.examples?.map((f,s)=>this.visitor.ExampleWebSocketSession(f,`${r}/example/${s}`))??[];return{...t,pathParameters:i.length>0?i:void 0,queryParameters:n.length>0?n:void 0,requestHeaders:a.length>0?a:void 0,messages:o,examples:c.length>0?c:void 0}};webSocketMessage=(t,r)=>{let i=this.visitor.TypeShape(t.body,`${r}/body`);return{...t,body:i}};typeShape=(t,r)=>jf(t)._visit({object:i=>({...i,...this.visitor.ObjectType(i,`${r}/object`)}),alias:Lm,enum:i=>({...i,values:i.values.map(n=>this.visitor.EnumValue(n,`${r}/enum/value/${n.value}`))}),undiscriminatedUnion:i=>({...i,variants:i.variants.map((n,a)=>this.visitor.UndiscriminatedUnionVariant(n,`${r}/undiscriminatedUnion/variant/${a}`))}),discriminatedUnion:i=>({...i,variants:i.variants.map(n=>this.visitor.DiscriminatedUnionVariant(n,`${r}/discriminatedUnion/variant/${n.discriminantValue}`))})});formDataRequest=(t,r)=>({...t,fields:t.fields.map(i=>this.visitor.FormDataField(i,`${r}/field/${i.key}`))});typeDefinition=(t,r)=>({...t,shape:this.visitor.TypeShape(t.shape,`${r}/shape`)})},x9i={};Di(x9i,{latest:()=>l9d,v1:()=>Utp});var Utp={};Di(Utp,{SubpackageId:()=>OIn,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,commons:()=>h9d,db:()=>Ltp,read:()=>O9d,register:()=>Wtp});var Ltp={};Di(Ltp,{endpoint:()=>Vtp});var Vtp={},Wtp={};Di(Wtp,{ObjectPropertyAccess:()=>Qzs,SourceId:()=>Ktp,endpoint:()=>xtp,registerApiDefinition:()=>Nzs,type_:()=>Fzs,webhook:()=>Gtp,websocket:()=>Htp});var Nzs={};Di(Nzs,{Error:()=>OsE});var OsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);default:return t._other(e.content)}}},xtp={},Fzs={};Di(Fzs,{ObjectPropertyAccess:()=>Qzs});var Qzs={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY"},Gtp={},Htp={};function Ktp(e){return e}var Uzs={};Di(Uzs,{getDocsSitesForOrg:()=>Jtp});var Jtp={};Di(Jtp,{Error:()=>AsE});var AsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);default:return t._other(e.content)}}},Lzs={};Di(Lzs,{diff:()=>$tp});var $tp={};Di($tp,{Error:()=>msE});var msE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Vw={};Di(Vw,{latest:()=>Ytp,v1:()=>Ztp,v2:()=>nrp});var Ytp={};Di(Ytp,{Layout:()=>Wzs,TwitterCardSetting:()=>Gzs,commons:()=>Xtp,frontmatter:()=>Vzs,seo:()=>xzs});var Xtp={},Vzs={};Di(Vzs,{Layout:()=>Wzs});var Wzs={Guide:"guide",Overview:"overview",Reference:"reference",Page:"page",Custom:"custom"},xzs={};Di(xzs,{TwitterCardSetting:()=>Gzs});var Gzs={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"},Ztp={};Di(Ztp,{commons:()=>ktp,db:()=>PsE,read:()=>erp,write:()=>trp});var ktp={};Di(ktp,{AiChatLocation:()=>yya,AiModel:()=>bya,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,HeaderPosition:()=>Eya,HttpSnippetLanguage:()=>Sya,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,PageActionOption:()=>Iya,ProgrammingLanguage:()=>Cya,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TwitterCardSetting:()=>Rya,commons:()=>hya});var hya={};Di(hya,{AiChatLocation:()=>yya,AiModel:()=>bya,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,HeaderPosition:()=>Eya,HttpSnippetLanguage:()=>Sya,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,PageActionOption:()=>Iya,ProgrammingLanguage:()=>Cya,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TwitterCardSetting:()=>Rya});var yya={Docs:"docs",Slack:"slack",Discord:"discord"},bya={Claude35:"claude-3.5",Claude37:"claude-3.7",Claude4:"claude-4",CommandA:"command-a"},vya={Center:"CENTER",Left:"LEFT"},gya={Default:"default",Canvas:"canvas"},Oya={Default:"default",Toolbar:"toolbar"},Aya={Default:"default",Minimal:"minimal"},mya={Default:"default",Bubble:"bubble"},Pya={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"},jya={Normal:"normal",Italic:"italic"},wya={Default:"default",Minimal:"minimal"},Eya={Fixed:"FIXED",Absolute:"ABSOLUTE"},Sya={Curl:"curl",Csharp:"csharp",Go:"go",Java:"java",Javascript:"javascript",Php:"php",Python:"python",Ruby:"ruby",Swift:"swift",Rust:"rust",Typescript:"typescript"},Mya={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"},Dya={En:"en",Es:"es",Fr:"fr",De:"de",It:"it",Pt:"pt",Ja:"ja",Zh:"zh",Ko:"ko",El:"el",No:"no",Pl:"pl",Ru:"ru",Sv:"sv",Tr:"tr"},Bya={Default:"default",Minimal:"minimal"},Iya={CopyPage:"copyPage",ViewAsMarkdown:"viewAsMarkdown",AskAi:"askAi",OpenAi:"openAi",Claude:"claude",Cursor:"cursor",Vscode:"vscode"},Cya={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"},qya={Header:"HEADER",HeaderTabs:"HEADER_TABS",Sidebar:"SIDEBAR"},Tya={Header:"HEADER",Sidebar:"SIDEBAR"},Rya={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"},PsE={},erp={};Di(erp,{getDocsForDomain:()=>Hzs,getDocsForDomainLegacy:()=>Kzs});var Hzs={};Di(Hzs,{Error:()=>jsE});var jsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},Kzs={};Di(Kzs,{Error:()=>wsE});var wsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},trp={};Di(trp,{DocsRegistrationId:()=>rrp,FilePath:()=>irp,finishDocsRegister:()=>Jzs,startDocsRegister:()=>$zs});var Jzs={};Di(Jzs,{Error:()=>EsE});var EsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),docsRegistrationIdNotFound:()=>({error:"DocsRegistrationIdNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"DocsRegistrationIdNotFound":return t.docsRegistrationIdNotFound();default:return t._other(e.content)}}},$zs={};Di($zs,{Error:()=>SsE});var SsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};function rrp(e){return e}function irp(e){return e}var nrp={};Di(nrp,{read:()=>arp,write:()=>hrp});var arp={};Di(arp,{DocsDefinitionField:()=>NsE,ensureDocsInS3:()=>orp,getDocsConfigById:()=>urp,getDocsFields:()=>srp,getDocsForUrl:()=>crp,getDocsUrlMetadata:()=>lrp,getOrganizationForUrl:()=>frp,getPrivateDocsForUrl:()=>drp,listAllDocsUrls:()=>prp,prepopulateFdrReadS3Bucket:()=>_rp});var orp={};Di(orp,{Error:()=>MsE});var MsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},urp={};Di(urp,{Error:()=>DsE});var DsE={docsDefinitionNotFoundError:()=>({error:"DocsDefinitionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsDefinitionNotFoundError":return t.docsDefinitionNotFoundError();default:return t._other(e.content)}}},srp={};Di(srp,{Error:()=>BsE});var BsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},crp={};Di(crp,{Error:()=>IsE});var IsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},lrp={};Di(lrp,{Error:()=>CsE});var CsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},frp={};Di(frp,{Error:()=>qsE});var qsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},drp={};Di(drp,{Error:()=>TsE});var TsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},prp={};Di(prp,{Error:()=>RsE});var RsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},_rp={};Di(_rp,{Error:()=>zsE});var zsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},NsE={BaseUrl:"BASE_URL",FilesV2:"FILES_V2",ApisV2:"APIS_V2",Apis:"APIS",Pages:"PAGES",JsFiles:"JS_FILES",Config:"CONFIG",Root:"ROOT"},hrp={};Di(hrp,{addAlgoliaPreviewWhitelistEntry:()=>yrp,deleteDocsSite:()=>brp,finishDocsRegister:()=>vrp,listAlgoliaPreviewWhitelist:()=>grp,removeAlgoliaPreviewWhitelistEntry:()=>Orp,setDocsUrlMetadata:()=>Arp,setIsArchived:()=>mrp,startDocsPreviewRegister:()=>Prp,startDocsRegister:()=>jrp,transferOwnershipOfDomain:()=>wrp});var yrp={};Di(yrp,{Error:()=>FsE});var FsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},brp={};Di(brp,{Error:()=>QsE});var QsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},vrp={};Di(vrp,{Error:()=>UsE});var UsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),docsRegistrationIdNotFound:()=>({error:"DocsRegistrationIdNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"DocsRegistrationIdNotFound":return t.docsRegistrationIdNotFound();default:return t._other(e.content)}}},grp={};Di(grp,{Error:()=>LsE});var LsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Orp={};Di(Orp,{Error:()=>VsE});var VsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Arp={};Di(Arp,{Error:()=>WsE});var WsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},mrp={};Di(mrp,{Error:()=>xsE});var xsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Prp={};Di(Prp,{Error:()=>GsE});var GsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),invalidDomainError:()=>({error:"InvalidDomainError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"InvalidDomainError":return t.invalidDomainError();default:return t._other(e.content)}}},jrp={};Di(jrp,{Error:()=>HsE});var HsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),invalidDomainError:()=>({error:"InvalidDomainError"}),invalidCustomDomainError:()=>({error:"InvalidCustomDomainError"}),domainBelongsToAnotherOrgError:e=>({content:e,error:"DomainBelongsToAnotherOrgError"}),invalidUrlError:e=>({content:e,error:"InvalidURLError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"InvalidDomainError":return t.invalidDomainError();case"InvalidCustomDomainError":return t.invalidCustomDomainError();case"DomainBelongsToAnotherOrgError":return t.domainBelongsToAnotherOrgError(e.content);case"InvalidURLError":return t.invalidUrlError(e.content);default:return t._other(e.content)}}},wrp={};Di(wrp,{Error:()=>KsE});var KsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Yzs={};Di(Yzs,{invalidate:()=>Erp});var Erp={};Di(Erp,{Error:()=>JsE});var JsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},aQ={};Di(aQ,{ChangelogEntryType:()=>Qrp,GeneratorId:()=>lcE,GeneratorLanguage:()=>fcE,ReleaseType:()=>Urp,cli:()=>Irp,commons:()=>Frp,getGenerator:()=>Srp,getGeneratorByImage:()=>Mrp,listGenerators:()=>Drp,upsertGenerator:()=>Brp,versions:()=>Lrp});var Srp={};Di(Srp,{Error:()=>$sE});var $sE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Mrp={};Di(Mrp,{Error:()=>YsE});var YsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Drp={};Di(Drp,{Error:()=>XsE});var XsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Brp={};Di(Brp,{Error:()=>ZsE});var ZsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Irp={};Di(Irp,{getChangelog:()=>Crp,getCliRelease:()=>qrp,getLatestCliRelease:()=>Trp,getMinCliForIr:()=>Rrp,listCliReleases:()=>zrp,upsertCliRelease:()=>Nrp});var Crp={};Di(Crp,{Error:()=>ksE});var ksE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},qrp={};Di(qrp,{Error:()=>ecE});var ecE={cliVersionNotFoundError:e=>({content:e,error:"CliVersionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"CliVersionNotFoundError":return t.cliVersionNotFoundError(e.content);default:return t._other(e.content)}}},Trp={};Di(Trp,{Error:()=>tcE});var tcE={noValidClisFoundError:()=>({error:"NoValidClisFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidClisFoundError":return t.noValidClisFoundError();default:return t._other(e.content)}}},Rrp={};Di(Rrp,{Error:()=>rcE});var rcE={noValidClisFoundError:()=>({error:"NoValidClisFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidClisFoundError":return t.noValidClisFoundError();default:return t._other(e.content)}}},zrp={};Di(zrp,{Error:()=>icE});var icE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Nrp={};Di(Nrp,{Error:()=>ncE});var ncE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Frp={};Di(Frp,{ChangelogEntryType:()=>Qrp,ReleaseType:()=>Urp});var Qrp={Fix:"fix",Feat:"feat",Chore:"chore",Break:"break",Internal:"internal"},Urp={Ga:"GA",Rc:"RC"},Lrp={};Di(Lrp,{getChangelog:()=>Vrp,getGeneratorRelease:()=>Wrp,getLatestGeneratorRelease:()=>xrp,listGeneratorReleases:()=>Grp,upsertGeneratorRelease:()=>Hrp});var Vrp={};Di(Vrp,{Error:()=>acE});var acE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Wrp={};Di(Wrp,{Error:()=>ocE});var ocE={generatorVersionNotFoundError:e=>({content:e,error:"GeneratorVersionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"GeneratorVersionNotFoundError":return t.generatorVersionNotFoundError(e.content);default:return t._other(e.content)}}},xrp={};Di(xrp,{Error:()=>ucE});var ucE={noValidGeneratorsFoundError:()=>({error:"NoValidGeneratorsFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidGeneratorsFoundError":return t.noValidGeneratorsFoundError();default:return t._other(e.content)}}},Grp={};Di(Grp,{Error:()=>scE});var scE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Hrp={};Di(Hrp,{Error:()=>ccE});var ccE={invalidVersionError:e=>({content:e,error:"InvalidVersionError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"InvalidVersionError":return t.invalidVersionError(e.content);default:return t._other(e.content)}}};function lcE(e){return e}var fcE={Python:"python",Go:"go",Java:"java",Typescript:"typescript",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust"},nVt={};Di(nVt,{PullRequestState:()=>tip,deletePullRequest:()=>Krp,deleteRepository:()=>Jrp,getPullRequest:()=>$rp,getRepository:()=>Yrp,listPullRequests:()=>Xrp,listRepositories:()=>Zrp,upsertPullRequest:()=>krp,upsertRepository:()=>eip});var Krp={};Di(Krp,{Error:()=>dcE});var dcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Jrp={};Di(Jrp,{Error:()=>pcE});var pcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},$rp={};Di($rp,{Error:()=>_cE});var _cE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Yrp={};Di(Yrp,{Error:()=>hcE});var hcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Xrp={};Di(Xrp,{Error:()=>ycE});var ycE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Zrp={};Di(Zrp,{Error:()=>bcE});var bcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},krp={};Di(krp,{Error:()=>vcE});var vcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},eip={};Di(eip,{Error:()=>gcE});var gcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},tip={Open:"open",Closed:"closed",Merged:"merged"},rip={};Di(rip,{latest:()=>iip,v1:()=>cip});var iip={};Di(iip,{NodeId:()=>nip,ProductId:()=>aip,Slug:()=>oip,TabId:()=>uip,VariantId:()=>sip});function nip(e){return e}function aip(e){return e}function oip(e){return e}function uip(e){return e}function sip(e){return e}var cip={};Di(cip,{NavigationV1Availability:()=>lip,NodeId:()=>fip,ProductId:()=>dip,Slug:()=>pip,TabId:()=>_ip,VariantId:()=>hip});var lip={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Beta:"beta",Deprecated:"deprecated"};function fip(e){return e}function dip(e){return e}function pip(e){return e}function _ip(e){return e}function hip(e){return e}var Xzs={};Di(Xzs,{Language:()=>vip,VersionBump:()=>gip,versions:()=>yip});var yip={};Di(yip,{Language:()=>vip,VersionBump:()=>gip,computeSemanticVersion:()=>bip});var bip={};Di(bip,{Error:()=>OcE});var OcE={failedToComputeExistingVersion:()=>({error:"FailedToComputeExistingVersion"}),failedToIncrementVersion:()=>({error:"FailedToIncrementVersion"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"FailedToComputeExistingVersion":return t.failedToComputeExistingVersion();case"FailedToIncrementVersion":return t.failedToIncrementVersion();default:return t._other(e.content)}}},vip={Go:"Go",TypeScript:"TypeScript",Java:"Java",Python:"Python",Csharp:"Csharp",Ruby:"Ruby",Php:"Php",Swift:"Swift",Rust:"Rust"},gip={Major:"MAJOR",Minor:"MINOR",Patch:"PATCH"},Qlo={};Di(Qlo,{get:()=>Oip,load:()=>Aip});var Oip={};Di(Oip,{Error:()=>AcE});var AcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),apiIdRequiredError:e=>({content:e,error:"ApiIdRequiredError"}),orgIdRequiredError:e=>({content:e,error:"OrgIdRequiredError"}),orgIdAndApiIdNotFound:e=>({content:e,error:"OrgIdAndApiIdNotFound"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),endpointNotFound:e=>({content:e,error:"EndpointNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"ApiIdRequiredError":return t.apiIdRequiredError(e.content);case"OrgIdRequiredError":return t.orgIdRequiredError(e.content);case"OrgIdAndApiIdNotFound":return t.orgIdAndApiIdNotFound(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"EndpointNotFound":return t.endpointNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}},Aip={};Di(Aip,{Error:()=>mcE});var mcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),invalidPageError:e=>({content:e,error:"InvalidPageError"}),apiIdRequiredError:e=>({content:e,error:"ApiIdRequiredError"}),orgIdRequiredError:e=>({content:e,error:"OrgIdRequiredError"}),orgIdAndApiIdNotFound:e=>({content:e,error:"OrgIdAndApiIdNotFound"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"InvalidPageError":return t.invalidPageError(e.content);case"ApiIdRequiredError":return t.apiIdRequiredError(e.content);case"OrgIdRequiredError":return t.orgIdRequiredError(e.content);case"OrgIdAndApiIdNotFound":return t.orgIdAndApiIdNotFound(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}};var Zzs={};Di(Zzs,{createSnippetsForSdk:()=>mip});var mip={};Di(mip,{Error:()=>PcE});var PcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}},bha={};Di(bha,{PayloadLocation:()=>Eip,get:()=>Pip,register:()=>jip,registerBatch:()=>wip});var Pip={};Di(Pip,{Error:()=>jcE});var jcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),snippetNotFound:e=>({content:e,error:"SnippetNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"SnippetNotFound":return t.snippetNotFound(e.content);default:return t._other(e.content)}}},jip={};Di(jip,{Error:()=>wcE});var wcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},wip={};Di(wip,{Error:()=>EcE});var EcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Eip={Body:"BODY",Query:"QUERY",Path:"PATH",Headers:"HEADERS",Relative:"RELATIVE",Auth:"AUTH"},Ulo={};Di(Ulo,{generate:()=>Sip,revoke:()=>Mip});var Sip={};Di(Sip,{Error:()=>ScE});var ScE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Mip={};Di(Mip,{Error:()=>McE});var McE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};function Ru(...e){let t={};for(let[r,i]of e.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=r.toLowerCase();i!=null?t[n]=i:n in t&&delete t[n]}return t}function Ec(...e){let t={};for(let[r,i]of e.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=r.toLowerCase();i!=null&&(t[n]=i)}return t}var DcE={get:async(e,t)=>typeof e=="function"?e(t):e},z1s=(e,t,r)=>JSON.stringify(e,t,r);function N1s(e,t){return JSON.parse(e,t)}var Izt={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},H6d={[Izt.Debug]:1,[Izt.Info]:2,[Izt.Warn]:3,[Izt.Error]:4},kzs=class{debug(e,...t){console.debug(e,...t)}info(e,...t){console.info(e,...t)}warn(e,...t){console.warn(e,...t)}error(e,...t){console.error(e,...t)}},Llo=class{level;logger;silent;constructor(e){this.level=H6d[e.level],this.logger=e.logger,this.silent=e.silent}shouldLog(e){return!this.silent&&this.level<=H6d[e]}isDebug(){return this.shouldLog(Izt.Debug)}debug(e,...t){this.isDebug()&&this.logger.debug(e,...t)}isInfo(){return this.shouldLog(Izt.Info)}info(e,...t){this.isInfo()&&this.logger.info(e,...t)}isWarn(){return this.shouldLog(Izt.Warn)}warn(e,...t){this.isWarn()&&this.logger.warn(e,...t)}isError(){return this.shouldLog(Izt.Error)}error(e,...t){this.isError()&&this.logger.error(e,...t)}};function Dip(e){return e==null?BcE:e instanceof Llo?e:(e=e??{},e.level??=Izt.Info,e.logger??=new kzs,e.silent??=!0,new Llo(e))}var BcE=new Llo({level:Izt.Info,logger:new kzs,silent:!0}),IcE={arrayFormat:"indices",encode:!0};function K6d(e,t){if(e===void 0||e===null)return"";let r=String(e);return t?encodeURIComponent(r):r}function F1s(e,t="",r){let i=[];for(let[n,a]of Object.entries(e)){let o=t?`${t}[${n}]`:n;if(a!==void 0)if(Array.isArray(a)){if(a.length===0)continue;for(let c=0;c<a.length;c++){let f=a[c];if(f!==void 0)if(typeof f=="object"&&!Array.isArray(f)&&f!==null){let s=r.arrayFormat==="indices"?`${o}[${c}]`:o;i.push(...F1s(f,s,r))}else{let s=r.arrayFormat==="indices"?`${o}[${c}]`:o,u=r.encode?encodeURIComponent(s):s;i.push(`${u}=${K6d(f,r.encode)}`)}}}else if(typeof a=="object"&&a!==null){if(Object.keys(a).length===0)continue;i.push(...F1s(a,o,r))}else{let c=r.encode?encodeURIComponent(o):o;i.push(`${c}=${K6d(a,r.encode)}`)}}return i}function eNs(e,t){return e==null||typeof e!="object"?"":F1s(e,"",{...IcE,...t}).join("&")}function CcE(e,t){let r=eNs(t,{arrayFormat:"repeat"});return r?`${e}?${r}`:e}function qcE(e){let t={get bodyUsed(){return e.bodyUsed},stream:()=>e.body,arrayBuffer:e.arrayBuffer.bind(e),blob:e.blob.bind(e)};return"bytes"in e&&typeof e.bytes=="function"&&(t.bytes=e.bytes.bind(e)),t}function TcE(e){return e.body!=null}async function Bip(e,t){if(!TcE(e))return;switch(t){case"binary-response":return qcE(e);case"blob":return await e.blob();case"arrayBuffer":return await e.arrayBuffer();case"sse":return e.body;case"streaming":return e.body;case"text":return await e.text()}let r=await e.text();if(r.length>0)try{return N1s(r)}catch{return{ok:!1,error:{reason:"non-json",statusCode:e.status,rawBody:r}}}}async function RcE(e){let t=e.headers.get("Content-Type")?.toLowerCase();if(t==null||t.length===0)return Bip(e);switch(t.indexOf(";")!==-1&&(t=t.split(";")[0]?.trim()??""),t){case"application/hal+json":case"application/json":case"application/ld+json":case"application/problem+json":case"application/vnd.api+json":case"text/json":{let r=await e.text();return r.length>0?N1s(r):void 0}default:if(t.startsWith("application/vnd.")&&t.endsWith("+json")){let r=await e.text();return r.length>0?N1s(r):void 0}return await e.text()}}async function zcE(){return fetch}async function NcE({body:e,type:t}){return t==="form"?eNs(e,{arrayFormat:"repeat",encode:!0}):t.includes("json")?z1s(e):e}var bIn;typeof globalThis.Headers<"u"?bIn=globalThis.Headers:bIn=class Iip{headers;constructor(t){if(this.headers=new Map,t)if(t instanceof Iip)t.forEach((r,i)=>this.append(i,r));else if(Array.isArray(t))for(let[r,i]of t)if(typeof r=="string"&&typeof i=="string")this.append(r,i);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[r,i]of Object.entries(t))if(typeof i=="string")this.append(r,i);else throw new TypeError("Header values must be strings")}append(t,r){let i=t.toLowerCase(),n=this.headers.get(i)||[];this.headers.set(i,[...n,r])}delete(t){let r=t.toLowerCase();this.headers.delete(r)}get(t){let r=t.toLowerCase(),i=this.headers.get(r);return i?i.join(", "):null}has(t){let r=t.toLowerCase();return this.headers.has(r)}set(t,r){let i=t.toLowerCase();this.headers.set(i,[r])}forEach(t,r){let i=r?t.bind(r):t;this.headers.forEach((n,a)=>i(n.join(", "),a,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[t,r]of this.headers.entries())yield[t,r.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(let t of this.headers.values())yield t.join(", ")}[Symbol.iterator](){return this.entries()}};var FcE="timeout";function QcE(e){let t=new AbortController,r=setTimeout(()=>t.abort(FcE),e);return{signal:t.signal,abortId:r}}function UcE(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,r=new AbortController;for(let i of t){if(i.aborted){r.abort(i?.reason);break}i.addEventListener("abort",()=>r.abort(i?.reason),{signal:r.signal})}return r.signal}var LcE=async(e,t,r,i,n,a,o,c,f)=>{let s=[],u;if(a!=null){let{signal:_,abortId:h}=QcE(a);u=h,s.push(_)}o!=null&&s.push(o);let l=UcE(s),p=await e(t,{method:r,headers:i,body:n,signal:l,credentials:c?"include":void 0,duplex:f});return u!=null&&clearTimeout(u),p},J6d={headers:new bIn,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},$6d={headers:new bIn,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function Y6d(e){return{headers:e.headers,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url}}var VcE=1e3,Sco=6e4,WcE=2,Cip=.2;function xcE(e){let t=1+Math.random()*Cip;return e*t}function GcE(e){let t=1+(Math.random()-.5)*Cip;return e*t}function HcE(e,t){let r=e.headers.get("Retry-After");if(r){let n=parseInt(r,10);if(!Number.isNaN(n)&&n>0)return Math.min(n*1e3,Sco);let a=new Date(r);if(!Number.isNaN(a.getTime())){let o=a.getTime()-Date.now();if(o>0)return Math.min(Math.max(o,0),Sco)}}let i=e.headers.get("X-RateLimit-Reset");if(i){let n=parseInt(i,10);if(!Number.isNaN(n)){let a=n*1e3-Date.now();if(a>0)return xcE(Math.min(a,Sco))}}return GcE(Math.min(VcE*2**t,Sco))}async function KcE(e,t=WcE){let r=await e();for(let i=0;i<t&&([408,429].includes(r.status)||r.status>=500);++i){let n=HcE(r,i);await new Promise(a=>setTimeout(a,n)),r=await e()}return r}var JcE=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function tCs(e){let t={};for(let[r,i]of e instanceof bIn?e.entries():Object.entries(e))JcE.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=i;return t}var Q1s=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function $cE(e){if(e==null)return e;let t={};for(let[r,i]of Object.entries(e))Q1s.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=i;return t}function t9i(e){let t=e.indexOf("://");if(t===-1)return e;let r=t+3,i=e.indexOf("/",r),n=e.indexOf("?",r),a=e.indexOf("#",r),o=Math.min(i===-1?e.length:i,n===-1?e.length:n,a===-1?e.length:a),c=-1;for(let h=r;h<o;h++)e[h]==="@"&&(c=h);if(c!==-1&&(e=`${e.slice(0,r)}[REDACTED]@${e.slice(c+1)}`),n=e.indexOf("?"),n===-1)return e;a=e.indexOf("#",n);let f=a!==-1?a:e.length,s=e.slice(n+1,f);if(s.length===0)return e;let u=s.toLowerCase();if(!(u.includes("token")||u.includes("key")||u.includes("password")||u.includes("passwd")||u.includes("secret")||u.includes("session")||u.includes("auth")))return e;let p=[],_=s.split("&");for(let h of _){let y=h.indexOf("=");if(y===-1){p.push(h);continue}let b=h.slice(0,y),v=Q1s.has(b.toLowerCase());if(!v&&b.includes("%"))try{let O=decodeURIComponent(b);v=Q1s.has(O.toLowerCase())}catch{}p.push(v?`${b}=[REDACTED]`:h)}return e.slice(0,n+1)+p.join("&")+e.slice(f)}async function YcE(e){let t=new bIn;if(t.set("Accept",e.responseType==="json"?"application/json":e.responseType==="text"?"text/plain":"*/*"),e.body!==void 0&&e.contentType!=null&&t.set("Content-Type",e.contentType),e.headers==null)return t;for(let[r,i]of Object.entries(e.headers)){let n=await DcE.get(i,{endpointMetadata:e.endpointMetadata??{}});if(typeof n=="string"){t.set(r,n);continue}n!=null&&t.set(r,`${n}`)}return t}async function XcE(e){let t=CcE(e.url,e.queryParameters),r=await NcE({body:e.body,type:e.requestType??"other"}),i=e.fetchFn??await zcE(),n=await YcE(e),a=Dip(e.logging);if(a.isDebug()){let o={method:e.method,url:t9i(t),headers:tCs(n),queryParameters:$cE(e.queryParameters),hasBody:r!=null};a.debug("Making HTTP request",o)}try{let o=await KcE(async()=>LcE(i,t,e.method,n,r,e.timeoutMs,e.abortSignal,e.withCredentials,e.duplex),e.maxRetries);if(o.status>=200&&o.status<400){if(a.isDebug()){let c={method:e.method,url:t9i(t),statusCode:o.status,responseHeaders:tCs(o.headers)};a.debug("HTTP request succeeded",c)}return{ok:!0,body:await Bip(o,e.responseType),headers:o.headers,rawResponse:Y6d(o)}}else{if(a.isError()){let c={method:e.method,url:t9i(t),statusCode:o.status,responseHeaders:tCs(Object.fromEntries(o.headers.entries()))};a.error("HTTP request failed with error status",c)}return{ok:!1,error:{reason:"status-code",statusCode:o.status,body:await RcE(o)},rawResponse:Y6d(o)}}}catch(o){if(e.abortSignal?.aborted){if(a.isError()){let c={method:e.method,url:t9i(t)};a.error("HTTP request was aborted",c)}return{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:J6d}}else if(o instanceof Error&&o.name==="AbortError"){if(a.isError()){let c={method:e.method,url:t9i(t),timeoutMs:e.timeoutMs};a.error("HTTP request timed out",c)}return{ok:!1,error:{reason:"timeout"},rawResponse:J6d}}else if(o instanceof Error){if(a.isError()){let c={method:e.method,url:t9i(t),errorMessage:o.message};a.error("HTTP request failed with error",c)}return{ok:!1,error:{reason:"unknown",errorMessage:o.message},rawResponse:$6d}}if(a.isError()){let c={method:e.method,url:t9i(t),error:z1s(o)};a.error("HTTP request failed with unknown error",c)}return{ok:!1,error:{reason:"unknown",errorMessage:z1s(o)},rawResponse:$6d}}}var ku=XcE,es=class WBn extends Promise{innerPromise;unwrappedPromise;constructor(t){super(r=>{r(void 0)}),this.innerPromise=t}static fromFunction(t,...r){return new WBn(t(...r))}static interceptFunction(t){return(...r)=>WBn.fromPromise(t(...r))}static fromPromise(t){return new WBn(t)}static fromExecutor(t){let r=new Promise(t);return new WBn(r)}static fromResult(t){let r=Promise.resolve(t);return new WBn(r)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:t})=>t)),this.unwrappedPromise}then(t,r){return this.unwrap().then(t,r)}catch(t){return this.unwrap().catch(t)}finally(t){return this.unwrap().finally(t)}async withRawResponse(){return await this.innerPromise}},Jr={get:async e=>typeof e=="function"?e():e},qip={};Di(qip,{ConsoleLogger:()=>kzs,LogLevel:()=>Izt,Logger:()=>Llo,createLogger:()=>Dip});var X6d=ZcE();function ZcE(){return typeof window<"u"&&typeof window.document<"u"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis<"u"&&globalThis?.navigator?.userAgent==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof self?.importScripts=="function"&&(self.constructor?.name==="DedicatedWorkerGlobalScope"||self.constructor?.name==="ServiceWorkerGlobalScope"||self.constructor?.name==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u"?{type:"deno",version:Deno.version.deno}:typeof Bun<"u"&&typeof Bun.version<"u"?{type:"bun",version:Bun.version}:typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!process.versions?.node?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:typeof navigator<"u"&&navigator?.product==="ReactNative"?{type:"react-native"}:{type:"unknown"}}var On={};Di(On,{encodePathParam:()=>kcE,join:()=>elE,toQueryString:()=>eNs});function kcE(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:e=String(e);break}return encodeURIComponent(e)}function elE(e,...t){if(!e)return"";if(t.length===0)return e;if(e.includes("://")){let r;try{r=new URL(e)}catch{return Z6d(e,...t)}let n=t[t.length-1]?.endsWith("/");for(let a of t){let o=Rip(a);o&&(r.pathname=Tip(r.pathname,o))}return n&&!r.pathname.endsWith("/")&&(r.pathname+="/"),r.toString()}return Z6d(e,...t)}function Z6d(e,...t){if(t.length===0)return e;let r=e,n=t[t.length-1]?.endsWith("/");for(let a of t){let o=Rip(a);o&&(r=Tip(r,o))}return n&&!r.endsWith("/")&&(r+="/"),r}function Tip(e,t){return e.endsWith("/")?e+t:`${e}/${t}`}function Rip(e){if(!e)return e;let t=0,r=e.length;return e.startsWith("/")&&(t=1),e.endsWith("/")&&(r=e.length-1),t===0&&r===e.length?e:e.slice(t,r)}function vj(e){let t=Ru({"X-Fern-Language":"JavaScript","X-Fern-Runtime":X6d.type,"X-Fern-Runtime-Version":X6d.version},e?.headers);return{...e,logging:qip.createLogger(e?.logging),headers:t}}var ts={Prod:"https://registry.buildwithfern.com",Lambda:"https://registry-v2.buildwithfern.com"},tlE=class{_options;constructor(e={}){this._options=vj(e)}getApiLatest(e,t){return es.fromPromise(this.__getApiLatest(e,t))}async __getApiLatest(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/latest/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.latest.getApiLatest.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},rlE=class{_options;constructor(e={}){this._options=vj(e)}getApi(e,t){return es.fromPromise(this.__getApi(e,t))}async __getApi(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getApi.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getEndpointById(e,t,r){return es.fromPromise(this.__getEndpointById(e,t,r))}async __getEndpointById(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}/endpoint/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":case"EndpointDoesNotExistError":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getEndpointById.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}getEndpointByLocator(e,t,r){return es.fromPromise(this.__getEndpointByLocator(e,t,r))}async __getEndpointByLocator(e,t,r){let{method:i,path:n}=t,a={};a.method=i,a.path=n;let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}/endpoint`),method:"GET",headers:o,queryParameters:{...a,...r?.queryParams},timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(c.ok)return{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":case"EndpointDoesNotExistError":return{data:{ok:!1,error:c.error.body,rawResponse:c.rawResponse},rawResponse:c.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getEndpointByLocator.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ilE=class{_options;constructor(e={}){this._options=vj(e)}registerApiDefinition(e,t){return es.fromPromise(this.__registerApiDefinition(e,t))}async __registerApiDefinition(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/api/register"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.v1.register.registerApiDefinition.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},nlE=class{_options;_read;_register;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new rlE(this._options)}get register(){return this._register??=new ilE(this._options)}},alE=class{_options;_latest;_v1;constructor(e={}){this._options=vj(e)}get latest(){return this._latest??=new tlE(this._options)}get v1(){return this._v1??=new nlE(this._options)}},olE=class{_options;constructor(e={}){this._options=vj(e)}getDocsSitesForOrg(e,t){return es.fromPromise(this.__getDocsSitesForOrg(e,t))}async __getDocsSitesForOrg(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/dashboard/get-docs-sites-for-org"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Uzs.getDocsSitesForOrg.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ulE=class{_options;constructor(e={}){this._options=vj(e)}diff(e,t){return es.fromPromise(this.__diff(e,t))}async __diff(e,t){let{previousApiDefinitionId:r,currentApiDefinitionId:i}=e,n={};n.previousApiDefinitionId=r,n.currentApiDefinitionId=i;let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/diff"),method:"GET",headers:a,queryParameters:{...n,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return o.ok?{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse}:{data:{ok:!1,error:Lzs.diff.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},slE=class{_options;constructor(e={}){this._options=vj(e)}getDocsForDomainLegacy(e,t){return es.fromPromise(this.__getDocsForDomainLegacy(e,t))}async __getDocsForDomainLegacy(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/docs/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v1.read.getDocsForDomainLegacy.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsForDomain(e,t){return es.fromPromise(this.__getDocsForDomain(e,t))}async __getDocsForDomain(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/docs/load"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v1.read.getDocsForDomain.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},clE=class{_options;constructor(e={}){this._options=vj(e)}startDocsRegister(e,t){return es.fromPromise(this.__startDocsRegister(e,t))}async __startDocsRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/docs/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Vw.v1.write.startDocsRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}finishDocsRegister(e,t,r){return es.fromPromise(this.__finishDocsRegister(e,t,r))}async __finishDocsRegister(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/docs/register/${On.encodePathParam(e)}`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"DocsRegistrationIdNotFound":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:Vw.v1.write.finishDocsRegister.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},llE=class{_options;_read;_write;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new slE(this._options)}get write(){return this._write??=new clE(this._options)}},flE=class{_options;constructor(e={}){this._options=vj(e)}getOrganizationForUrl(e,t){return es.fromPromise(this.__getOrganizationForUrl(e,t))}async __getOrganizationForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/organization-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getOrganizationForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsUrlMetadata(e,t){return es.fromPromise(this.__getDocsUrlMetadata(e,t))}async __getDocsUrlMetadata(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/metadata-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsUrlMetadata.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsForUrl(e,t){return es.fromPromise(this.__getDocsForUrl(e,t))}async __getDocsForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/load-with-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}ensureDocsInS3(e,t){return es.fromPromise(this.__ensureDocsInS3(e,t))}async __ensureDocsInS3(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/ensure-docs-in-s3"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.ensureDocsInS3.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getPrivateDocsForUrl(e,t){return es.fromPromise(this.__getPrivateDocsForUrl(e,t))}async __getPrivateDocsForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/private/load-with-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getPrivateDocsForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listAllDocsUrls(e={},t){return es.fromPromise(this.__listAllDocsUrls(e,t))}async __listAllDocsUrls(e={},t){let{page:r,limit:i,custom:n}=e,a={};r!=null&&(a.page=r.toString()),i!=null&&(a.limit=i.toString()),n!=null&&(a.custom=n.toString());let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/urls/list"),method:"GET",headers:o,queryParameters:{...a,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(c.ok)return{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:c.error.body,rawResponse:c.rawResponse},rawResponse:c.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.listAllDocsUrls.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}getDocsConfigById(e,t){return es.fromPromise(this.__getDocsConfigById(e,t))}async __getDocsConfigById(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/v2/registry/docs/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsDefinitionNotFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsConfigById.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}prepopulateFdrReadS3Bucket(e){return es.fromPromise(this.__prepopulateFdrReadS3Bucket(e))}async __prepopulateFdrReadS3Bucket(e){let t=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/prepopulate-s3-bucket"),method:"POST",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return r.ok?{data:{ok:!0,body:void 0,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse}:{data:{ok:!1,error:Vw.v2.read.prepopulateFdrReadS3Bucket.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}getDocsFields(e,t){return es.fromPromise(this.__getDocsFields(e,t))}async __getDocsFields(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/load-fields"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsFields.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},dlE=class{_options;constructor(e={}){this._options=vj(e)}startDocsRegister(e,t){return es.fromPromise(this.__startDocsRegister(e,t))}async __startDocsRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/v2/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UnavailableError":case"UserNotInOrgError":case"InvalidDomainError":case"InvalidCustomDomainError":case"DomainBelongsToAnotherOrgError":case"InvalidURLError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.startDocsRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}startDocsPreviewRegister(e,t){return es.fromPromise(this.__startDocsPreviewRegister(e,t))}async __startDocsPreviewRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/preview/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UnavailableError":case"UserNotInOrgError":case"InvalidDomainError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.startDocsPreviewRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}finishDocsRegister(e,t,r){return es.fromPromise(this.__finishDocsRegister(e,t,r))}async __finishDocsRegister(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/v2/registry/docs/register/${On.encodePathParam(e)}`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"DocsRegistrationIdNotFound":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.finishDocsRegister.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}transferOwnershipOfDomain(e,t){return es.fromPromise(this.__transferOwnershipOfDomain(e,t))}async __transferOwnershipOfDomain(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/transfer-ownership"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.transferOwnershipOfDomain.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}setIsArchived(e,t){return es.fromPromise(this.__setIsArchived(e,t))}async __setIsArchived(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/set-is-archived"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.setIsArchived.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}setDocsUrlMetadata(e,t){return es.fromPromise(this.__setDocsUrlMetadata(e,t))}async __setDocsUrlMetadata(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/set-metadata-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.setDocsUrlMetadata.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}addAlgoliaPreviewWhitelistEntry(e,t){return es.fromPromise(this.__addAlgoliaPreviewWhitelistEntry(e,t))}async __addAlgoliaPreviewWhitelistEntry(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/add"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.addAlgoliaPreviewWhitelistEntry.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}removeAlgoliaPreviewWhitelistEntry(e,t){return es.fromPromise(this.__removeAlgoliaPreviewWhitelistEntry(e,t))}async __removeAlgoliaPreviewWhitelistEntry(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/remove"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.removeAlgoliaPreviewWhitelistEntry.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listAlgoliaPreviewWhitelist(e){return es.fromPromise(this.__listAlgoliaPreviewWhitelist(e))}async __listAlgoliaPreviewWhitelist(e){let t=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/list"),method:"GET",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:{ok:!0,body:r.body,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:r.error.body,rawResponse:r.rawResponse},rawResponse:r.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.listAlgoliaPreviewWhitelist.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}deleteDocsSite(e,t){return es.fromPromise(this.__deleteDocsSite(e,t))}async __deleteDocsSite(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/delete"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.deleteDocsSite.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},plE=class{_options;_read;_write;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new flE(this._options)}get write(){return this._write??=new dlE(this._options)}},_lE=class{_options;_v1;_v2;constructor(e={}){this._options=vj(e)}get v1(){return this._v1??=new llE(this._options)}get v2(){return this._v2??=new plE(this._options)}},hlE=class{_options;constructor(e={}){this._options=vj(e)}invalidate(e,t){return es.fromPromise(this.__invalidate(e,t))}async __invalidate(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/docs-cache/invalidate"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Yzs.invalidate.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ylE=class{_options;constructor(e={}){this._options=vj(e)}getLatestCliRelease(e={},t){return es.fromPromise(this.__getLatestCliRelease(e,t))}async __getLatestCliRelease(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli/latest"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidClisFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getLatestCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getChangelog(e,t){return es.fromPromise(this.__getChangelog(e,t))}async __getChangelog(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli/changelog"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.cli.getChangelog.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getMinCliForIr(e,t){return es.fromPromise(this.__getMinCliForIr(e,t))}async __getMinCliForIr(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/cli/for-ir/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidClisFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getMinCliForIr.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertCliRelease(e,t){return es.fromPromise(this.__upsertCliRelease(e,t))}async __upsertCliRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.cli.upsertCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getCliRelease(e,t){return es.fromPromise(this.__getCliRelease(e,t))}async __getCliRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/cli/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"CliVersionNotFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listCliReleases(e={},t){return es.fromPromise(this.__listCliReleases(e,t))}async __listCliReleases(e={},t){let{page:r,pageSize:i}=e,n={};r!=null&&(n.page=r.toString()),i!=null&&(n.pageSize=i.toString());let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli"),method:"GET",headers:a,queryParameters:{...n,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return o.ok?{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse}:{data:{ok:!1,error:aQ.cli.listCliReleases.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},blE=class{_options;constructor(e={}){this._options=vj(e)}getLatestGeneratorRelease(e,t){return es.fromPromise(this.__getLatestGeneratorRelease(e,t))}async __getLatestGeneratorRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/versions/latest"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidGeneratorsFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.versions.getLatestGeneratorRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getChangelog(e,t,r){return es.fromPromise(this.__getChangelog(e,t,r))}async __getChangelog(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}/changelog`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:aQ.versions.getChangelog.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}upsertGeneratorRelease(e,t){return es.fromPromise(this.__upsertGeneratorRelease(e,t))}async __upsertGeneratorRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/versions"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"InvalidVersionError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.versions.upsertGeneratorRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGeneratorRelease(e,t,r){return es.fromPromise(this.__getGeneratorRelease(e,t,r))}async __getGeneratorRelease(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"GeneratorVersionNotFoundError":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:aQ.versions.getGeneratorRelease.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}listGeneratorReleases(e,t={},r){return es.fromPromise(this.__listGeneratorReleases(e,t,r))}async __listGeneratorReleases(e,t={},r){let{page:i,pageSize:n}=t,a={};i!=null&&(a.page=i.toString()),n!=null&&(a.pageSize=n.toString());let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}`),method:"GET",headers:o,queryParameters:{...a,...r?.queryParams},timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return c.ok?{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse}:{data:{ok:!1,error:aQ.versions.listGeneratorReleases.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},vlE=class{_options;_cli;_versions;constructor(e={}){this._options=vj(e)}get cli(){return this._cli??=new ylE(this._options)}get versions(){return this._versions??=new blE(this._options)}upsertGenerator(e,t){return es.fromPromise(this.__upsertGenerator(e,t))}async __upsertGenerator(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.upsertGenerator.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGeneratorByImage(e,t){return es.fromPromise(this.__getGeneratorByImage(e,t))}async __getGeneratorByImage(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/by-image"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.getGeneratorByImage.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGenerator(e,t){return es.fromPromise(this.__getGenerator(e,t))}async __getGenerator(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.getGenerator.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listGenerators(e){return es.fromPromise(this.__listGenerators(e))}async __listGenerators(e){let t=Ru(this._options?.headers,e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators"),method:"GET",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return r.ok?{data:{ok:!0,body:r.body,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse}:{data:{ok:!1,error:aQ.listGenerators.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},glE=class{_options;constructor(e={}){this._options=vj(e)}getRepository(e,t,r){return es.fromPromise(this.__getRepository(e,t,r))}async __getRepository(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/repository/${On.encodePathParam(e)}/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:nVt.getRepository.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}listRepositories(e={},t){return es.fromPromise(this.__listRepositories(e,t))}async __listRepositories(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/repository/list"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.listRepositories.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertRepository(e,t){return es.fromPromise(this.__upsertRepository(e,t))}async __upsertRepository(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/repository/upsert"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.upsertRepository.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}deleteRepository(e,t,r){return es.fromPromise(this.__deleteRepository(e,t,r))}async __deleteRepository(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/repository/${On.encodePathParam(e)}/${On.encodePathParam(t)}/delete`),method:"DELETE",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:nVt.deleteRepository.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}getPullRequest(e,t,r,i){return es.fromPromise(this.__getPullRequest(e,t,r,i))}async __getPullRequest(e,t,r,i){let n=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),i?.headers),a=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/pull-request/${On.encodePathParam(e)}/${On.encodePathParam(t)}/${On.encodePathParam(r)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:i?.timeoutInSeconds!=null?i.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return a.ok?{data:{ok:!0,body:a.body,headers:a.headers,rawResponse:a.rawResponse},rawResponse:a.rawResponse}:{data:{ok:!1,error:nVt.getPullRequest.Error._unknown(a.error),rawResponse:a.rawResponse},rawResponse:a.rawResponse}}listPullRequests(e={},t){return es.fromPromise(this.__listPullRequests(e,t))}async __listPullRequests(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/pull-request/list"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.listPullRequests.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertPullRequest(e,t){return es.fromPromise(this.__upsertPullRequest(e,t))}async __upsertPullRequest(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/pull-request/upsert"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.upsertPullRequest.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}deletePullRequest(e,t,r,i){return es.fromPromise(this.__deletePullRequest(e,t,r,i))}async __deletePullRequest(e,t,r,i){let n=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),i?.headers),a=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/pull-request/${On.encodePathParam(e)}/${On.encodePathParam(t)}/${On.encodePathParam(r)}/delete`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:i?.timeoutInSeconds!=null?i.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return a.ok?{data:{ok:!0,body:void 0,headers:a.headers,rawResponse:a.rawResponse},rawResponse:a.rawResponse}:{data:{ok:!1,error:nVt.deletePullRequest.Error._unknown(a.error),rawResponse:a.rawResponse},rawResponse:a.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},OlE=class{_options;constructor(e={}){this._options=vj(e)}computeSemanticVersion(e,t){return es.fromPromise(this.__computeSemanticVersion(e,t))}async __computeSemanticVersion(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/sdks/semantic-version/compute"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"FailedToComputeExistingVersion":case"FailedToIncrementVersion":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Xzs.versions.computeSemanticVersion.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},AlE=class{_options;_versions;constructor(e={}){this._options=vj(e)}get versions(){return this._versions??=new OlE(this._options)}},mlE=class{_options;constructor(e={}){this._options=vj(e)}get(e,t){return es.fromPromise(this.__get(e,t))}async __get(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"UnavailableError":case"ApiIdRequiredError":case"OrgIdRequiredError":case"OrgIdAndApiIdNotFound":case"OrgIdNotFound":case"EndpointNotFound":case"SDKNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Qlo.get.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}load(e={},t){return es.fromPromise(this.__load(e,t))}async __load(e={},t){let{page:r,...i}=e,n={};r!=null&&(n.page=r.toString());let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets/load"),method:"POST",headers:a,contentType:"application/json",queryParameters:{...n,...t?.queryParams},requestType:"json",body:i,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(o.ok)return{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"UnavailableError":case"InvalidPageError":case"ApiIdRequiredError":case"OrgIdRequiredError":case"OrgIdAndApiIdNotFound":case"OrgIdNotFound":case"SDKNotFound":return{data:{ok:!1,error:o.error.body,rawResponse:o.rawResponse},rawResponse:o.rawResponse}}return{data:{ok:!1,error:Qlo.load.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},PlE=class{_options;constructor(e={}){this._options=vj(e)}createSnippetsForSdk(e,t){return es.fromPromise(this.__createSnippetsForSdk(e,t))}async __createSnippetsForSdk(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets/create"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"OrgIdNotFound":case"SDKNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Zzs.createSnippetsForSdk.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},jlE=class{_options;constructor(e={}){this._options=vj(e)}register(e,t){return es.fromPromise(this.__register(e,t))}async __register(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/register"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:bha.register.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}registerBatch(e,t){return es.fromPromise(this.__registerBatch(e,t))}async __registerBatch(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/register/batch"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:bha.registerBatch.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}get(e,t){return es.fromPromise(this.__get(e,t))}async __get(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/get"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"SnippetNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:bha.get.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},wlE=class{_options;constructor(e={}){this._options=vj(e)}generate(e,t){return es.fromPromise(this.__generate(e,t))}async __generate(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/tokens/generate"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Ulo.generate.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}revoke(e,t){return es.fromPromise(this.__revoke(e,t))}async __revoke(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/tokens/revoke"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Ulo.revoke.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}},zip=class{_options;_api;_dashboard;_docs;_generators;_diff;_docsCache;_git;_sdks;_snippetsFactory;_snippets;_templates;_tokens;constructor(e={}){this._options=vj(e)}get api(){return this._api??=new alE(this._options)}get dashboard(){return this._dashboard??=new olE(this._options)}get docs(){return this._docs??=new _lE(this._options)}get generators(){return this._generators??=new vlE(this._options)}get diff(){return this._diff??=new ulE(this._options)}get docsCache(){return this._docsCache??=new hlE(this._options)}get git(){return this._git??=new glE(this._options)}get sdks(){return this._sdks??=new AlE(this._options)}get snippetsFactory(){return this._snippetsFactory??=new PlE(this._options)}get snippets(){return this._snippets??=new mlE(this._options)}get templates(){return this._templates??=new jlE(this._options)}get tokens(){return this._tokens??=new wlE(this._options)}},ElE={};Di(ElE,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageId:()=>$zt,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SubpackageId:()=>OIn,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,WebhookId:()=>rNt,endpoint:()=>Vtp});var SlE={};Di(SlE,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,ObjectPropertyAccess:()=>Qzs,OrgId:()=>Jzt,PageId:()=>$zt,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SourceId:()=>Ktp,SubpackageId:()=>OIn,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,WebhookId:()=>rNt,endpoint:()=>xtp,registerApiDefinition:()=>Nzs,type_:()=>Fzs,webhook:()=>Gtp,websocket:()=>Htp});var MlE={};Di(MlE,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya});var DlE={};Di(DlE,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya,getDocsForDomain:()=>Hzs,getDocsForDomainLegacy:()=>Kzs});var RW={};Di(RW,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsRegistrationId:()=>rrp,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FilePath:()=>irp,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya,finishDocsRegister:()=>Jzs,startDocsRegister:()=>$zs});var _i={};Di(_i,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageId:()=>$zt,PayloadLocation:()=>Eip,PropertyKey:()=>Yzt,PullRequestState:()=>tip,RoleId:()=>Xzt,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,api:()=>x9i,commons:()=>y9d,dashboard:()=>Uzs,diff:()=>Lzs,docs:()=>Vw,docsCache:()=>Yzs,generators:()=>aQ,git:()=>nVt,navigation:()=>rip,sdks:()=>Xzs,snippets:()=>Qlo,snippetsFactory:()=>Zzs,templates:()=>bha,tokens:()=>Ulo});function Nip(e,t){return BlE(e)?t.versioned(e):t.unversioned(e)}function Fip(e,t){return IlE(e)?t.tabbed(e):t.untabbed(e)}function BlE(e){return Array.isArray(e.versions)}function IlE(e){return Array.isArray(e.tabs)||Array.isArray(e.tabsV2)}function ClE(e,t){return tNs(e)?t.link(e):t.group(e)}function tNs(e){return"url"in e&&typeof e.url=="string"}function qlE(e,t){return RlE(e)?t.versioned(e):t.unversioned(e)}function TlE(e,t){return zlE(e)?t.tabbed(e):t.untabbed(e)}function RlE(e){return Array.isArray(e.versions)}function zlE(e){return Array.isArray(e.tabs)}function NlE(e,t){return QlE(e)?t.versioned(e):t.unversioned(e)}function FlE(e,t){return UlE(e)?t.tabbed(e):t.untabbed(e)}function QlE(e){return Array.isArray(e.versions)}function UlE(e){return Array.isArray(e.tabs)||Array.isArray(e.tabsV2)}function LlE(e,t){switch(e.type){case"object":return J9i(e,t,!1,new Set,0);case"reference":return ER(e.value,t,!1,new Set,0);default:T7(e)}}function VlE(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!0,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!0,new Set,0)};case"json":return WlE(e.shape,t);case"fileUpload":return k6d(e.value,t);case"formData":return k6d(e,t);case"bytes":{if(e.isOptional)return;let r=btoa("Hello world!");return e.contentType!=null&&(r=`data:${e.contentType};base64,${r}`),{type:"bytes",value:{type:"base64",value:r}}}}}function k6d(e,t){if(e==null)return{type:"form",value:{}};let r={};return e.properties.forEach(i=>{switch(i.type){case"file":{if(i.value.isOptional)break;i.value.type==="fileArray"?r[i.value.key]={type:"filenames",value:["<filename1>","<filename2>"]}:r[i.value.key]={type:"filename",value:"<filename1>"};break}case"bodyProperty":{r[i.key]={type:"json",value:ER(i.valueType,t,!0,new Set,0)};break}}}),{type:"form",value:r}}function WlE(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!0,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!0,new Set,0)};default:T7(e)}}function iNs(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!1,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!1,new Set,0)};case"fileDownload":return{type:"filename",value:"<filename>"};case"streamingText":case"streamCondition":return{type:"stream",value:["example-text"]};case"stream":switch(e.shape.type){case"object":{let r=J9i(e.shape,t,!1,new Set,0);return{type:"stream",value:[r,r]}}case"reference":{let r=ER(e.shape.value,t,!1,new Set,0);return{type:"stream",value:[r,r]}}}}}function J9i(e,t,r,i,n){let a={};for(let o of Uip(e,t)){let c=ER(o.valueType,t,r,n===0?new Set:new Set(i),n+1);c!=null&&(a[o.key]=c)}return a}function ER(e,t,r,i,n){let a;switch(e.type){case"primitive":a=HlE(e.value);break;case"id":{i.add(e.value),a=xlE(e.value,t,r,i,n);break}case"optional":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=void 0;break}else i.add(e.itemType.value);r?a=void 0:a=e.defaultValue??ER(e.itemType,t,r,i,n);break;case"nullable":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=void 0;break}else i.add(e.itemType.value);a=ER(e.itemType,t,r,i,n);break;case"list":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=[];break}else i.add(e.itemType.value);a=[ER(e.itemType,t,r,i,n)];break;case"set":a=[ER(e.itemType,t,r,i,n)];break;case"map":a={[ER(e.keyType,t,r,i,n+1)]:ER(e.valueType,t,r,i,n+1)};break;case"unknown":a={};break;case"literal":a=GlE(e.value);break;default:T7(e)}return a}function xlE(e,t,r,i,n){let a=t(e).shape;return Qip(a,t,r,i,n)}function Qip(e,t,r,i,n){switch(e.type){case"object":return J9i(e,t,r,i,n);case"undiscriminatedUnion":return e.variants[0]==null?{}:ER(e.variants[0].type,t,r,i,n);case"discriminatedUnion":return e.variants[0]==null?{}:{[e.discriminant]:e.variants[0].discriminantValue,...J9i(e.variants[0].additionalProperties,t,r,i,n)};case"alias":return ER(e.value,t,r,i,n);case"enum":return e.values[0]?.value??""}}function GlE(e){return e.value}function HlE(e){switch(e.type){case"string":return"string";case"integer":return 0;case"uint":return 0;case"uint64":return 0;case"double":return 1;case"boolean":return!0;case"long":return 99999;case"datetime":return"2023-01-01T00:00:00Z";case"uuid":return"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32";case"base64":return"SGVsbG8gV29ybGQ=";case"date":return"2023-01-01";case"bigInteger":return"123456789123456789"}}function Uip(e,t){return[...e.properties,...e.extends.flatMap(r=>{let i=t(r);return i.shape.type==="alias"&&i.shape.value.type==="id"&&(i=KlE(i.shape.value.value,t)),i.shape.type!=="object"?[]:Uip(i.shape,t)})]}function KlE(e,t){let r=t(e);return r.shape.type==="alias"&&r.shape.value.type==="id"?t(r.shape.value.value):r}var JlE=2;function $lE({endpointDefinition:e,apiDefinition:t,errorDeclaration:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:r.statusCode,responseBodyV3:r.type!=null?{type:"json",value:Qip(r.type,i,!1,new Set,0)}:void 0}}function YlE({endpointDefinition:e,apiDefinition:t,nonStreamResponse:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:200,responseBodyV3:iNs(r.shape,i)}}function XlE({endpointDefinition:e,apiDefinition:t,streamResponse:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:200,responseBodyV3:iNs(r.shape,i)}}function ZlE({endpointDefinition:e,apiDefinition:t}){let r=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:r}),responseStatusCode:200,responseBodyV3:e.response!=null?iNs(e.response.type,r):void 0}}function Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:r}){let i=klE({pathParameters:e.path.pathParameters,apiDefinition:t,resolveTypeById:r}),n=rfE(e.path,i),a=efE({resolveTypeById:r,queryParameters:e.queryParameters}),o=tfE({headers:[...t.globalHeaders??[],...e.headers],resolveTypeById:r}),c=e.request!=null?VlE(e.request.type,r):void 0;return{path:n,pathParameters:i,queryParameters:a,headers:o,requestBodyV3:c,name:void 0,requestBody:void 0,responseBody:void 0,responseBodyV3:void 0,codeSamples:void 0,description:void 0}}function klE({pathParameters:e,apiDefinition:t,resolveTypeById:r}){return e.reduce((i,n)=>{let a=Lip({typeReference:n.type,types:t.types});return{...i,[n.key]:a?`:${n.key}`:ER(n.type,r,!1,new Set,0)}},{})}function efE({queryParameters:e,resolveTypeById:t}){let r={},i=0;for(let n of e){let a=ER(n.type,t,i>=JlE,new Set,0);n.type.type==="optional"&&(i+=1),r[n.key]=a}return r}function tfE({headers:e,resolveTypeById:t}){return e.reduce((r,i)=>{let n=ER(i.type,t,!1,new Set,0);return n==null?r:{...r,[i.key]:n}},{})}function Hfo(e){return t=>{let r=e.types[t];if(r==null)throw new Error(`Failed to find ${t}`);return r}}function rfE(e,t){let r="";for(let i of e.parts)switch(i.type){case"literal":r+=i.value;break;case"pathParameter":{let n=t[i.value];if(n==null)throw new Error("Path parameter is missing: "+i.value);r+=n}break;default:T7(i)}return r}function Lip({typeReference:e,types:t}){if(e.type==="primitive"&&e.value.type==="string")return!0;if(e.type==="id"){let r=t[e.value];if(r!=null&&r.shape.type==="alias")return Lip({typeReference:r.shape.value,types:t})}return!1}function ifE({webhookDefinition:e,apiDefinition:t}){try{let r=i=>{let n=t.types[i];if(n==null)throw new Error(`Failed to find ${i}`);return n};return{payload:LlE(e.payload.type,r)}}catch{throw new Error}}function Kfo(e,t,r){let i={};for(let[a,o]of r9d(e.subpackages))for(let c of o.subpackages)i[c]=a;let n=new hfE;return{id:t,rootPackage:{endpoints:e.rootPackage.endpoints.map(a=>xip({writeShape:a,apiDefinition:e,context:n,snippets:r})??[]),webhooks:e.rootPackage.webhooks?.map(a=>Wip({writeShape:a,apiDefinition:e}))??[],websockets:e.rootPackage.websockets?.map(a=>Vip({writeShape:a}))??[],subpackages:e.rootPackage.subpackages,types:e.rootPackage.types,pointsTo:void 0},types:Object.fromEntries(Object.entries(e.types).map(([a,o])=>[a,ffE({writeShape:o})])),subpackages:r9d(e.subpackages).reduce((a,[o,c])=>(a[o]=nfE({writeShape:c,id:o,subpackageToParent:i,apiDefinition:e,context:n,snippets:r}),a),{}),snippetsConfiguration:e.snippetsConfiguration,auth:e.auth,authSchemes:e.authSchemes,globalHeaders:e.globalHeaders,hasMultipleBaseUrls:n.hasMultipleBaseUrls(),navigation:e.navigation}}function nfE({writeShape:e,id:t,subpackageToParent:r,apiDefinition:i,context:n,snippets:a}){let o=r[t],c=e.endpoints.map(u=>xip({writeShape:u,apiDefinition:i,context:n,snippets:a})),f=e.webhooks?.map(u=>Wip({writeShape:u,apiDefinition:i})),s=e.websockets?.map(u=>Vip({writeShape:u}));return{subpackageId:t,parent:o,name:e.name,endpoints:c,websockets:s??[],types:e.types,subpackages:e.subpackages,pointsTo:e.pointsTo,urlSlug:oC(e.name),description:e.description,displayName:e.displayName,webhooks:f??[]}}function Vip({writeShape:e}){return{urlSlug:oC(e.id),auth:e.auth,headers:e.headers,messages:e.messages,availability:e.availability,defaultEnvironment:e.defaultEnvironment,environments:e.environments,description:e.description,id:e.id,name:e.name,path:e.path,queryParameters:e.queryParameters,examples:e.examples}}function Wip({apiDefinition:e,writeShape:t}){let r=oC(t.id),i=oC(t.name??t.id);return{urlSlug:r,migratedFromUrlSlugs:(0,rNs.default)(i,r)?void 0:[i],description:t.description,method:t.method,id:t.id,name:t.name,path:t.path,headers:t.headers,responses:t.responses?.map(afE),payload:t.payload,examples:t.examples.length>0?t.examples:[ifE({webhookDefinition:t,apiDefinition:e})]}}function afE(e){let t=e.type;switch(t.type){case"fileDownload":case"object":case"reference":case"streamingText":case"stream":return{...e,type:t};case"streamCondition":return{...e,type:t.response.shape}}}function xip({writeShape:e,apiDefinition:t,context:r,snippets:i}){r.registerEnvironments(e.environments??[]);let n=oC(e.id),a=oC(e.name??e.id);return{availability:e.availability,environments:e.environments,defaultEnvironment:e.defaultEnvironment,urlSlug:e.slug??n,migratedFromUrlSlugs:(0,rNs.default)(a,n)?void 0:[a],method:e.method,id:e.id,originalEndpointId:e.originalEndpointId,name:e.name,path:e.path,queryParameters:e.queryParameters,headers:e.headers,request:e.request!=null?t9d({writeShape:e.request}):void 0,requestsV2:e.requestsV2!=null?{requests:e.requestsV2.requests?.map(o=>t9d({writeShape:o}))}:void 0,response:e.response!=null?e9d({writeShape:e.response,apiDefinition:t,sdkSnippetHolder:i,endpointDefinition:e}):void 0,responsesV2:e.responsesV2!=null?{responses:e.responsesV2.responses?.map(o=>e9d({writeShape:o,apiDefinition:t,sdkSnippetHolder:i,endpointDefinition:e}))}:void 0,errors:e.errors??[],errorsV2:ofE(e),examples:sfE({writeShape:e,apiDefinition:t,snippets:i}),description:e.description,authed:e.auth,authV2:e.authV2,multiAuth:e.multiAuth,snippetTemplates:i.getSnippetTemplateForEndpoint({endpointPath:xBn(e),endpointMethod:e.method,endpointId:e.originalEndpointId}),protocol:e.protocol,includeInApiExplorer:e.includeInApiExplorer}}function ofE(e){if(e.errorsV2!=null)return e.errorsV2.map(t=>({...t,name:t.name!=null?Jco(t.name):void 0,type:t.type!=null?Gip({writeShape:t.type}):void 0}));if(e.errors!=null)return e.errors.map(t=>({name:void 0,isWildcard:void 0,examples:void 0,headers:void 0,...t,type:t.type!=null?{type:"alias",value:t.type}:void 0}))}function e9d({writeShape:e,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i}){let n=e.type;switch(n.type){case"fileDownload":case"object":case"reference":case"streamingText":case"stream":return{...e,type:n};case"streamCondition":return{...e,type:{type:"streamCondition",...ufE({writeShape:n,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i})}}}}function ufE({writeShape:e,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i}){let n=e.response.examples??YlE({apiDefinition:t,nonStreamResponse:e.response,endpointDefinition:r}),a=e.response.examples??XlE({apiDefinition:t,streamResponse:e.response,endpointDefinition:r});return{...e,response:{...e.response,examples:n.map(o=>U1s({writeShape:o,endpointDefinition:r,snippets:i}))},streamResponse:{...e.streamResponse,examples:a.map(o=>U1s({writeShape:o,endpointDefinition:r,snippets:i}))}}}function sfE({writeShape:e,apiDefinition:t,snippets:r}){let i=[],{successExamples:n,errorExamples:a}=cfE(e.examples);if(n.length>0)i.push(...n);else{let s=ZlE({endpointDefinition:e,apiDefinition:t});i.push(s)}let o=new Set(a.map(s=>s.responseStatusCode)),f=(e.errorsV2??[]).filter(s=>!o.has(s.statusCode)).map(s=>$lE({endpointDefinition:e,apiDefinition:t,errorDeclaration:s}));return i.push(...a,...f),i.map(s=>U1s({writeShape:s,endpointDefinition:e,snippets:r}))}function cfE(e){let t=[],r=[];return e.forEach(i=>{i.responseStatusCode<400?t.push(i):r.push(i)}),{successExamples:t,errorExamples:r}}function t9d({writeShape:e}){switch(e.type.type){case"object":case"reference":return{contentType:"application/json",description:e.description,type:e.type};case"fileUpload":case"formData":return{contentType:"multipart/form-data",description:e.description,type:e.type};case"json":return{contentType:e.type.contentType,description:e.description,type:e.type.shape};case"bytes":return{contentType:e.type.contentType??"application/octet-stream",description:e.description,type:{type:"bytes",isOptional:e.type.isOptional,contentType:e.type.contentType}};default:T7(e.type)}}function U1s({writeShape:e,endpointDefinition:t,snippets:r}){return{name:e.name,description:e.description,path:e.path,pathParameters:e.pathParameters,queryParameters:e.queryParameters,headers:e.headers,requestBody:e.requestBody,responseStatusCode:e.responseStatusCode,responseBody:e.responseBody,codeExamples:lfE({endpointDefinition:t,snippets:r,exampleId:e.name}),requestBodyV3:e.requestBodyV3??(e.requestBody!=null?{type:"json",value:e.requestBody}:void 0),responseBodyV3:e.responseBodyV3??(e.responseBody!=null?{type:"json",value:e.responseBody}:void 0),codeSamples:e.codeSamples??[]}}function lfE({exampleId:e,endpointDefinition:t,snippets:r}){let i=r.getPythonCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),n=r.getTypeScriptCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),a=r.getGoCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),o=r.getRubyCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),c=r.getCsharpCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e});return{nodeAxios:"",pythonSdk:i,typescriptSdk:n,goSdk:a,rubySdk:o,csharpSdk:c}}function xBn(e){let t="";for(let r of e.path.parts)r.type==="literal"?t+=r.value:t+=`{${r.value}}`;return _i.EndpointPathLiteral(t)}function ffE({writeShape:e}){return{description:e.description,availability:e.availability,name:e.name,displayName:e.displayName,shape:Gip({writeShape:e.shape})}}function Gip({writeShape:e}){switch(e.type){case"object":return{type:"object",extends:e.extends,properties:e.properties.map(t=>Hip({writeShape:t})),extraProperties:e.extraProperties};case"alias":return{type:"alias",value:e.value};case"enum":return{type:"enum",default:e.default,values:e.values.map(t=>dfE({writeShape:t}))};case"discriminatedUnion":return{type:"discriminatedUnion",discriminant:e.discriminant,variants:e.variants.map(t=>pfE({writeShape:t}))};case"undiscriminatedUnion":return{type:"undiscriminatedUnion",variants:e.variants.map(t=>_fE({writeShape:t}))};default:T7(e)}}function Hip({writeShape:e}){return{description:e.description,availability:e.availability,key:e.key,valueType:e.valueType,propertyAccess:e.propertyAccess}}function dfE({writeShape:e}){return{availability:e.availability,description:e.description,value:e.value}}function pfE({writeShape:e}){return{description:e.description,availability:e.availability,displayName:e.displayName,discriminantValue:e.discriminantValue,additionalProperties:{extends:e.additionalProperties.extends,properties:e.additionalProperties.properties.map(t=>Hip({writeShape:t})),extraProperties:e.additionalProperties.extraProperties}}}function _fE({writeShape:e}){return{description:e.description,availability:e.availability,type:e.type,displayName:e.displayName}}function r9d(e){return Object.entries(e)}var hfE=class{uniqueBaseUrls={};registerEnvironments(e){for(let t of e){let r=this.uniqueBaseUrls[t.id];r!=null?r.add(this.getHost(t.baseUrl)):this.uniqueBaseUrls[t.id]=new Set([this.getHost(t.baseUrl)])}}hasMultipleBaseUrls(){for(let[,e]of Object.entries(this.uniqueBaseUrls))if(e.size>1)return!0;return!1}getHost(e){try{return new URL(e).host}catch{return""}}},L1s={r:129,g:140,b:248,a:void 0},V1s={r:129,g:140,b:248,a:void 0};function Kip({writeShape:e,files:t}){let r=e.config.navigation?yfE(e.config.navigation):void 0,i={};Object.entries(t).forEach(([,f])=>{i[f.presignedUrl.fileId]=f.imageMetadata!=null?{type:"image",s3Key:f.key,width:f.imageMetadata.width,height:f.imageMetadata.height,blurDataUrl:f.imageMetadata.blurDataUrl,alt:f.imageMetadata.alt}:{type:"s3Key",s3Key:f.key}});let n=e.config.logo,a=e.config.logoV2;a==null&&n!=null&&(a={dark:n,light:void 0});let o=e.config.colors,c=e.config.colorsV2;return c==null&&o!=null&&(c={accentPrimary:{type:"themed",dark:o.accentPrimary,light:void 0},background:void 0}),{type:"v3",referencedApis:OfE(r,e.config.root),files:i,config:{navigation:r,root:e.config.root,logo:n,logoV2:a,logoHeight:e.config.logoHeight,logoHref:e.config.logoHref,logoRightText:e.config.logoRightText,colors:o,colorsV2:c,colorsV3:e.config.colorsV3!=null?jfE({writeShape:e.config.colorsV3,docsConfig:e.config}):void 0,navbarLinks:e.config.navbarLinks,footerLinks:e.config.footerLinks,hideNavLinks:e.config.hideNavLinks,title:e.config.title,favicon:e.config.favicon,backgroundImage:e.config.backgroundImage,typography:e.config.typography,typographyV2:e.config.typographyV2,layout:e.config.layout,theme:e.config.theme,settings:e.config.settings,css:e.config.css,js:e.config.js,metadata:e.config.metadata,redirects:e.config.redirects,integrations:e.config.integrations,defaultLanguage:e.config.defaultLanguage,languages:e.config.languages,analyticsConfig:e.config.analyticsConfig,announcement:e.config.announcement,aiChatConfig:e.config.aiChatConfig,pageActions:e.config.pageActions},pages:e.pages,jsFiles:e.jsFiles}}function yfE(e){return NlE(e,{unversioned:t=>Jip(t),versioned:t=>bfE(t)})}function bfE(e){return{versions:e.versions.map(t=>({urlSlug:t.urlSlugOverride??oC(t.version),availability:t.availability,version:t.version,config:Jip(t.config)}))}}function Jip(e){return FlE(e,{untabbed:t=>({items:t.items?.map(Jfo),landingPage:Vlo(t.landingPage,"")}),tabbed:t=>({tabs:t.tabs?.map(vfE),tabsV2:t.tabsV2?.map(gfE),landingPage:Vlo(t.landingPage,"")})})}function vfE(e){return tNs(e)?e:{...e,items:e.items?.map(Jfo),urlSlug:e.urlSlugOverride??oC(e.title??"")}}function gfE(e){switch(e.type){case"group":return{...e,items:e.items.map(Jfo),urlSlug:e.urlSlugOverride??oC(e.title)};case"link":return e;case"changelog":return{type:"changelog",...$ip(e)};case"changelogV3":return e}}function $ip(e){return{title:e.title,icon:e.icon,hidden:e.hidden??!1,description:e.description,items:e.items.map(t=>({date:t.date,pageId:t.pageId,tags:t.tags})),pageId:e.pageId,urlSlug:e.urlSlugOverride??(e.title!=null?oC(e.title):"changelog"),fullSlug:e.fullSlug}}function Jfo(e){switch(e.type){case"api":return{...e,icon:e.icon,hidden:e.hidden??!1,longScrolling:e.longScrolling,flattened:e.flattened,fullSlug:e.fullSlug,urlSlug:e.urlSlugOverride??oC(e.title),artifacts:e.artifacts!=null?AfE(e.artifacts):void 0,skipUrlSlug:e.skipUrlSlug??!1,showErrors:e.showErrors??!1,changelog:e.changelog!=null?{title:e.changelog.title,description:e.changelog.description,items:e.changelog.items.map(t=>({date:t.date,pageId:t.pageId,tags:t.tags})),pageId:e.changelog.pageId,urlSlug:e.changelog.urlSlug,fullSlug:e.fullSlug,icon:e.changelog.icon,hidden:e.changelog.hidden??!1}:void 0,navigation:wfE(e.navigation)};case"page":return Vlo(e);case"section":return{type:"section",title:e.title,icon:e.icon,urlSlug:e.urlSlugOverride??oC(e.title),collapsed:e.collapsed??!1,hidden:e.hidden??!1,items:e.items.map(t=>Jfo(t)),skipUrlSlug:e.skipUrlSlug??!1,fullSlug:e.fullSlug,overviewPageId:e.overviewPageId};case"link":return{type:"link",title:e.title,icon:e.icon,url:e.url,target:e.target};case"changelog":return{type:"changelog",...$ip(e)};case"apiV2":return e;case"changelogV3":return e;default:T7(e)}}function OfE(e,t){if(t!=null){let r=Ct.migrate.FernNavigationV1ToLatest.create().root(t);return Ct.utils.collectApiReferences(r).map(i=>i.apiDefinitionId)}return e!=null?Nip(e,{unversioned:r=>i9d(r),versioned:r=>r.versions.flatMap(i=>i9d(i.config))}):[]}function i9d(e){return Fip(e,{untabbed:t=>t.items.flatMap(Hco),tabbed:t=>{let r=[];return t.tabs?.forEach(i=>{tNs(i)||i.items&&r.push(...i.items.flatMap(Hco))}),t.tabsV2?.forEach(i=>{i.type==="group"&&i.items&&r.push(...i.items.flatMap(Hco))}),r}})}function Hco(e){switch(e.type){case"api":return[e.api];case"page":return[];case"section":return e.items.flatMap(t=>Hco(t));case"link":return[];case"changelog":return[];case"apiV2":return[e.node.apiDefinitionId];case"changelogV3":return[];default:T7(e)}}function AfE(e){return{sdks:e.sdks.map(t=>mfE(t)),postman:e.postman!=null?PfE(e.postman):void 0}}function mfE(e){switch(e.type){case"maven":return{type:"maven",coordinate:e.coordinate,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version};case"npm":return{type:"npm",packageName:e.packageName,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version};case"pypi":return{type:"pypi",packageName:e.packageName,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version}}}function PfE(e){return{url:e.url,githubRepo:e.githubRepoName!=null?{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)}:void 0}}function jfE({writeShape:e,docsConfig:t}){switch(e.type){case"dark":return{type:"dark",accentPrimary:e.accentPrimary??L1s,logo:e.logo??t.logoV2?.dark??t.logo,background:e.background!=null?{type:"solid",...e.background}:{type:"gradient"},backgroundImage:e.backgroundImage??t.backgroundImage,border:e.border,cardBackground:e.cardBackground,sidebarBackground:e.sidebarBackground,headerBackground:e.headerBackground};case"light":return{type:"light",accentPrimary:e.accentPrimary??V1s,logo:e.logo??t.logoV2?.dark??t.logo,background:e.background!=null?{type:"solid",...e.background}:{type:"gradient"},backgroundImage:e.backgroundImage??t.backgroundImage,border:e.border,cardBackground:e.cardBackground,sidebarBackground:e.sidebarBackground,headerBackground:e.headerBackground};case"darkAndLight":return{type:"darkAndLight",light:{accentPrimary:e.light.accentPrimary??V1s,logo:e.light.logo??t.logoV2?.light??t.logo,background:e.light.background!=null?{type:"solid",...e.light.background}:{type:"gradient"},backgroundImage:e.light.backgroundImage??t.backgroundImage,border:e.light.border,cardBackground:e.light.cardBackground,sidebarBackground:e.light.sidebarBackground,headerBackground:e.light.headerBackground},dark:{accentPrimary:e.dark.accentPrimary??L1s,logo:e.dark.logo??t.logoV2?.dark??t.logo,background:e.dark.background!=null?{type:"solid",...e.dark.background}:{type:"gradient"},backgroundImage:e.dark.backgroundImage??t.backgroundImage,border:e.dark.border,cardBackground:e.dark.cardBackground,sidebarBackground:e.dark.sidebarBackground,headerBackground:e.dark.headerBackground}};default:T7(e)}}function Vlo(e,t){if(e!=null)return{type:"page",id:e.id,title:e.title,icon:e.icon,urlSlug:e.urlSlugOverride??t??oC(e.title),fullSlug:e.fullSlug,hidden:e.hidden??!1}}function wfE(e){if(e!=null)return{items:Yip(e.items),summaryPageId:e.summaryPageId}}function Yip(e){return e.map(t=>t.type==="subpackage"?{type:"subpackage",subpackageId:t.subpackageId,items:Yip(t.items),summaryPageId:t.summaryPageId}:t.type==="page"?Vlo(t):t)}var $fo=class{snippetsBySdkId;snippetsBySdkIdAndEndpointId;snippetsConfigWithSdkId;snippetTemplatesByEndpoint;snippetTemplatesByEndpointId;constructor({snippetsBySdkId:e,snippetsConfigWithSdkId:t,snippetTemplatesByEndpoint:r,snippetsBySdkIdAndEndpointId:i,snippetTemplatesByEndpointId:n}){this.snippetsBySdkId=e,this.snippetsConfigWithSdkId=t,this.snippetTemplatesByEndpoint=r,this.snippetsBySdkIdAndEndpointId=i,this.snippetTemplatesByEndpointId=n}getPythonCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.pythonSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.pythonSdk,getSnippet:n=>n.type==="python"?{...n,install:void 0}:void 0})}getTypeScriptCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.typescriptSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.typescriptSdk,getSnippet:n=>n.type==="typescript"?{...n,install:void 0}:void 0})}getGoCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.goSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.goSdk,getSnippet:n=>n.type==="go"?{...n,install:void 0}:void 0})}getRubyCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.rubySdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.rubySdk,getSnippet:n=>n.type==="ruby"?{...n,install:void 0}:void 0})}getCsharpCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.csharpSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.csharpSdk,getSnippet:n=>n.type==="csharp"?{...n,install:void 0}:void 0})}getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n,getSnippet:a}){let o=n(this.snippetsConfigWithSdkId);if(o==null)return;let c=o.sdkId,f=[];r!=null&&(f=this.snippetsBySdkIdAndEndpointId[c]?.[r]??[]),(r==null||f.length===0)&&(f=this.snippetsBySdkId[c]?.[e]?.[t]??[]);let s=f.filter(u=>i!=null&&u.exampleIdentifier===i);if(s.length===0&&f[0]!=null&&(s=[f[0]]),s[0]!=null)return a(s[0])}getSnippetTemplateForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r}){let i;return r!=null&&(i=this.snippetTemplatesByEndpointId[r]),(r==null||this.snippetTemplatesByEndpointId[r]==null)&&(i=this.snippetTemplatesByEndpoint[e]?.[t]),i}};function Yfo(e){return{id:e.id,rootPackage:{endpoints:e.rootPackage.endpoints.map(t=>Xip({dbShape:t})),subpackages:e.rootPackage.subpackages,types:e.rootPackage.types,webhooks:e.rootPackage.webhooks??[],websockets:e.rootPackage.websockets??[],pointsTo:e.rootPackage.pointsTo},types:e.types,subpackages:Object.fromEntries(Object.entries(e.subpackages).map(([t,r])=>[t,EfE({dbShape:r})])),snippetsConfiguration:e.snippetsConfiguration,auth:e.auth,authSchemes:e.authSchemes,hasMultipleBaseUrls:e.hasMultipleBaseUrls,navigation:e.navigation,globalHeaders:e.globalHeaders}}function EfE({dbShape:e}){return{subpackageId:e.subpackageId,parent:e.parent,name:e.name,endpoints:e.endpoints.map(t=>Xip({dbShape:t})),types:e.types,subpackages:e.subpackages,pointsTo:e.pointsTo,urlSlug:e.urlSlug,description:e.description,webhooks:e.webhooks??[],websockets:e.websockets??[],displayName:e.displayName}}function Xip({dbShape:e}){return{environments:e.environments??[],availability:e.availability,defaultEnvironment:e.defaultEnvironment,urlSlug:e.urlSlug,migratedFromUrlSlugs:e.migratedFromUrlSlugs,method:e.method,id:e.id,originalEndpointId:e.originalEndpointId,name:e.name,path:e.path,queryParameters:e.queryParameters,headers:e.headers,request:e.request!=null?rCs({dbShape:e.request}):void 0,requestsV2:(()=>{if(e.requestsV2!=null)return e.requestsV2.requests==null||e.requestsV2.requests.length===0?e.request!=null?{requests:[rCs({dbShape:e.request})]}:void 0:{requests:e.requestsV2.requests.map(t=>rCs({dbShape:t}))}})(),response:e.response,responsesV2:e.responsesV2,errors:e.errors??[],errorsV2:MfE(e),examples:e.examples.map(t=>DfE({dbShape:t})),description:e.description,authed:e.authed??!1,authV2:e.authV2,multiAuth:SfE(e),snippetTemplates:e.snippetTemplates,protocol:e.protocol,includeInApiExplorer:e.includeInApiExplorer??!0}}function SfE(e){if(e.multiAuth!=null)return e.multiAuth;if(e.authV2!=null)return e.authV2.length===0?[]:e.authV2.map(t=>({schemes:[t]}));if(e.authed===!0)return[{schemes:["default"]}]}function MfE(e){if(e.errorsV2!=null)return e.errorsV2;if(e.errors!=null)return e.errors.map(t=>({isWildcard:void 0,name:void 0,examples:void 0,headers:void 0,...t,type:t.type!=null?{type:"alias",value:t.type}:void 0}))}function rCs({dbShape:e}){switch(e.type.type){case"object":case"reference":return{contentType:e.contentType??"application/json",description:e.description,type:e.type};case"fileUpload":case"formData":return{contentType:e.contentType??"multipart/form-data",description:e.description,type:e.type};case"bytes":return{contentType:e.contentType??"application/octet-stream",description:e.description,type:e.type};default:T7(e.type)}}function DfE({dbShape:e}){return{name:e.name,description:e.description,path:e.path,pathParameters:e.pathParameters,queryParameters:e.queryParameters,headers:e.headers,requestBody:e.requestBody,responseStatusCode:e.responseStatusCode,responseBody:e.responseBody,codeExamples:e.codeExamples,requestBodyV3:e.requestBodyV3??(e.requestBody!=null?{type:"json",value:e.requestBody}:void 0),responseBodyV3:e.responseBodyV3??(e.responseBody!=null?{type:"json",value:e.responseBody}:void 0),codeSamples:e.codeSamples??[]}}function Zip({dbShape:e}){return{navigation:e.navigation!=null?IfE(e.navigation):void 0,root:e.root,logoHeight:e.logoHeight,logoHref:e.logoHref,logoRightText:e.logoRightText,colorsV3:e.colorsV3??NfE(e),navbarLinks:e.navbarLinks,footerLinks:e.footerLinks,hideNavLinks:e.hideNavLinks,title:e.title,favicon:e.favicon,typographyV2:e.typographyV2??BfE(e.typography),layout:e.layout,theme:e.theme,settings:e.settings,css:e.css,js:e.js,metadata:e.metadata,redirects:e.redirects,integrations:e.integrations,defaultLanguage:e.defaultLanguage,languages:e.languages,analyticsConfig:e.analyticsConfig,announcement:e.announcement,aiChatConfig:e.aiChatConfig,pageActions:e.pageActions}}function iCs(e){if(e!=null)return{type:"custom",name:e.name,variants:[{fontFile:e.fontFile,weight:void 0,style:void 0}],display:void 0,fallback:void 0,fontVariationSettings:void 0}}function BfE(e){if(e!=null)return{headingsFont:iCs(e.headingsFont),bodyFont:iCs(e.bodyFont),codeFont:iCs(e.codeFont)}}function IfE(e){return Nip(e,{unversioned:t=>kip(t),versioned:t=>CfE(t)})}function CfE(e){return{versions:e.versions.map(t=>({urlSlug:t.urlSlug??oC(t.version),availability:t.availability,version:t.version,config:kip(t.config)}))}}function kip(e){return Fip(e,{tabbed:t=>({tabs:t.tabsV2?.map(TfE)??t.tabs?.map(qfE)??[],landingPage:t.landingPage}),untabbed:t=>({items:t.items.map(Xfo),landingPage:t.landingPage})})}function qfE(e){return ClE(e,{link:t=>({type:"link",...t}),group:t=>({type:"group",...t,items:t.items.map(Xfo),skipUrlSlug:t.skipUrlSlug??!1,hidden:void 0,fullSlug:void 0})})}function TfE(e){switch(e.type){case"link":return e;case"group":return{...e,items:e.items.map(Xfo),skipUrlSlug:e.skipUrlSlug??!1,hidden:void 0,fullSlug:void 0};case"changelog":case"changelogV3":return e;default:T7(e)}}function Xfo(e){switch(e.type){case"api":return{...e,showErrors:e.showErrors??!1};case"section":return{...e,items:e.items.map(t=>Xfo(t))};case"page":case"link":case"changelog":case"apiV2":case"changelogV3":return e;default:T7(e)}}var RfE={accentPrimary:L1s,background:{type:"gradient"},logo:void 0,backgroundImage:void 0,border:void 0,sidebarBackground:void 0,headerBackground:void 0,cardBackground:void 0},zfE={accentPrimary:V1s,background:{type:"gradient"},logo:void 0,backgroundImage:void 0,border:void 0,sidebarBackground:void 0,headerBackground:void 0,cardBackground:void 0};function NfE(e){let t=!1,r=!1,i={},n={};if(e.colorsV3!=null)if(e.colorsV3.type==="dark"){t=!0;let{type:c,...f}=e.colorsV3;i={...i,...f}}else if(e.colorsV3.type==="light"){r=!0;let{type:c,...f}=e.colorsV3;n={...n,...f}}else e.colorsV3.type==="darkAndLight"&&(t=!0,r=!0,i=e.colorsV3.dark,n=e.colorsV3.light);e.colorsV2!=null&&(e.colorsV2.background!=null&&(e.colorsV2.background.type==="themed"?(e.colorsV2.background.dark!=null&&i.background==null&&(t=!0,i.background={type:"solid",...e.colorsV2.background.dark}),e.colorsV2.background.light!=null&&n.background==null&&(r=!0,n.background={type:"solid",...e.colorsV2.background.light})):e.colorsV2.background.type==="unthemed"&&e.colorsV2.background.color!=null&&(go(e.colorsV2.background.color).isDark()?(t=!0,i.background={type:"solid",...e.colorsV2.background.color}):(r=!0,n.background={type:"solid",...e.colorsV2.background.color}))),e.colorsV2.accentPrimary?.type==="themed"?(e.colorsV2.accentPrimary.dark!=null&&i.accentPrimary==null&&(t=!0,i.accentPrimary=e.colorsV2.accentPrimary.dark),e.colorsV2.accentPrimary.light!=null&&n.accentPrimary==null&&(r=!0,n.accentPrimary=e.colorsV2.accentPrimary.light)):e.colorsV2.accentPrimary?.type==="unthemed"&&e.colorsV2.accentPrimary.color!=null&&(i.accentPrimary==null&&(i.accentPrimary=e.colorsV2.accentPrimary.color),n.accentPrimary==null&&(n.accentPrimary=e.colorsV2.accentPrimary.color))),e.colors!=null&&e.colors.accentPrimary!=null&&(i.accentPrimary==null&&(i.accentPrimary=e.colors.accentPrimary),n.accentPrimary==null&&(n.accentPrimary=e.colors.accentPrimary)),e.logoV2!=null&&(i.logo==null&&(i.logo=e.logoV2.dark),n.logo==null&&(n.logo=e.logoV2.light)),e.logo!=null&&(i.logo==null&&(i.logo=e.logo),n.logo==null&&(n.logo=e.logo)),e.backgroundImage!=null&&(i.backgroundImage==null&&(i.backgroundImage=e.backgroundImage),n.backgroundImage==null&&(n.backgroundImage=e.backgroundImage));let a={...RfE,...i},o={...zfE,...n};return t&&r?{type:"darkAndLight",dark:a,light:o}:t?{type:"dark",...a}:r?{type:"light",...o}:{type:"darkAndLight",dark:a,light:o}}var FfE={};Di(FfE,{EMPTY_FRONTMATTER:()=>QfE,Layout:()=>Wzs,TwitterCardSetting:()=>Gzs,commons:()=>Xtp,frontmatter:()=>Vzs,getS3KeyForDynamicIr:()=>LfE,getS3KeyForV1DocsDefinition:()=>UfE,seo:()=>xzs});var QfE={title:void 0,headline:void 0,description:void 0,subtitle:void 0,layout:void 0,slug:void 0,image:void 0,"edit-this-page-url":void 0,"hide-toc":void 0,"force-toc":void 0,"max-toc-depth":void 0,"hide-nav-links":void 0,"hide-feedback":void 0,"hide-page-actions":void 0,"no-image-zoom":void 0,breadcrumb:void 0,excerpt:void 0,"canonical-url":void 0,"og:site_name":void 0,"og:title":void 0,"og:description":void 0,"og:url":void 0,"og:image":void 0,"og:image:width":void 0,"og:image:height":void 0,"og:locale":void 0,"og:logo":void 0,"twitter:title":void 0,"twitter:description":void 0,"twitter:handle":void 0,"twitter:image":void 0,"twitter:site":void 0,"twitter:url":void 0,"twitter:card":void 0,noindex:void 0,nofollow:void 0,"jsonld:breadcrumb":void 0,keywords:void 0,logo:void 0,tags:void 0,"last-updated":void 0};function UfE(e){return process.env.LOCAL_MODE_OVERRIDE==="true"?"v1/fdr.json":`${e}/v1/fdr.json`}function LfE({orgName:e,apiName:t,language:r}){return`${e}/${t}/${r}.json`}var Ct={};Di(Ct,{ApiDefinitionHolder:()=>F_e,ApiDefinitionId:()=>Rzt,ApiDefinitionPruner:()=>kfE,ApiId:()=>zzt,ApiTypeIdVisitor:()=>GBn,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,NodeCollector:()=>fNs,NodeId:()=>nip,OrgId:()=>Jzt,PageId:()=>$zt,ProductId:()=>aip,PropertyKey:()=>Yzt,Pruner:()=>BdE,RoleId:()=>Xzt,Slug:()=>oip,TabId:()=>uip,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,V1:()=>ynp,VariantId:()=>sip,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,getChildren:()=>aNs,getPageId:()=>rnp,hasMarkdown:()=>cnp,hasMetadata:()=>KfE,hasPointsTo:()=>lnp,hasRedirect:()=>JfE,isApiLeaf:()=>Zfo,isApiReferenceNode:()=>inp,isExternalProductNode:()=>VfE,isInternalProductNode:()=>WfE,isLeaf:()=>tnp,isMarkdownLeaf:()=>nNs,isNeighbor:()=>GfE,isPage:()=>HfE,isProductGroupNode:()=>nnp,isProductNode:()=>oNs,isSection:()=>snp,isSectionOverview:()=>uNs,isSidebarRootNode:()=>x1s,isTabbedNode:()=>G1s,isUnversionedNode:()=>anp,isVariantNode:()=>onp,isVariantedNode:()=>xfE,isVersionNode:()=>unp,migrate:()=>qnp,slugjoin:()=>$fE,toDefaultSlug:()=>YfE,traverseBF:()=>XfE,traverseDF:()=>ZfE,utils:()=>Nnp});function W1s(e){return typeof e.subpackageId=="string"}function Zfo(e){return e.type==="endpoint"||e.type==="webSocket"||e.type==="webhook"||e.type==="grpc"}function nNs(e){return e.type==="page"||e.type==="landingPage"||e.type==="changelogEntry"}function tnp(e){return Zfo(e)||nNs(e)||e.type==="link"}function aNs(e){if(tnp(e))return[];switch(e.type){case"apiPackage":case"changelog":case"changelogMonth":case"changelogYear":case"section":case"sidebarGroup":case"sidebarRoot":case"tabbed":case"versioned":case"varianted":return e.children;case"product":case"root":case"tab":return[e.child];case"productLink":return[];case"variant":return e.children;case"apiReference":return[...e.children,...e.changelog?[e.changelog]:[]];case"endpointPair":return[e.nonStream,e.stream];case"productgroup":return[...e.landingPage?[e.landingPage]:[],...e.children];case"unversioned":case"version":return[...e.landingPage?[e.landingPage]:[],e.child];default:throw new enp.UnreachableCaseError(e)}}var nCs=e=>e.pageId,Mco=e=>e.overviewPageId,Dco=()=>{};function rnp(e){return jf(e)._visit({section:Mco,apiReference:Mco,changelog:Mco,apiPackage:Mco,changelogEntry:nCs,page:nCs,landingPage:nCs,endpoint:Dco,webSocket:Dco,webhook:Dco,grpc:Dco})}function inp(e){return e.type==="apiReference"}function VfE(e){return e.type==="productLink"}function WfE(e){return e.type==="product"}function nnp(e){return e.type==="productgroup"}function oNs(e){return e.type==="product"||e.type==="productLink"}function x1s(e){return e.type==="sidebarRoot"}function G1s(e){return e.type==="tabbed"}function anp(e){return e.type==="unversioned"}function xfE(e){return e?.type==="varianted"}function onp(e){return e?.type==="variant"}function unp(e){return e.type==="version"}function snp(e){return e.type==="section"||e.type==="apiReference"||e.type==="changelog"||e.type==="apiPackage"}function uNs(e){return snp(e)&&e.overviewPageId!=null}function cnp(e){return nNs(e)||uNs(e)}function GfE(e){return Zfo(e)||e.type==="page"||e.type==="changelog"||e.type==="changelogEntry"||uNs(e)}function HfE(e){return Zfo(e)||e.type==="changelog"||cnp(e)}function KfE(e){return typeof e.title=="string"&&typeof e.slug=="string"}function lnp(e){return e.type==="root"||e.type==="product"||e.type==="version"||e.type==="tab"||e.type==="section"||e.type==="apiReference"||e.type==="apiPackage"}function JfE(e){return lnp(e)?e.pointsTo!=null:!1}function $fE(...e){let t=e.filter(PBn).flatMap(n=>typeof n=="string"?[n.trim()]:n.map(a=>a.trim())).map(n=>decodeURIComponent(n)),i=((0,fnp.default)(t)??"").replaceAll("//*","/").replace(/^\//,"").replace(/\/$/,"");return i}function YfE(e,t,r){if(e!=null)return e.startsWith(r)?e.replace(new RegExp(`^${Ghi(r)}`),t).replace(/^\//,""):e}var dnp="skip",pnp=!1;function _np(e,t,r,i=n=>!0){let n=[[e,[]]];for(;n.length>0;){let[a,o]=n.shift()??[];if(!a)continue;let c=t(a,o??[]);if(c!==dnp){if(c===pnp)return;if(i(a))for(let f of[...r(a)])n.push([f,[...o??[],a]])}}}function XfE(e,t){return _np(e,t,aNs)}function hnp(e,t,r,i=n=>!0){let n=[[e,[]]];for(;n.length>0;){let[a,o]=n.pop()??[];if(!a)continue;let c=t(a,o??[]);if(c!==dnp){if(c===pnp)return;if(i(a))for(let f of[...r(a)].reverse())n.push([f,[...o??[],a]])}}}function ZfE(e,t){return hnp(e,t,aNs)}var F_e=class I_a{constructor(t){this.api=t,[t.rootPackage,...Object.values(t.subpackages)].forEach(r=>{let i=W1s(r)?r.subpackageId:Pzt;r.endpoints.forEach(n=>{this.#e.set(I_a.createEndpointId(n,i),n)}),r.websockets.forEach(n=>{this.#t.set(I_a.createWebSocketId(n,i),n)}),r.webhooks.forEach(n=>{this.#r.set(I_a.createWebhookId(n,i),n)})})}static create(t){return new I_a(t)}#e=new Map;#t=new Map;#r=new Map;get endpoints(){return this.#e}get webSockets(){return this.#t}get webhooks(){return this.#r}static createEndpointId(t,r=Pzt){return t.originalEndpointId??`${r}.${t.id}`}static createWebSocketId(t,r=Pzt){return`${r}.${t.id}`}static createWebhookId(t,r=Pzt){return`${r}.${t.id}`}static createGrpcId(t,r=Pzt){return`${r}.${t.id}`}},GBn=class tv{static visitEndpointDefinition(t,r){t.path.pathParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.queryParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.request!=null&&tv.visitHttpRequestBodyShape(t.request.type,r),t.response!=null&&tv.visitHttpResponseBodyShape(t.response.type,r),t.errorsV2!=null&&t.errorsV2.forEach(i=>{i.type!=null&&tv.visitTypeShape(i.type,r)})}static visitWebSocketChannel(t,r){t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.path.pathParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.queryParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.messages.forEach(i=>{tv.visitObjectOrReference(i.body,r)})}static visitWebhookDefinition(t,r){t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),tv.visitObjectOrReference(t.payload.type,r)}static visitHttpRequestBodyShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r),bytes:Zhi.noop,formData:i=>tv.visitFormDataRequest(i,r),fileUpload:i=>i.value!=null?tv.visitFormDataRequest(i.value,r):void 0})}static visitHttpResponseBodyShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r),fileDownload:Zhi.noop,streamingText:Zhi.noop,stream:i=>tv.visitObjectOrReference(i.shape,r),streamCondition:i=>{tv.visitObjectOrReference(i.response.shape,r),tv.visitObjectOrReference(i.streamResponse.shape,r)}})}static visitObjectOrReference(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r)})}static visitFormDataRequest(t,r){return t.properties.forEach(i=>jf(i)._visit({file:Zhi.noop,bodyProperty:n=>tv.visitTypeReference(n.valueType,r)}))}static visitTypeDefinition(t,r){return tv.visitTypeShape(t.shape,r)}static visitTypeShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),alias:i=>tv.visitTypeReference(i.value,r),enum:Zhi.noop,undiscriminatedUnion:i=>i.variants.forEach(n=>tv.visitTypeReference(n.type,r)),discriminatedUnion:i=>i.variants.forEach(n=>tv.visitObjectType(n.additionalProperties,r))})}static visitObjectType(t,r){t.extends.forEach(r),t.properties.forEach(i=>{tv.visitTypeReference(i.valueType,r)})}static visitTypeReference(t,r){return jf(t)._visit({id:i=>r(i.value),primitive:Zhi.noop,nullable:i=>tv.visitTypeReference(i.itemType,r),optional:i=>tv.visitTypeReference(i.itemType,r),list:i=>tv.visitTypeReference(i.itemType,r),set:i=>tv.visitTypeReference(i.itemType,r),map:i=>{tv.visitTypeReference(i.keyType,r),tv.visitTypeReference(i.valueType,r)},literal:Zhi.noop,unknown:Zhi.noop})}},kfE=class{constructor(e){this.api=e}prune(e){let t=this.pruneRootPackage(e),r=this.pruneSubpackages(e),i=this.pruneTypes(t,r,this.api.globalHeaders);return{id:this.api.id,rootPackage:t,subpackages:r,snippetsConfiguration:this.api.snippetsConfiguration,types:i,auth:this.api.auth,authSchemes:this.api.authSchemes,hasMultipleBaseUrls:this.api.hasMultipleBaseUrls,navigation:void 0,globalHeaders:this.api.globalHeaders}}pruneTypes(e,t,r){let i=new Set;r?.forEach(a=>{GBn.visitTypeReference(a.type,o=>i.add(o))}),i=this.expandTypeIds(i),[e,...Object.values(t)].forEach(a=>{a.types.forEach(o=>i.add(o))});let n={};return i.forEach(a=>{let o=this.api.types[a];o!=null&&(n[a]=o)}),n}expandTypeIds(e){let t=new Set,r=Array.from(e);for(;r.length>0;){let i=r.pop();if(i!=null&&!t.has(i)){t.add(i);let n=this.api.types[i];n&&GBn.visitTypeDefinition(n,a=>{r.push(a)})}}return t}pruneRootPackage(e){return this.prunePackage(e,this.api.rootPackage)}pruneSubpackages(e){let t={};for(let[r,i]of Object.entries(this.api.subpackages))t[r]=this.prunePackage(e,i,r);return t}prunePackage(e,t,r){let i=this.pruneEndpoints(e,t.endpoints,r),n=this.pruneWebSockets(e,t.websockets,r),a=this.pruneWebhooks(e,t.webhooks,r),o=new Set;i.forEach(f=>{GBn.visitEndpointDefinition(f,s=>o.add(s))}),n.forEach(f=>{GBn.visitWebSocketChannel(f,s=>o.add(s))}),a.forEach(f=>{GBn.visitWebhookDefinition(f,s=>o.add(s))});let c=this.expandTypeIds(o);return{...t,endpoints:i,websockets:n,webhooks:a,types:Array.from(c)}}pruneEndpoints(e,t,r){if(e.type!=="endpoint"&&e.type!=="endpointPair")return[];if(e.type==="endpointPair")return[...this.pruneEndpoints(e.stream,t,r),...this.pruneEndpoints(e.nonStream,t,r)];let i=e.endpointId,n=t.find(a=>F_e.createEndpointId(a,r)===i);return n?[n]:[]}pruneWebSockets(e,t,r){if(e.type!=="webSocket")return[];let i=e.webSocketId,n=t.find(a=>F_e.createWebSocketId(a,r)===i);return n?[n]:[]}pruneWebhooks(e,t,r){if(e.type!=="webhook")return[];let i=e.webhookId,n=t.find(a=>F_e.createWebhookId(a,r)===i);return n?[n]:[]}};function edE(e,t,r){if(e!=null)return Ct.traverseDF(e,i=>{if(Ct.hasMetadata(i)){let n=Ct.toDefaultSlug(i.slug,t,r);if(i.slug===n)return"skip";i.canonicalSlug=i.canonicalSlug??i.slug,i.slug=n}Ct.hasRedirect(i)&&(i.pointsTo=Ct.toDefaultSlug(i.pointsTo,t,r))}),e}var ynp={};Di(ynp,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,ApiReferenceNavigationConverter:()=>Pnp,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,NavigationV1Availability:()=>lip,NodeId:()=>fip,OrgId:()=>Jzt,PageId:()=>$zt,ProductId:()=>dip,PropertyKey:()=>Yzt,RoleId:()=>Xzt,Slug:()=>pip,SlugGenerator:()=>sNs,TabId:()=>_ip,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VariantId:()=>hip,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,convertAvailability:()=>tdE,followRedirect:()=>mzt,followRedirects:()=>jMi,getPageId:()=>fdE,hasMarkdown:()=>Bnp,hasMetadata:()=>Snp,hasRedirect:()=>_dE,isApiLeaf:()=>kfo,isLeaf:()=>Mnp,isMarkdownLeaf:()=>cNs,isNeighbor:()=>ddE,isPage:()=>pdE,isSection:()=>Dnp,isSectionOverview:()=>lNs,slugjoin:()=>hdE,toDefaultSlug:()=>ydE,toRootNode:()=>udE,traverseDF:()=>vdE});function tdE(e){if(e!=null)switch(e){case _i.Availability.Beta:return Ct.V1.NavigationV1Availability.Beta;case _i.Availability.Stable:return Ct.V1.NavigationV1Availability.Stable;case _i.Availability.GenerallyAvailable:return Ct.V1.NavigationV1Availability.GenerallyAvailable;case _i.Availability.Deprecated:return Ct.V1.NavigationV1Availability.Deprecated;case _i.Availability.InDevelopment:return Ct.V1.NavigationV1Availability.InDevelopment;case _i.Availability.PreRelease:return Ct.V1.NavigationV1Availability.PreRelease;default:throw new bnp.UnreachableCaseError(e)}}function Bco(e){return(0,Onp.default)("/",...e.map(t=>t.type==="literal"?t.value:`:${t.value}`))}vIn.default.extend(Anp.default);var H1s=class mnp{constructor(t,r,i){this.fullSlugMap=r,this.noindexMap=i,this.#e=t}static convert(t,r,i,n,a){return new mnp(a,r,i).convert(t,n)}#e;convert(t,r){return this.#e.with("log",i=>{let n=r.apply(t),a=t.pageId!=null?Ct.V1.PageId(t.pageId):void 0,o=a!=null?this.noindexMap[a]:void 0,c=a!=null?this.fullSlugMap[a]:void 0;return c!=null&&(n=r.set(c)),{id:i,type:"changelog",title:t.title??"Changelog",overviewPageId:a,noindex:o,slug:n.get(),icon:t.icon,hidden:t.hidden,children:this.convertYear(t.items,n),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}convertYear(t,r){let i=aCs(t.map(n=>this.convertChangelogEntry(n,r)),n=>n.date,"desc");return this.groupByYear(i,r)}groupByYear(t,r){let i=rdE(t);return aCs(Array.from(i.entries()).map(([n,a])=>this.#e.with(n.toString(),o=>{let c=r.append(n.toString());return{id:o,type:"changelogYear",title:n.toString(),year:n,slug:c.get(),icon:void 0,hidden:void 0,children:this.groupByMonth(a,c),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})),"year","desc")}groupByMonth(t,r){let i=idE(t);return aCs(Array.from(i.entries()).map(([n,[a,o]])=>this.#e.with(n.toString(),c=>({id:c,type:"changelogMonth",title:(0,vIn.default)(new Date(a,n-1)).format("MMMM YYYY"),month:n,slug:r.append(n.toString()).get(),icon:void 0,hidden:void 0,children:o,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))),"month","desc")}convertChangelogEntry(t,r){let i=vIn.default.utc(t.date);return this.#e.with(i.format("YYYY-M-D"),n=>{let a=Ct.V1.PageId(t.pageId),o=this.noindexMap[a];return{id:n,type:"changelogEntry",title:i.format("MMMM D, YYYY"),date:t.date,pageId:a,noindex:o,slug:r.append(i.format("YYYY/M/D")).get(),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,tags:t.tags}})}};function aCs(e,t,r="asc"){return e.concat().sort((i,n)=>{let a=typeof t=="function"?t(i):i[t],o=typeof t=="function"?t(n):n[t];return a<o?r==="asc"?-1:1:a>o?r==="asc"?1:-1:0})}function rdE(e){let t=new Map;for(let r of e){let i=vIn.default.utc(r.date).year(),n=t.get(i)??[];n.push(r),t.set(i,n)}return t}function idE(e){let t=new Map;for(let r of e){let i=vIn.default.utc(r.date),n=i.month()+1,a=i.year(),o=t.get(n)??[a,[]];o[1].push(r),t.set(n,o)}return t}var K1s=class{#e=[];with(e,t){this.#e.push(e);let r=t(this.#r());return this.#e.pop(),r}#t=new Set;#r(){let e=this.#e.join("."),t=e,r=0;for(;this.#t.has(t);)t=`${e}-${r}`,r++;return this.#t.add(t),Ct.V1.NodeId(t)}},sNs=class HBn{constructor(t,r,i,n){this.baseSlug=t,this.productSlug=r,this.versionSlug=i,this.slug=n}static init(t){return new HBn(t,void 0,void 0,t)}get(){return Ct.V1.Slug(Ct.V1.slugjoin(this.slug))}setProductSlug(t){if(this.productSlug!=null){if(this.productSlug===Ct.V1.slugjoin(this.baseSlug,t))return this;throw new Error("Product already set")}let r=Ct.V1.slugjoin(this.baseSlug,t);if(this.baseSlug===t)throw new Error("Product slug is the same as base slug");return new HBn(this.baseSlug,r,this.versionSlug,r)}setVersionSlug(t){if(this.versionSlug!=null){if(this.productSlug){let i=Ct.V1.slugjoin(this.productSlug,t);if(this.versionSlug===i)return this}else if(this.versionSlug===Ct.V1.slugjoin(this.baseSlug,t))return this;throw new Error("Version already set")}let r=this.productSlug?Ct.V1.slugjoin(this.productSlug,t):Ct.V1.slugjoin(this.baseSlug,t);if(this.baseSlug===t)throw new Error("Version slug is the same as base slug");return new HBn(this.baseSlug,this.productSlug,r,r)}append(t){return new HBn(this.baseSlug,this.productSlug,this.versionSlug,Ct.V1.slugjoin(this.slug,t))}set(t){t=Ct.V1.slugjoin(t);let r=a=>new HBn(this.baseSlug,this.productSlug,this.versionSlug,a),i=a=>a.substring(this.baseSlug.length),n=a=>this.productSlug&&a.startsWith(this.productSlug)?a.substring(this.productSlug.length):a;if(this.productSlug!=null&&this.versionSlug!=null){if(t.startsWith(this.productSlug)){let a=n(t);return r(Ct.V1.slugjoin(this.versionSlug,a))}if(this.baseSlug.length>0&&t.startsWith(this.baseSlug)){let a=i(t);return r(Ct.V1.slugjoin(this.baseSlug,a))}return r(Ct.V1.slugjoin(this.versionSlug,t))}return this.versionSlug!=null?t.startsWith(this.versionSlug)?r(t):this.baseSlug.length>0&&t.startsWith(this.baseSlug)?r(Ct.V1.slugjoin(this.versionSlug,i(t))):r(Ct.V1.slugjoin(this.versionSlug,t)):this.productSlug!=null?t.startsWith(this.productSlug)?r(t):this.baseSlug.length>0&&t.startsWith(this.baseSlug)?r(Ct.V1.slugjoin(i(t))):r(Ct.V1.slugjoin(this.productSlug,t)):this.baseSlug.length>0?t.startsWith(this.baseSlug)?r(t):r(Ct.V1.slugjoin(this.baseSlug,t)):r(t)}apply({fullSlug:t,urlSlug:r,skipUrlSlug:i}){return t!=null?this.set(t.join("/")):i?this:this.append(r)}},Pnp=class jnp{constructor(t,r,i={},n={},a=sNs.init(""),o=new K1s,c=!1,f=!1,s){this.apiSection=t,this.api=r,this.fullSlugMap=i,this.noindexMap=n,this.parentSlug=a,this.lexicographic=c,this.disableEndpointPairs=f,this.paginated=s,this.apiDefinitionId=Ct.V1.ApiDefinitionId(r.id),this.#e=F_e.create(r),this.#o=o}static convert(t,r,i,n,a,o,c,f,s){return new jnp(t,r,i,n,a,o??new K1s,c,f,s).convert()}apiDefinitionId;#e;#t=new Set;#r=new Set;#i=new Set;#n=new Set;#a=new Set;#o;convert(){return this.#o.with(this.apiSection.urlSlug,t=>{let r=this.apiSection.navigation?.summaryPageId!=null?Ct.V1.PageId(this.apiSection.navigation.summaryPageId):void 0,i=r!=null?this.noindexMap[r]:void 0,n=this.parentSlug.apply(this.apiSection),a=r!=null?this.fullSlugMap[r]:void 0;a!=null&&(n=this.parentSlug.set(a));let o=this.convertChildren(n),c=this.apiSection.changelog!=null?H1s.convert(this.apiSection.changelog,this.fullSlugMap,this.noindexMap,n,this.#o):void 0,f=Ct.V1.followRedirects(o)??c?.slug;return{id:t,type:"apiReference",title:this.apiSection.title,apiDefinitionId:Ct.V1.ApiDefinitionId(this.apiSection.api),overviewPageId:r,noindex:i,paginated:this.paginated??(this.apiSection.longScrolling===!1?!0:void 0),slug:n.get(),icon:this.apiSection.icon,hidden:this.apiSection.hidden,hideTitle:this.apiSection.flattened,showErrors:this.apiSection.showErrors,changelog:c,children:o,availability:void 0,pointsTo:f,playground:void 0,postmanCollectionUrl:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}convertChildren(t){return this.apiSection.navigation!=null?this.convertApiNavigationItems(this.apiSection.navigation.items,t,oQ.SubpackageId("root")):this.convertPackageToChildren(this.api.rootPackage,t)}convertEndpointNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"endpoint",title:r.name??Bco(r.path.parts),endpointId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,method:r.method,apiDefinitionId:this.apiDefinitionId,availability:Ct.V1.convertAvailability(r.availability),isResponseStream:r.response?.type.type==="stream",playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertGrpcNode(t,r,i,n){return this.#o.with(t,a=>({id:a,type:"grpc",title:r.name??Bco(r.path.parts),grpcId:t,slug:n.apply(r).get(),icon:void 0,hidden:void 0,method:i,apiDefinitionId:this.apiDefinitionId,availability:void 0,isResponseStream:!1,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertWebSocketNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"webSocket",title:r.name??Bco(r.path.parts),webSocketId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,apiDefinitionId:this.apiDefinitionId,availability:Ct.V1.convertAvailability(r.availability),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertWebhookNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"webhook",title:r.name??(0,gnp.default)("/",...r.path),webhookId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,method:r.method,apiDefinitionId:this.apiDefinitionId,availability:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertPackageToChildren(t,r){let i=[],n=W1s(t)?t.subpackageId:"__package__";for(;t.pointsTo!=null;){n=t.pointsTo;let o=this.api.subpackages[t.pointsTo];if(o==null)return[];t=o}if(this.#a.has(n))return i;t.endpoints.forEach(o=>{if(o.protocol?.type==="grpc"&&o.protocol.methodType!=null){let c=F_e.createGrpcId(o,n);if(this.#n.has(c))return;i.push(this.convertGrpcNode(c,o,o.protocol.methodType,r)),this.#n.add(c)}else{let c=F_e.createEndpointId(o,n);if(this.#t.has(c))return;i.push(this.convertEndpointNode(c,o,r)),this.#t.add(c)}}),t.websockets.forEach(o=>{let c=F_e.createWebSocketId(o,n);this.#r.has(c)||(i.push(this.convertWebSocketNode(c,o,r)),this.#r.add(c))}),t.webhooks.forEach(o=>{let c=F_e.createWebhookId(o,n);this.#i.has(c)||(i.push(this.convertWebhookNode(c,o,r)),this.#i.add(c))}),t.subpackages.forEach(o=>{let c=this.api.subpackages[o];if(c==null){console.error(`Subpackage ${o} not found in ${this.apiDefinitionId}`);return}let f=this.#o.with(o,s=>{let u=r.apply(c),l=this.convertPackageToChildren(c,u);if(l.length===0)return;let p=Ct.V1.followRedirects(l);return{id:s,type:"apiPackage",children:l,title:c.displayName??Jco(c.name),slug:u.get(),icon:void 0,hidden:void 0,overviewPageId:void 0,noindex:void 0,availability:void 0,apiDefinitionId:this.apiDefinitionId,pointsTo:p,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}});f!=null&&i.push(f)}),this.#a.add(n);let a=this.mergeEndpointPairs(i);return this.lexicographic&&a.sort((o,c)=>{let f=o.type==="endpointPair"?o.nonStream.title:o.title,s=c.type==="endpointPair"?c.nonStream.title:c.title;return f.localeCompare(s)}),a}convertApiNavigationItems(t,r,i){let n=[],a=i==="root"?this.api.rootPackage:this.api.subpackages[i];if(a==null)throw new Error(`${i} is not present within known subpackages: ${Object.keys(this.api.subpackages).join(", ")}`);for(;a.pointsTo!=null;)if(a=this.api.subpackages[a.pointsTo],a==null)return[];let o=W1s(a)?a.subpackageId:Pzt,c=new Map,f=new Map,s=new Map,u=new Map;return a.endpoints.forEach(l=>{c.set(l.id,l)}),a.websockets.forEach(l=>{f.set(l.id,l)}),a.webhooks.forEach(l=>{s.set(l.id,l)}),a.endpoints.forEach(l=>{l.protocol?.type==="grpc"&&u.set(l.id,l)}),t.forEach(l=>{jf(l,"type")._visit({page:p=>{n.push(this.#o.with(p.urlSlug,_=>{let h=Ct.V1.PageId(p.id),y=this.noindexMap[h];return{id:_,type:"page",title:p.title,pageId:h,noindex:y,slug:r.apply(p).get(),icon:p.icon,hidden:p.hidden,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}))},endpointId:p=>{let _=c.get(p.value);if(_==null){console.error(`Endpoint ${p.value} not found in ${o}`);return}if(_.protocol?.type==="grpc"){let h=F_e.createGrpcId(_,o);n.push(this.convertGrpcNode(h,_,_.protocol.methodType??"UNARY",r)),this.#n.add(h)}else{let h=F_e.createEndpointId(_,o);n.push(this.convertEndpointNode(h,_,r)),this.#t.add(h)}},websocketId:p=>{let _=f.get(p.value);if(_==null){console.error(`WebSocket ${p.value} not found in ${o}`);return}let h=F_e.createWebSocketId(_,o);n.push(this.convertWebSocketNode(h,_,r)),this.#r.add(h)},webhookId:p=>{let _=s.get(p.value);if(_==null){console.error(`Webhook ${p.value} not found in ${o}`);return}let h=F_e.createWebhookId(_,o);n.push(this.convertWebhookNode(h,_,r)),this.#i.add(h)},subpackage:({subpackageId:p,items:_,summaryPageId:h})=>{let y=this.api.subpackages[p];if(y==null){console.error(`Subpackage ${p} not found in ${o}`);return}let b=r.apply(y),v=h!=null?Ct.V1.PageId(h):void 0,O=v!=null?this.noindexMap[v]:void 0,A=v!=null?this.fullSlugMap[v]:void 0;A!=null&&(b=this.parentSlug.set(A)),this.#o.with(p,g=>{let m=this.convertApiNavigationItems(_,b,p);n.push({id:g,type:"apiPackage",children:m,title:y.displayName??Jco(y.name),slug:b.get(),icon:void 0,hidden:void 0,overviewPageId:v,noindex:O,availability:void 0,apiDefinitionId:this.apiDefinitionId,pointsTo:Ct.V1.followRedirects(m),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})})},_other:vnp.noop})}),n.push(...this.convertPackageToChildren(a,r)),this.mergeEndpointPairs(n)}mergeEndpointPairs(t){if(this.disableEndpointPairs)return t;let r=[],i=new Map;return t.forEach(n=>{if(n.type!=="endpoint"){r.push(n);return}let a=this.#e.endpoints.get(n.endpointId);if(a==null)throw new Error(`Endpoint ${n.endpointId} not found`);let o=`${a.method} ${Bco(a.path.parts)}`,c=i.get(o);if(i.set(o,n),c==null||r.indexOf(c)===-1||c.isResponseStream===n.isResponseStream){r.push(n);return}let f=r.indexOf(c),s=this.#o.with("endpoint-pair",u=>({id:u,type:"endpointPair",stream:n.isResponseStream?n:c,nonStream:n.isResponseStream?c:n}));r[f]=s}),r}};function ndE(e){let t=/^---\s*([\s\S]*?)\s*---/.exec(e.trimStart());if(!(!t||t[1]==null))return t[1]}function wnp(e){if(/noindex:\s*true/.test(e))return!0;if(/noindex:\s*false/.test(e))return!1}function adE(e){let t=e.match(/slug:\s*"?([^"\n\s]+)"?/);if(t!=null&&t[1]!=null)return Ct.V1.slugjoin(t[1])}var odE=class Enp{constructor(t,r,i,n,a,o,c,f,s){this.title=t,this.config=r,this.fullSlugMap=i,this.noindexMap=n,this.apis=a,this.basePath=o,this.lexicographic=c,this.disableEndpointPairs=f,this.paginated=s}static convert(t,r,i,n,a,o,c,f,s){return new Enp(t,r,i,n,a,o,c,f,s).convert()}#e=new K1s;convert(){return this.#e.with("root",t=>{let r=sNs.init(this.basePath??""),i=qlE(this.config,{versioned:o=>this.convertVersionedNavigationConfig(o,r),unversioned:o=>this.convertUnversionedNavigationConfig(o,r)}),n=Ct.V1.followRedirect(i);if(n!=null&&i.type==="versioned"){let o=i.children.find(c=>c.default);o!=null&&(n=Ct.V1.toDefaultSlug(n,r.get(),o.slug))}let a={id:t,type:"root",version:"v1",child:i,slug:r.get(),title:this.title??"Documentation",hidden:!1,icon:void 0,pointsTo:n,authed:void 0,viewers:void 0,orphaned:void 0,roles:void 0,featureFlags:void 0};return Ct.V1.traverseDF(a,(o,c)=>{Ct.V1.hasMetadata(o)&&c.some(f=>Ct.V1.hasMetadata(f)&&f.hidden)&&(o.hidden=!0)}),a})}convertVersionedNavigationConfig(t,r){return this.#e.with("",i=>{let n=t.versions.map((a,o)=>{let c=r.setVersionSlug(a.urlSlug);return this.#e.with(a.urlSlug,f=>{let s=this.convertUnversionedNavigationConfig(a.config,c),u=Ct.V1.followRedirect(s);return{id:f,type:"version",title:a.version,default:o===0,versionId:Ct.V1.VersionId(a.version),slug:c.get(),icon:void 0,hidden:!1,child:s.child,availability:Ct.V1.convertAvailability(a.availability),pointsTo:u,landingPage:s.landingPage,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,announcement:void 0}})});return{id:i,type:"versioned",children:n}})}convertUnversionedNavigationConfig(t,r){return this.#e.with("uv",i=>{let n=TlE(t,{tabbed:a=>({id:i,type:"tabbed",children:a.tabs.map(o=>{if(o.type==="group"||o.type==null)return this.#e.with(o.urlSlug,c=>{let f=r.apply(o),s=this.#e.with(o.urlSlug,l=>({id:l,type:"sidebarRoot",children:this.groupSidebarRootChildren(o.items.map(p=>this.convertNavigationItem(p,f)))})),u=Ct.V1.followRedirect(s);return{id:c,type:"tab",title:o.title,slug:f.get(),icon:o.icon,hidden:o.hidden,child:s,pointsTo:u,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}});if(o.type==="link")return this.#e.with("link",c=>({id:c,type:"link",title:o.title,url:Ct.V1.Url(o.url),icon:o.icon,target:o.target}));if(o.type==="changelog"){let c=r.apply(o);return H1s.convert(o,this.fullSlugMap,this.noindexMap,c,this.#e)}else{if(o.type==="changelogV3")return o.node;T7(o)}})}),untabbed:a=>({id:i,type:"sidebarRoot",children:this.groupSidebarRootChildren(a.items.map(o=>this.convertNavigationItem(o,r)))})});return{id:i,type:"unversioned",child:n,landingPage:this.#e.with("landing-page",a=>{if(t.landingPage==null)return;let o=Ct.V1.PageId(t.landingPage.id);return{id:a,type:"landingPage",pageId:o,title:t.landingPage.title,slug:r.apply(t.landingPage).get(),icon:t.landingPage.icon,hidden:t.landingPage.hidden,noindex:this.noindexMap[o],authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}groupSidebarRootChildren(t){let r=[];return t.forEach(i=>{if(i.type==="apiReference"){r.push(i);return}if(i.type==="section"&&!i.collapsed){r.push(i);return}let n=r.length>0?r[r.length-1]:void 0,a;n?.type==="sidebarGroup"?a=n:(a=this.#e.with("group",o=>({id:o,type:"sidebarGroup",children:[]})),r.push(a)),a.children.push(i)}),r}convertNavigationItem(t,r){return jf(t,"type")._visit({page:i=>this.#e.with(i.urlSlug,n=>{let a=Ct.V1.PageId(i.id);return{id:n,type:"page",pageId:a,title:i.title,slug:r.apply(i).get(),icon:i.icon,hidden:i.hidden,noindex:this.noindexMap[a],authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}),link:i=>this.#e.with(oC(i.title),n=>({id:n,type:"link",title:i.title,url:Ct.V1.Url(i.url),icon:i.icon,target:i.target})),section:i=>this.#e.with(i.urlSlug,n=>{let a=r.apply(i),o=i.items.map(l=>this.convertNavigationItem(l,a)),c=Ct.V1.followRedirects(o),f=i.overviewPageId!=null?Ct.V1.PageId(i.overviewPageId):void 0,s=f!=null?this.noindexMap[f]:void 0,u=f!=null?this.fullSlugMap[f]:void 0;return u!=null&&(a=r.set(u)),{id:n,type:"section",collapsed:i.collapsed,title:i.title,icon:i.icon,hidden:i.hidden,overviewPageId:f,noindex:s,slug:a.get(),children:o,pointsTo:c,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}),api:i=>{let n=this.apis[i.api];if(n==null)throw new Error(`API ${i.api} not found}`);return Pnp.convert(i,n,this.fullSlugMap,this.noindexMap,r,this.#e,this.lexicographic,this.disableEndpointPairs,this.paginated)},changelog:i=>H1s.convert(i,this.fullSlugMap,this.noindexMap,r,this.#e),apiV2:i=>{let n=i.node;return this.paginated&&(n.paginated=!0),n},changelogV3:i=>i.node,_other:i=>T7(i)})}};function udE(e,t=!1,r){let i={},n={};return Object.entries(e.definition.pages).forEach(([a,o])=>{let c=ndE(o.markdown);if(c==null)return;let f=wnp(c);f!=null&&(i[Ct.V1.PageId(a)]=f);let s=adE(c);s!=null&&(n[Ct.V1.PageId(a)]=s)}),e.definition.config.root?e.definition.config.root:e.definition.config.navigation?odE.convert(e.definition.config.title,e.definition.config.navigation,n,i,cdE(e.definition.apis,e.baseUrl.domain),e.baseUrl.basePath,sdE(e.baseUrl.domain),t,r):(console.error("No root node found"),{type:"root",version:"v1",child:{type:"unversioned",id:Ct.V1.NodeId("root-unversioned"),child:{type:"sidebarRoot",id:Ct.V1.NodeId("root-sidebar"),children:[]},landingPage:void 0},title:e.definition.config.title??"",slug:Ct.V1.Slug(""),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,id:Ct.V1.NodeId("root"),pointsTo:void 0,roles:void 0})}function sdE(e){return e.toLowerCase().includes("aia.docs.buildwithfern.com")}function cdE(e,t){return t.includes("assemblyai")?rQ(e,r=>ldE(r)):e}function ldE(e){let t=oQ.SubpackageId("subpackage_realtime"),r=oQ.SubpackageId("subpackage_streaming"),i=e.subpackages[t],n=e.subpackages[r];return i==null||n==null||(n.endpoints=[...i.endpoints,...n.endpoints],n.websockets=[...i.websockets,...n.websockets],n.webhooks=[...i.webhooks,...n.webhooks],delete e.subpackages[t],e.rootPackage.subpackages=e.rootPackage.subpackages.filter(a=>a!==t)),e}function Snp(e){return typeof e.title=="string"&&typeof e.slug=="string"}function mzt(e){if(e!=null)return jf(e)._visit({link:()=>{},page:t=>t.slug,changelog:t=>t.slug,changelogYear:t=>t.slug,changelogMonth:t=>t.slug,changelogEntry:t=>t.slug,endpoint:t=>t.slug,webSocket:t=>t.slug,webhook:t=>t.slug,grpc:t=>t.slug,landingPage:t=>t.slug,apiPackage:t=>t.overviewPageId!=null?t.slug:jMi(t.children),section:t=>t.overviewPageId!=null?t.slug:jMi(t.children),apiReference:t=>t.overviewPageId!=null?t.slug:jMi(t.children),product:t=>mzt(t.child),productLink:()=>{},productgroup:t=>mzt(t.landingPage??t.children.filter(r=>!r.hidden)[0]),versioned:t=>mzt(t.children.filter(r=>!r.hidden)[0]),unversioned:t=>mzt(t.landingPage??t.child),varianted:t=>mzt(t.children.filter(r=>!r.hidden)[0]),variant:t=>jMi(t.children),tabbed:t=>jMi(t.children),sidebarRoot:t=>jMi(t.children),endpointPair:t=>mzt(t.nonStream),root:t=>mzt(t.child),version:t=>mzt(t.child),tab:t=>mzt(t.child),sidebarGroup:t=>jMi(t.children)})}function jMi(e){for(let t of e){if(Snp(t)&&t.hidden)continue;let r=mzt(t);if(r!=null)return r}}var oCs=e=>e.pageId,Ico=e=>e.overviewPageId,ABn=()=>{};function fdE(e){return jf(e)._visit({section:Ico,apiReference:Ico,changelog:Ico,apiPackage:Ico,changelogEntry:oCs,page:oCs,landingPage:oCs,endpoint:ABn,webSocket:ABn,webhook:ABn,grpc:ABn,changelogYear:ABn,changelogMonth:ABn})}function kfo(e){return e.type==="endpoint"||e.type==="webSocket"||e.type==="webhook"||e.type==="grpc"}function cNs(e){return e.type==="page"||e.type==="landingPage"||e.type==="changelogEntry"}function Mnp(e){return kfo(e)||cNs(e)||e.type==="link"}function Dnp(e){return e.type==="section"||e.type==="apiReference"||e.type==="changelog"||e.type==="apiPackage"}function lNs(e){return Dnp(e)&&e.overviewPageId!=null}function Bnp(e){return cNs(e)||lNs(e)}function ddE(e){return kfo(e)||e.type==="page"||e.type==="changelog"||e.type==="changelogEntry"||lNs(e)}function pdE(e){return kfo(e)||e.type==="changelog"||Bnp(e)}function _dE(e){return typeof e.pointsTo=="string"}function hdE(...e){let t=e.map(n=>n.trim()),i=((0,Inp.default)(t)??"").replaceAll("//*","/").replace(/^\//,"").replace(/\/$/,"");return i}function ydE(e,t,r){if(e!=null)return e.startsWith(r)?e.replace(new RegExp(`^${Ghi(r)}`),t).replace(/^\//,""):e}function bdE(e){if(Mnp(e))return[];switch(e.type){case"apiPackage":case"changelog":case"changelogMonth":case"changelogYear":case"section":case"sidebarGroup":case"sidebarRoot":case"tabbed":case"versioned":case"varianted":case"variant":return e.children;case"product":case"root":case"tab":return[e.child];case"productLink":return[];case"apiReference":return[...e.children,...e.changelog?[e.changelog]:[]];case"endpointPair":return[e.nonStream,e.stream];case"productgroup":return[...e.landingPage?[e.landingPage]:[],...e.children];case"unversioned":case"version":return[...e.landingPage?[e.landingPage]:[],e.child];default:throw new Cnp.UnreachableCaseError(e)}}function vdE(e,t){return hnp(e,t,bdE)}var n9d=new WeakMap,fNs=class Kco{static EMPTY=new Kco(void 0);nodesInOrder=[];idToNode=new Map;idToNodeParents=new Map;slugToNode=new Map;orphanedNodes=[];static collect(t){if(t==null)return Kco.EMPTY;let r=n9d.get(t);if(r!=null)return r;let i=new Kco(t);return n9d.set(t,i),i}#e;#t;#r(t,r,i){let n={node:r,parents:i,prev:this.#t,next:void 0};this.slugToNode.set(t,n),Ct.isNeighbor(r)&&(this.#t=r,this.#e!=null&&(this.#e.next=r),this.#e=n)}versionNodes=[];defaultVersion;productNodes=[];defaultProduct;variantNodes=[];defaultVariant;constructor(t){t!=null&&Ct.traverseDF(t,(r,i)=>{if(r.type==="product"&&this.productNodes.push(r),r.type==="version"&&this.versionNodes.push(r),r.type==="variant"&&this.variantNodes.push(r),r.type==="version"&&r.default&&t.type==="root"){let n=i.find(oNs),a=JSON.parse(JSON.stringify(r)),o=n?.type==="product"?n.slug:t.slug;this.defaultVersion=edE(a,o,r.slug),Ct.traverseDF(this.defaultVersion,(c,f)=>{this.visitNode(c,[...i,...f],!0)})}this.visitNode(r,i)})}visitNode(t,r,i=!1){if((!this.idToNode.has(t.id)||i)&&(this.idToNode.set(t.id,t),this.idToNodeParents.set(t.id,r),this.nodesInOrder.push(t)),t.type==="sidebarRoot"&&(this.#e=void 0,this.#t=void 0),!Ct.hasMetadata(t)||t.type==="changelogMonth"||t.type==="changelogYear")return;let n=this.slugToNode.get(t.slug);n==null?this.#r(t.slug,t,r):!t.hidden&&Ct.isPage(t)&&(n.node.hidden||!Ct.isPage(n.node))?(this.orphanedNodes.push(n.node),this.#r(t.slug,t,r)):this.orphanedNodes.push(t)}getOrphanedNodes(){return this.orphanedNodes}getOrphanedPages=_Mi(()=>this.orphanedNodes.filter(Ct.isPage));getSlugMap=_Mi(()=>new Map([...this.slugToNode.entries()].map(([t,{node:r}])=>[t,r])));get slugMap(){return this.getSlugMap()}get defaultVersionNode(){return this.defaultVersion}get defaultProductNode(){return this.defaultProduct}get defaultVariantNode(){return this.defaultVariant}get(t){return this.idToNode.get(t)}getParents(t){return this.idToNodeParents.get(t)??UPw}getSlugMapWithParents=()=>this.slugToNode;#i=_Mi(()=>[...this.slugToNode.keys()]);get slugs(){return this.#i()}#n=_Mi(()=>Array.from(new Set([...this.slugToNode.values()].filter(({node:t})=>Ct.isPage(t)).filter(({node:t})=>!t.authed).map(({node:t})=>t.slug))));get staticPageSlugs(){return this.#n()}#a=_Mi(()=>Array.from(new Set([...this.slugToNode.values()].filter(({node:t})=>Ct.isPage(t)).filter(({node:t})=>!t.hidden&&!t.authed).filter(({node:t})=>Ct.hasMarkdown(t)?!t.noindex:!0).map(({node:t})=>t.canonicalSlug??t.slug))));get indexablePageSlugs(){return this.#a()}#o=_Mi(()=>{let t={};return[...this.slugToNode.values()].filter(({node:r})=>Ct.isPage(r)).filter(({node:r})=>!r.hidden).filter(({node:r})=>Ct.hasMarkdown(r)?!r.noindex:!0).forEach(r=>{let i=r.node.canonicalSlug??r.node.slug;i in t||(t[i]=r.node)}),Object.values(t)});get indexablePageNodesWithAuth(){return this.#o()}getProductNodes=()=>this.productNodes;getVersionNodes=()=>this.versionNodes;getVariantNodes=()=>this.variantNodes;getNodesInOrder=()=>this.nodesInOrder},qnp={};Di(qnp,{FernNavigationV1ToLatest:()=>Rnp});var Rnp=class znp{static create(){return new znp}constructor(){}#e;#t;#r;root=t=>(this.#e=Ct.Slug(t.slug),{type:"root",child:jf(t.child)._visit({versioned:i=>this.versioned(i,[t]),unversioned:i=>this.unversioned(i,[t]),productgroup:i=>this.productGroup(i,[t])}),version:"v2",title:t.title,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,viewers:t.viewers,orphaned:t.orphaned,roles:t.roles,featureFlags:t.featureFlags});versioned=(t,r)=>{if(t.children.length===0)return{type:"versioned",id:Ct.NodeId(t.id),children:[]};let i=t.children.findIndex(f=>f.default);i===-1&&(i=0);let n=t.children[i];if(!n)throw new Error("default version is undefined");this.#r=Ct.Slug(n.slug);let a=this.version(n,[...r,t]),o=[...t.children.slice(0,i).map(f=>this.version(f,[...r,t])),a,...t.children.slice(i+1).map(f=>this.version(f,[...r,t]))];return{type:"versioned",id:Ct.NodeId(t.id),children:o}};version=(t,r)=>{let i=t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0;return{type:"version",default:t.default,versionId:t.versionId,landingPage:i,child:jf(t.child)._visit({tabbed:a=>this.tabbed(a,[...r,t]),sidebarRoot:a=>this.sidebarRoot(a,[...r,t]),varianted:a=>this.varianted(a,[...r,t])}),availability:this.#s(t.availability),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement}};landingPage=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p([t.pageId,this.#d(t,r)],i);return{type:"landingPage",title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};tabbed=(t,r)=>({type:"tabbed",id:Ct.NodeId(t.id),children:t.children.map(n=>jf(n)._visit({tab:a=>this.tab(a,[...r,t]),link:a=>this.link(a,[...r,t]),changelog:a=>this.changelog(a,[...r,t])}))});varianted=(t,r)=>({type:"varianted",id:Ct.NodeId(t.id),children:t.children.map(n=>this.variant(n,[...r,t]))});variant=(t,r)=>{let i=t.children.map(o=>this.#i(o,[...r,t])),n=t.pointsTo?Ct.Slug(t.pointsTo):void 0;return n==null&&(n=this.#o(i)),{type:"variant",default:t.default,variantId:Ct.VariantId(t.variantId),subtitle:t.subtitle,image:t.image,children:i,title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:n,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};tab=(t,r)=>({type:"tab",child:this.sidebarRoot(t.child,[...r,t]),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});link=(t,r)=>({type:"link",id:Ct.NodeId(t.id),title:t.title,url:t.url,icon:t.icon,target:t.target});unversioned=(t,r)=>({type:"unversioned",child:jf(t.child)._visit({tabbed:n=>this.tabbed(n,[...r,t]),sidebarRoot:n=>this.sidebarRoot(n,[...r,t]),varianted:n=>this.varianted(n,[...r,t])}),landingPage:t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0,id:Ct.NodeId(t.id)});productGroup=(t,r)=>{let i=t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0;if(t.children.length===0)return{type:"productgroup",landingPage:i,id:Ct.NodeId(t.id),children:[]};let n=t.children.findIndex(s=>s.default);n===-1&&(n=0);let a=t.children[n];if(!a)throw new Error("default product is undefined");let o=this.product(a,[...r,t]),c=[...t.children.slice(0,n).map(s=>this.product(s,[...r,t])),o,...t.children.slice(n+1).map(s=>this.product(s,[...r,t]))];return{type:"productgroup",landingPage:i,children:c,id:Ct.NodeId(t.id)}};product=(t,r)=>jf(t)._visit({product:i=>this.internalProduct(i,r),productLink:i=>this.externalProduct(i)});internalProduct=(t,r)=>(this.#t=t.slug,{type:"product",id:Ct.NodeId(t.id),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,image:t.image,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,default:t.default,productId:Ct.ProductId(t.productId),child:jf(t.child)._visit({unversioned:n=>this.unversioned(n,[...r,t]),versioned:n=>this.versioned(n,[...r,t])}),subtitle:t.subtitle,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement});externalProduct=t=>({type:"productLink",id:Ct.NodeId(t.id),title:t.title,href:t.href,target:t.target,default:t.default,productId:Ct.ProductId(t.productId),subtitle:t.subtitle,icon:t.icon,image:t.image,hidden:t.hidden,authed:t.authed,viewers:t.viewers,orphaned:t.orphaned,featureFlags:void 0});sidebarRoot=(t,r)=>({type:"sidebarRoot",id:Ct.NodeId(t.id),children:t.children.map(n=>jf(n)._visit({sidebarGroup:a=>this.sidebarGroup(a,[...r,t]),apiReference:a=>this.apiReference(a,[...r,t]),section:a=>this.section(a,[...r,t]),varianted:a=>this.varianted(a,[...r,t])}))});sidebarGroup=(t,r)=>({type:"sidebarGroup",id:Ct.NodeId(t.id),children:t.children.map(n=>this.#n(n,[...r,t]))});page=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p([t.pageId,this.#d(t,r)],i);return{type:"page",id:Ct.NodeId(t.id),title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,availability:this.#s(t.availability)}};section=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"section",id:Ct.NodeId(t.id),children:t.children.map(c=>this.#n(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,collapsed:t.collapsed,overviewPageId:n,noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,availability:this.#s(t.availability)}};apiReference=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"apiReference",paginated:t.paginated,showErrors:t.showErrors,hideTitle:t.hideTitle,children:t.children.map(c=>this.#a(c,[...r,t])),changelog:t.changelog?this.changelog(t.changelog,[...r,t]):void 0,playground:t.playground,postmanCollectionUrl:t.postmanCollectionUrl,title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),overviewPageId:n,noindex:t.noindex,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};changelog=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p(n,i):void 0;return{type:"changelog",id:Ct.NodeId(t.id),children:t.children.map(c=>this.changelogYear(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,overviewPageId:n,noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};changelogYear=(t,r)=>({type:"changelogYear",id:Ct.NodeId(t.id),children:t.children.map(n=>this.changelogMonth(n,[...r,t])),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,year:t.year,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});changelogMonth=(t,r)=>({type:"changelogMonth",id:Ct.NodeId(t.id),children:t.children.map(n=>this.changelogEntry(n,[...r,t])),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,month:t.month,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});changelogEntry=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p(t.pageId,i);return{type:"changelogEntry",id:Ct.NodeId(t.id),title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,date:t.date,pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,tags:t.tags}};apiPackage=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"apiPackage",id:Ct.NodeId(t.id),children:t.children.map(c=>this.#a(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,playground:t.playground,overviewPageId:n,noindex:t.noindex,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};endpoint=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:endpoint:${t.method}:${t.endpointId}`,this.#d(t,r)],n);return{type:"endpoint",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,playground:t.playground,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,endpointId:t.endpointId,isResponseStream:t.isResponseStream,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};endpointPair=(t,r)=>({type:"endpointPair",id:Ct.NodeId(t.id),nonStream:this.endpoint(t.nonStream,[...r,t]),stream:this.endpoint(t.stream,[...r,t])});webSocket=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:websocket:${t.webSocketId}`,this.#d(t,r)],n);return{type:"webSocket",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,playground:t.playground,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),webSocketId:t.webSocketId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};webhook=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:webhook:${t.method}:${t.webhookId}`,this.#d(t,r)],n);return{type:"webhook",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,webhookId:t.webhookId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};grpc=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:grpc:${t.method}:${t.grpcId}`,this.#d(t,r)],n);return{type:"grpc",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,grpcId:t.grpcId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};#i=(t,r)=>jf(t)._visit({apiReference:i=>this.apiReference(i,r),section:i=>this.section(i,r),sidebarGroup:i=>this.sidebarGroup(i,r),link:i=>this.link(i,r),page:i=>this.page(i,r),changelog:i=>this.changelog(i,r)});#n=(t,r)=>jf(t)._visit({apiReference:i=>this.apiReference(i,r),section:i=>this.section(i,r),link:i=>this.link(i,r),page:i=>this.page(i,r),changelog:i=>this.changelog(i,r),varianted:i=>this.varianted(i,r)});#a=(t,r)=>jf(t)._visit({page:i=>this.page(i,r),link:i=>this.link(i,r),apiPackage:i=>this.apiPackage(i,r),endpoint:i=>this.endpoint(i,r),endpointPair:i=>this.endpointPair(i,r),webSocket:i=>this.webSocket(i,r),webhook:i=>this.webhook(i,r),grpc:i=>this.grpc(i,r)});#o=t=>{for(let r of t){if(Ct.isPage(r))return r.slug;let i=Ct.getChildren(r);if(i!=null&&i.length>0){let n=this.#o(i);if(n!=null)return n}}};#s(t){if(t!=null)switch(t){case"beta":return Ct.Availability.Beta;case"deprecated":return Ct.Availability.Deprecated;case"generally-available":return Ct.Availability.GenerallyAvailable;case"in-development":return Ct.Availability.InDevelopment;case"pre-release":return Ct.Availability.PreRelease;case"stable":return Ct.Availability.Stable;default:throw new Tnp.UnreachableCaseError(t)}}#u=new Map;#c=t=>{if(typeof t=="string")return this.#u.get(t);for(let r of t){let i=this.#u.get(r);if(i!==void 0)return i}};#f=(t,r)=>{let i=this.#t??""+this.#e,n=this.#r?r.replace(new RegExp(`(^|/)${this.#r}(/|$)`,"g"),`$1${i}$2`):r,a=Ct.Slug(n.replace(/^\//,""));if(typeof t=="string")return this.#u.set(t,a),a;for(let o of t)this.#u.set(o,a);return a};#p=(t,r)=>{if(t==null)return;let i=this.#c(t);return i??this.#f(t,r)};#d=(t,r)=>[...this.#_(r).filter(Ct.V1.hasMetadata).map(a=>a.title),t.title].join("###");#l=t=>[...this.#_(t).filter(n=>n.type==="apiReference").map(n=>n.title.replaceAll(" ",""))].join(":");#_=t=>{let r=t.findIndex(n=>n.type==="version");return r>=0?t.slice(r+1):t}},Nnp={};Di(Nnp,{collectApiReferences:()=>gdE,collectPageIds:()=>OdE,createBreadcrumb:()=>Fnp,findNode:()=>AdE,getApiReferenceId:()=>mdE,getNoIndexFromFrontmatter:()=>wnp,mutableUpdatePointsTo:()=>dNs,toApis:()=>PdE,toPages:()=>jdE,toRootNode:()=>EdE,toUnversionedSlug:()=>SdE});function gdE(e){let t=[];return Ct.traverseDF(e,r=>r.type==="apiReference"?(t.push(r),"skip"):!0),t}function OdE(e){let t=new Set;return Ct.traverseDF(e,r=>{if(Ct.isPage(r)){let i=rnp(r);i!=null&&t.add(i)}}),t}function Fnp(e){let t=[];return e.forEach(r=>{!Ct.hasMetadata(r)||Ct.isLeaf(r)||jf(r)._visit({root:KBn.noop,version:KBn.noop,variant:KBn.noop,tab:KBn.noop,product:KBn.noop,section:i=>{t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})},apiReference:i=>{i.hideTitle||t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})},changelog:i=>{t.push({title:i.title,pointsTo:i.slug})},changelogYear:i=>{t.push({title:i.title,pointsTo:i.slug})},changelogMonth:i=>{t.push({title:i.title,pointsTo:i.slug})},apiPackage:i=>{t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})}})}),t.filter(r=>r.title.trim().length>0)}function AdE(e,t){let r=fNs.collect(e),i=r.getSlugMapWithParents().get(t);if(i==null){let h=e,y=!1;for(let b of r.getProductNodes())if(b.type==="product"&&t.startsWith(b.slug)){h=b,y=!0;break}if(!y){for(let b of r.getVersionNodes())if(t.startsWith(b.slug)){h=b;break}}return{type:"notFound",redirect:h.type==="root"||h.type==="product"||h.type==="version"?h.pointsTo:void 0,authed:h.authed}}let n=i.parents.find(x1s),a=i.parents.find(nnp),o=i.parents.find(oNs),c=i.parents.find(unp),f=i.parents.find(anp),s=(c??f)?.child,u=i.parents.find(onp);!n&&c!=null&&x1s(c.child)&&(n=c.child);let l=(a??c??f)?.landingPage,p=i.parents.find(G1s)??(s!=null&&G1s(s)?s:void 0),_=i.parents.find(inp)??(i.node.type==="apiReference"?i.node:void 0);if(Ct.isPage(i.node)){let h=[...i.parents,i.node],y=h.findIndex(M=>M===p),b=y!==-1?h[y+1]:void 0,v=r.getProductNodes().map(M=>M.default?M.id===o?.id?o:r.defaultProductNode??M:M),O=r.getVersionNodes().map(M=>M.default?M.id===c?.id?c:r.defaultVersionNode??M:M),A=r.getVariantNodes().map(M=>M.default?M.id===u?.id?u:r.defaultVariantNode??M:M),g=b?.type==="tab"||b?.type==="changelog"?b:void 0,m=u?.slug??(o?.type==="product"?o.slug:void 0)??c?.slug??e.slug,j=Ct.Slug(i.node.slug.replace(new RegExp(`^${Ghi(m)}/`),""));return{type:"found",node:i.node,breadcrumb:Fnp(i.parents),parents:i.parents,root:e,versions:O,tabs:p?.children??[],products:v,currentProduct:o,currentVersion:c,isCurrentProductDefault:o?.default?o===r.defaultProductNode:!1,isCurrentVersionDefault:c?.default?c===r.defaultVersionNode:!1,variants:A,currentVariant:u,isCurrentVariantDefault:u?.default?u===r.defaultVariantNode:!1,currentTab:g,sidebar:n,apiReference:_,landingPage:l,next:i.next,prev:i.prev,collector:r,unversionedSlug:j}}if(e.type==="root"&&e.slug===t&&e.pointsTo!=null)return{type:"redirect",redirect:e.pointsTo};if(Ct.hasRedirect(i.node)&&i.node.pointsTo!=null)return{type:"redirect",redirect:i.node.pointsTo};if(i.node.type==="variant"&&(i.node.pointsTo==null||i.node.pointsTo===void 0)){let h=Qnp(i.node);if(h!=null)return{type:"redirect",redirect:h}}return{type:"notFound",redirect:c?.pointsTo??e.pointsTo,authed:i.node.authed}}function Qnp(e){if(Ct.isPage(e))return e.slug;let t=Ct.getChildren(e);if(t!=null)for(let r of t){let i=Qnp(r);if(i!=null)return i}}var tB=()=>{},mBn=e=>e.apiDefinitionId;function mdE(e){if(e!=null)return jf(e)._visit({root:tB,versioned:tB,varianted:tB,tabbed:tB,sidebarRoot:tB,sidebarGroup:tB,version:tB,variant:tB,tab:tB,link:tB,page:tB,section:tB,changelog:tB,changelogYear:tB,changelogMonth:tB,changelogEntry:tB,product:tB,productLink:tB,productgroup:tB,apiReference:mBn,endpoint:mBn,endpointPair:t=>t.nonStream.apiDefinitionId,webSocket:mBn,webhook:mBn,grpc:mBn,apiPackage:mBn,unversioned:tB,landingPage:tB})}function PdE(e){return{...rQ(e.definition.apis,t=>gIn.ApiDefinitionV1ToLatest.from(t).migrate()),...e.definition.apisV2}}function jdE(e){return rQ(e.definition.pages,t=>t.markdown)}function Lnp(e){if(e!=null){if(Ct.isPage(e)&&!e.authed)return e.slug;if(!Ct.isLeaf(e))switch(e.type){case"productgroup":case"versioned":return a9d([...e.children].sort(wdE));case"apiReference":case"apiPackage":case"changelogMonth":case"changelogYear":case"endpointPair":case"product":case"productLink":case"root":case"section":case"sidebarRoot":case"sidebarGroup":case"tab":case"tabbed":case"unversioned":case"version":case"changelog":case"varianted":case"variant":return a9d(Ct.getChildren(e));default:throw new Unp.UnreachableCaseError(e)}}}function a9d(e){for(let t of e){if(Ct.hasMetadata(t)&&t.hidden)continue;let r=Lnp(t);if(r!=null)return r}}function o9d(e){return e.default&&!e.hidden?1:e.hidden?-1:0}function wdE(e,t){return o9d(t)-o9d(e)}function dNs(e){let r=fNs.collect(e).getSlugMapWithParents();Ct.traverseDF(e,i=>{if(Ct.hasPointsTo(i)){let n=Lnp(i);if(n!=null)if(i.type==="root"){let a=r.get(n)?.node;a!=null&&(i.pointsTo=a.canonicalSlug??(i.slug===a.slug?void 0:a.slug))}else i.pointsTo=i.slug===n?void 0:n;else i.pointsTo=void 0}})}function EdE(e,t=!1){let r=Ct.V1.toRootNode(e,t),i=Rnp.create().root(r);return dNs(i),i}function SdE(e,t){return e.replace(new RegExp(`^${Ghi(t)}(/|$)`),"")}function MdE(e,t){let{predicate:r,getChildren:i,deleter:n,getPointer:a=f=>f}=t,o=new Set,c=[];return _np(e,(f,s)=>{c.unshift([f,s])},i),c.forEach(([f,s])=>{let u=[...s,f],l=u.findIndex(b=>o.has(a(b)));if(l!==-1){u.slice(l).forEach(b=>o.add(a(b)));return}if(r(f,s))return;let p=[...s],_=p.pop(),h=n(_,f),y=f;for(;h==="should-delete-parent"&&_!=null;)o.add(a(y)),y=_,h=n(p.pop(),_);h==="deleted"&&o.add(a(y))}),o.has(a(e))?[void 0,o]:[e,o]}function DdE(e,t){if(!Ct.isLeaf(t)&&Ct.isPage(t)&&Ct.getChildren(t).length>0&&t.type!=="changelog"){if(Ct.isSectionOverview(t))return t.overviewPageId=void 0,t.children.length===0?"deleted":"noop";throw new J1s.UnreachableCaseError(t)}if(!Ct.isLeaf(t)&&Ct.getChildren(t).length>0)return"noop";if(e==null)return"deleted";switch(e.type){case"apiPackage":e.children=e.children.filter(r=>r.id!==t.id);break;case"apiReference":e.children=e.children.filter(r=>r.id!==t.id),e.changelog=e.changelog?.id===t.id?void 0:e.changelog;break;case"changelog":e.children=e.children.filter(r=>r.id!==t.id);break;case"changelogYear":e.children=e.children.filter(r=>r.id!==t.id);break;case"changelogMonth":e.children=e.children.filter(r=>r.id!==t.id);break;case"endpointPair":return"should-delete-parent";case"productgroup":e.children=e.children.filter(r=>r.id!==t.id),e.landingPage=e.landingPage?.id===t.id?void 0:e.landingPage;break;case"product":case"productLink":case"root":return"should-delete-parent";case"unversioned":t.id===e.landingPage?.id&&(e.landingPage=void 0);break;case"section":e.children=e.children.filter(r=>r.id!==t.id);break;case"sidebarGroup":e.children=e.children.filter(r=>r.id!==t.id);break;case"tab":return"should-delete-parent";case"sidebarRoot":e.children=e.children.filter(r=>r.id!==t.id);break;case"tabbed":e.children=e.children.filter(r=>r.id!==t.id);break;case"version":t.id===e.landingPage?.id&&(e.landingPage=void 0);break;case"versioned":e.children=e.children.filter(r=>r.id!==t.id);break;case"varianted":e.children=e.children.filter(r=>r.id!==t.id);break;case"variant":e.children=e.children.filter(r=>r.id!==t.id);break;default:throw new J1s.UnreachableCaseError(e)}return Ct.isPage(e)?"noop":Ct.getChildren(e).length>0?"deleted":"should-delete-parent"}var BdE=class Vnp{static from(t){return new Vnp(t)}tree;constructor(t){this.tree=gAe(t)}keep(t){if(this.tree==null)return this;let[r]=MdE(this.tree,{predicate:t,getChildren:Ct.getChildren,getPointer:i=>i.id,deleter:DdE});return this.tree=r,this}remove(t){return this.keep((r,i)=>!t(r,i))}hide(t){return this.tree==null?this:(Ct.traverseBF(this.tree,(r,i)=>{Ct.hasMetadata(r)&&(r.hidden=t(r,i))}),this)}authed(t){if(this.tree==null)return this;let r=new Set;Ct.traverseBF(this.tree,(i,n)=>{if(Ct.hasMetadata(i)&&(i.authed=t(i,n)?!0:void 0,!i.authed))for(let a of n)r.add(a)});for(let i of r)Ct.hasMetadata(i)&&!Ct.isPage(i)&&(i.authed=void 0);return this}get(){if(this.tree!=null)return dNs(this.tree),this.tree}};var vdo=require("fs/promises");var _up=ue(require("path"),1);var xnp=require("fs/promises");var Wnp=100;async function IdE({files:e,absolutePathToFernFolder:t}){let r=await Promise.all(e.map(async i=>{let n=await(0,xnp.readFile)(i,"utf-8");return[j7(t,i),n]}));return Object.fromEntries(r)}async function Gnp({files:e,absolutePathToFernFolder:t}){let r={};for(let i=0;i<e.length;i+=Wnp){let n=e.slice(i,i+Wnp),a=await IdE({files:n,absolutePathToFernFolder:t});Object.assign(r,a)}return r}function tdo({landingPage:e,navigation:t}){return XOe([e?.absolutePath,...CdE(t)])}function CdE(e){switch(e.type){case"tabbed":return e.items.flatMap(t=>t.child.type==="layout"?t.child.layout.flatMap(r=>edo({item:r})):t.child.type==="variants"?t.child.variants.flatMap(r=>r.layout.flatMap(i=>edo({item:i}))):t.child.type==="changelog"?t.child.changelog:[]);case"untabbed":return e.items.flatMap(t=>edo({item:t}));case"versioned":return e.versions.flatMap(t=>tdo({landingPage:t.landingPage,navigation:t.navigation}));case"productgroup":return e.products.flatMap(t=>t.type==="external"?[]:tdo({landingPage:t.landingPage,navigation:t.navigation}));default:Ot(e)}}function edo({item:e}){switch(e.type){case"apiSection":return XOe([e.overviewAbsolutePath,...e.navigation.flatMap(t=>Hnp({item:t}))]);case"link":return[];case"page":return[e.absolutePath];case"section":return XOe([e.overviewAbsolutePath,...e.contents.flatMap(t=>edo({item:t}))]);case"changelog":return e.changelog;default:Ot(e)}}function Hnp({item:e}){return e.type==="page"?[e.absolutePath]:e.type==="package"||e.type==="section"?XOe([e.overviewAbsolutePath,...e.contents.flatMap(t=>Hnp({item:t}))]):[]}var DNs=require("fs/promises"),dup=ue(Q_e(),1);function pdo({name:e}){return e.replace(/\.(md|mdx)$/i,"").toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function _do({name:e}){return e.replace(/\.(md|mdx)$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}async function xhE({absolutePath:e,readFileFn:t=(r,i)=>(0,DNs.readFile)(r,i)}){try{let r=await t(e,"utf-8"),{data:i}=(0,dup.default)(r);if(i.position==null)return;let n=typeof i.position=="string"?parseFloat(i.position):i.position;return typeof n=="number"&&Number.isFinite(n)?n:void 0}catch{return}}async function BNs({directoryPath:e,getDir:t=rD,readFileFn:r=(i,n)=>(0,DNs.readFile)(i,n)}){let i=await t(e),n=i.filter(u=>u.type==="file"&&(u.name.endsWith(".md")||u.name.endsWith(".mdx"))),a=i.filter(u=>u.type==="directory"),o=await Promise.all(n.map(u=>xhE({absolutePath:u.absolutePath,readFileFn:r}))),c=n.map(u=>({type:"page",title:_do({name:u.name}),absolutePath:u.absolutePath,slug:pdo({name:u.name}),icon:void 0,hidden:void 0,noindex:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0})),f=await Promise.all(a.map(async u=>{let l=await BNs({directoryPath:u.absolutePath,getDir:t,readFileFn:r});return{type:"section",title:_do({name:u.name}),slug:pdo({name:u.name}),icon:void 0,contents:l,collapsed:void 0,hidden:void 0,skipUrlSlug:!1,overviewAbsolutePath:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}})),s=[...c.map((u,l)=>({item:u,title:u.type==="page"?u.title:"",position:o[l]})),...f.map(u=>({item:u,title:u.type==="section"?u.title:"",position:void 0}))];return s.sort((u,l)=>{let p=typeof u.position=="number",_=typeof l.position=="number";if(p&&!_)return-1;if(!p&&_)return 1;if(typeof u.position=="number"&&typeof l.position=="number"){let h=u.position-l.position;return h!==0?h:u.title.localeCompare(l.title,void 0,{sensitivity:"base"})}return u.title.localeCompare(l.title,void 0,{sensitivity:"base"})}),s.map(u=>u.item)}function GhE(e){return!e||e.startsWith("<")?!1:e.startsWith(".")||e.includes("/")||e.includes("\\")||e.includes(":")}function NE(e,t){if(e)return GhE(e)?nB(e,t):e}async function RNs({rawDocsConfiguration:e,absolutePathToFernFolder:t,absoluteFilepathToDocsConfig:r,context:i}){let{instances:n,title:a,tabs:o,products:c,versions:f,navigation:s,navbarLinks:u,footerLinks:l,defaultLanguage:p,metadata:_,redirects:h,logo:y,favicon:b,backgroundImage:v,colors:O,typography:A,layout:g,integrations:m,css:j,js:M,aiChat:E,aiSearch:D,pageActions:B,experimental:F}=e,N=xya(e.landingPage,r),R=nyE({tabs:o,products:c,versions:f,navigation:s,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}),z=R.then(Je=>Gnp({files:tdo({navigation:Je,landingPage:N}),absolutePathToFernFolder:t})),U=HhE(y,r),W=nB(b,r),K=KhE(v,r),fe=A!=null?ayE({rawTypography:A,absoluteFilepathToDocsConfig:r}):void 0,pe=JhE(j,r),L=XhE(M,r),G=jyE(_,r),[Re,le,De,Ke,se,ne]=await Promise.all([R,z,fe,pe,L,G]);return{title:a,instances:n,roles:e.roles,pages:le,landingPage:N,navigation:Re,navbarLinks:myE(u,r),footerLinks:PyE(l),defaultLanguage:p,languages:e.languages,announcement:e.announcement,metadata:ne,redirects:h?.map(Je=>({...Je,permanent:Je?.permanent})),logo:U,favicon:W,backgroundImage:K,colors:ONd(O,i),typography:De,layout:iyE(g),settings:ryE(e.settings),theme:tyE(e.theme),analyticsConfig:{...e.analytics,intercom:e.analytics?.intercom?{...e.analytics.intercom,appId:e.analytics.intercom.appId,apiBase:e.analytics.intercom.apiBase}:void 0,fullstory:e.analytics?.fullstory,posthog:e.analytics?.posthog?{...e.analytics.posthog,apiKey:e.analytics.posthog.apiKey,endpoint:e.analytics.posthog.endpoint}:void 0,segment:e.analytics?.segment,gtm:e.analytics?.gtm,ga4:e.analytics?.ga4,amplitude:void 0,mixpanel:void 0,hotjar:void 0,koala:void 0,logrocket:void 0,pirsch:void 0,plausible:void 0,fathom:void 0,clearbit:void 0,heap:void 0},integrations:{...m,intercom:m?.intercom?m.intercom:void 0},css:Ke,js:se,aiChatConfig:D??E,pageActions:ZhE(B,r),experimental:F}}function HhE(e,t){return e!=null?{dark:nB(e.dark,t),light:nB(e.light,t),height:e.height,href:e.href!=null?_i.Url(e.href):void 0,rightText:e.rightText}:void 0}function KhE(e,t){if(e!=null)if(typeof e=="string"){let r=nB(e,t);return{dark:r,light:r}}else{let r=nB(e.dark,t),i=nB(e.light,t);return{dark:r,light:i}}}async function JhE(e,t){if(e==null)return;let r=typeof e=="string"?[e]:e;return{inline:await Promise.all(r.map(async i=>(await(0,vdo.readFile)(nB(i,t))).toString()))}}function $hE(e){return Object.hasOwn(e,"url")}function YhE(e){return Object.hasOwn(e,"path")}async function XhE(e,t){let r=[],i=[];if(e==null)return{files:[]};let n=Array.isArray(e)?e:[e];for(let a of n)typeof a=="string"?i.push({absolutePath:nB(a,t)}):$hE(a)?r.push({strategy:a.strategy,url:_i.Url(a.url)}):YhE(a)&&i.push({absolutePath:nB(a.path,t),strategy:a.strategy});return{remote:r,files:i}}function ZhE(e,t){return e==null?void 0:{default:e.default!=null?khE(e.default):void 0,options:{askAi:e.options?.askAi??!0,copyPage:e.options?.copyPage??!0,viewAsMarkdown:e.options?.viewAsMarkdown??!0,openAi:e.options?.chatgpt??!1,claude:e.options?.claude??!1,cursor:e.options?.cursor??!1,vscode:e.options?.vscode??!1,custom:(e.options?.custom??[]).map(i=>eyE(i,t))}}}function khE(e){switch(e){case"copy-page":return _i.docs.v1.commons.PageActionOption.CopyPage;case"view-as-markdown":return _i.docs.v1.commons.PageActionOption.ViewAsMarkdown;case"ask-ai":return _i.docs.v1.commons.PageActionOption.AskAi;case"chatgpt":return _i.docs.v1.commons.PageActionOption.OpenAi;case"claude":return _i.docs.v1.commons.PageActionOption.Claude;case"cursor":return _i.docs.v1.commons.PageActionOption.Cursor;case"vscode":return _i.docs.v1.commons.PageActionOption.Vscode;default:Ot(e)}}function eyE(e,t){return{title:e.title,subtitle:e.subtitle,url:e.url,icon:NE(e.icon,t),default:e.default}}function tyE(e){if(e!=null)return{sidebar:e.sidebar??"default",tabs:e.tabs??"default",body:e.body??"default",pageActions:e.pageActions??"default",footerNav:e.footerNav??"default"}}function ryE(e){if(e!=null)return{darkModeCode:e.darkModeCode??!1,defaultSearchFilters:e.defaultSearchFilters??!1,language:e.language??"en",disableSearch:e.disableSearch??!1,hide404Page:e.hide404Page??!1,httpSnippets:e.httpSnippets??!0,searchText:e.searchText??void 0,useJavascriptAsTypescript:e.useJavascriptAsTypescript??!1,disableExplorerProxy:e.disableExplorerProxy??!1,disableAnalytics:e.disableAnalytics??!1}}function iyE(e){if(e!=null)return{pageWidth:e.pageWidth?.trim().toLowerCase()==="full"?{type:"full"}:hdo(e.pageWidth),contentWidth:hdo(e.contentWidth),sidebarWidth:hdo(e.sidebarWidth),headerHeight:hdo(e.headerHeight),searchbarPlacement:e.searchbarPlacement==="header"?_i.docs.v1.commons.SearchbarPlacement.Header:e.searchbarPlacement==="header-tabs"?_i.docs.v1.commons.SearchbarPlacement.HeaderTabs:_i.docs.v1.commons.SearchbarPlacement.Sidebar,tabsPlacement:e.tabsPlacement==="header"?_i.docs.v1.commons.TabsPlacement.Header:_i.docs.v1.commons.TabsPlacement.Sidebar,contentAlignment:e.contentAlignment==="left"?_i.docs.v1.commons.ContentAlignment.Left:_i.docs.v1.commons.ContentAlignment.Center,headerPosition:e.headerPosition==="static"?_i.docs.v1.commons.HeaderPosition.Absolute:_i.docs.v1.commons.HeaderPosition.Fixed,disableHeader:e.disableHeader??!1,hideNavLinks:e.hideNavLinks??!1,hideFeedback:e.hideFeedback??!1}}function hdo(e){if(e==null)return;let t=e.trim().toLowerCase(),r=t.match(/^(\d+)px$/);if(r!=null&&r[1]!=null)return{type:"px",value:parseFloat(r[1])};let i=t.match(/^(\d+)rem$/);if(i!=null&&i[1]!=null)return{type:"rem",value:parseFloat(i[1])}}async function pup({versions:e,absolutePathToFernFolder:t,context:r}){let i=[];for(let n of e){let a=wu(t,n.path),o=wi.load((await(0,vdo.readFile)(a)).toString()),c=[],f=kOe(o,[],c);c.length>0&&r.logger.warn(`Version file ${n.path} contained null/undefined sections that were ignored: ${c.map(l=>l.join(".")).join(", ")}`);let s=P7.RawSchemas.Serializer.VersionFileConfig.parseOrThrow(f),u=await TNs({tabs:s.tabs,rawNavigationConfig:s.navigation,absolutePathToFernFolder:t,absolutePathToConfig:a,context:r});i.push({landingPage:xya(s.landingPage,a),version:n.displayName,navigation:u,availability:n.availability,slug:n.slug,hidden:n.hidden,viewers:t3(n.viewers),orphaned:n.orphaned,featureFlags:e3(n.featureFlag),announcement:n.announcement})}return{type:"versioned",versions:i}}async function nyE({tabs:e,products:t,versions:r,navigation:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:o}){if(i!=null)return await TNs({tabs:e,rawNavigationConfig:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:o});if(t!=null){let c=[];for(let f of t){let s=f.image!=null?wu(n,f.image):void 0;if("path"in f){let u,l=wu(n,f.path),p=wi.load((await(0,vdo.readFile)(l)).toString()),_=[],h=kOe(p,[],_);_.length>0&&o.logger.warn(`Product file ${f.path} contained null/undefined sections that were ignored: ${_.map(b=>b.join(".")).join(", ")}`);let y=P7.RawSchemas.Serializer.ProductFileConfig.parseOrThrow(h);f.versions!=null&&f.versions.length>0?u=await pup({versions:f.versions,absolutePathToFernFolder:n,context:o}):u=await TNs({tabs:y.tabs,rawNavigationConfig:y.navigation,absolutePathToFernFolder:n,absolutePathToConfig:l,context:o}),c.push({type:"internal",landingPage:xya(y.landingPage,l),product:f.displayName,navigation:u,slug:f.slug,subtitle:f.subtitle,icon:NE(f.icon,a)||"fa-solid fa-code",image:s,viewers:t3(f.viewers),orphaned:f.orphaned,featureFlags:e3(f.featureFlag),announcement:f.announcement})}else if("href"in f&&f.href!=null)c.push({type:"external",product:f.displayName,href:f.href,target:f.target,subtitle:f.subtitle,icon:NE(f.icon,a)||"fa-solid fa-code",image:s,viewers:t3(f.viewers),orphaned:f.orphaned,featureFlags:e3(f.featureFlag)});else throw new Error("Invalid product configuration: product must have either 'path' or valid 'href' property")}return{type:"productgroup",products:c}}else if(r!=null)return await pup({versions:r,absolutePathToFernFolder:n,context:o});throw new Error("Unexpected. Docs have neither navigation or versions defined.")}function e3(e){if(e!=null)return typeof e=="string"?[{flag:e,match:!0,fallbackValue:void 0}]:Array.isArray(e)?e.map(t=>({flag:t.flag,match:t.match,fallbackValue:t.fallbackValue})):[{flag:e.flag,match:e.match??!0,fallbackValue:e.fallbackValue}]}async function ayE({rawTypography:e,absoluteFilepathToDocsConfig:t}){return{headingsFont:e.headingsFont!=null?await INs({rawFontConfig:e.headingsFont,absoluteFilepathToDocsConfig:t}):void 0,bodyFont:e.bodyFont!=null?await INs({rawFontConfig:e.bodyFont,absoluteFilepathToDocsConfig:t}):void 0,codeFont:e.codeFont!=null?await INs({rawFontConfig:e.codeFont,absoluteFilepathToDocsConfig:t}):void 0}}async function INs({rawFontConfig:e,absoluteFilepathToDocsConfig:t}){return{name:e.name,variants:await oyE(e,t),display:e.display,fallback:e.fallback,fontVariationSettings:e.fontVariationSettings}}function oyE(e,t){let r=[];return e.path!=null&&r.push({path:e.path,weight:e.weight,style:e.style}),e.paths?.forEach(i=>{typeof i=="string"?r.push({path:i,weight:e.weight,style:e.style}):r.push({path:i.path,weight:i.weight??e.weight,style:i.style??e.style})}),Promise.all(r.map(async i=>({absolutePath:nB(i.path,t),weight:uyE(i.weight),style:i.style})))}function uyE(e){return e==null?void 0:typeof e=="number"?[e.toString()]:e.split(/\D+/).filter(r=>r!==""&&["100","200","300","400","500","600","700","800","900"].includes(r))}async function syE({tabs:e,item:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){let a=e[t.tab];if(a==null)throw new Error(`Tab ${t.tab} is not defined in the tabs config.`);if(AyE(t)){let o=await Promise.all(t.variants.map(async c=>{let f=await Promise.all(c.layout.map(s=>bdo({rawConfig:s,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})));return{title:c.title,subtitle:c.subtitle,icon:NE(c.icon,i),layout:f,slug:c.slug,skipUrlSlug:c.skipSlug,hidden:c.hidden,default:c.default,viewers:t3(c.viewers),orphaned:c.orphaned,featureFlags:e3(c.featureFlag)}}));return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"variants",variants:o},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)}}if(OyE(t)){let o=await Promise.all(t.layout.map(c=>bdo({rawConfig:c,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})));return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"layout",layout:o},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)}}if(a.href!=null)return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"link",href:a.href,target:a.target},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)};if(a.changelog!=null)return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"changelog",changelog:await ZF(nB(a.changelog,i),"{md,mdx}")},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)};Ot(a)}async function TNs({tabs:e={},rawNavigationConfig:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){return gyE(t)?{type:"tabbed",items:await Promise.all(t.map(o=>syE({tabs:e,item:o,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}:{type:"untabbed",items:await Promise.all(t.map(a=>bdo({rawConfig:a,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}}var cyE="Changelog";async function lyE({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}){let n=nB(e.folder,r);await qi(n)||i.failAndThrow(`Folder not found: ${e.folder}`);let a=await BNs({directoryPath:n}),o=_up.default.basename(n),c=e.title??_do({name:o}),f=e.slug??pdo({name:o});return{type:"section",title:c,icon:NE(e.icon,r),contents:a,slug:f,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:void 0,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability}}async function bdo({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}){if(hup(e))return xya(e,r);if(dyE(e))return{type:"section",title:e.section,icon:NE(e.icon,r),contents:await Promise.all(e.contents.map(n=>bdo({rawConfig:n,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}))),slug:e.slug??void 0,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:nB(e.path,r),viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability};if(pyE(e))return{type:"apiSection",openrpc:e.openrpc,title:e.api,icon:NE(e.icon,r),apiName:e.apiName??void 0,audiences:e.audiences!=null?{type:"select",audiences:Gya(e.audiences)??[]}:{type:"all"},availability:e.availability,showErrors:e.displayErrors??!0,tagDescriptionPages:e.tagDescriptionPages??!1,snippetsConfiguration:e.snippets!=null?fyE({rawConfig:e.snippets}):void 0,postman:e.postman,navigation:e.layout?.flatMap(n=>ydo(n,r))??[],overviewAbsolutePath:nB(e.summary,r),collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,slug:e.slug,skipUrlSlug:e.skipSlug??!1,flattened:e.flattened??!1,alphabetized:e.alphabetized??!1,paginated:e.paginated??!1,playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)};if(yup(e))return{type:"link",text:e.link,url:e.href,icon:NE(e.icon,r),target:e.target};if(_yE(e))return{type:"changelog",changelog:await ZF(nB(e.changelog,r),"{md,mdx}"),hidden:e.hidden??!1,icon:NE(e.icon,r),title:e.title??cyE,slug:e.slug,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)};if(hyE(e))return await lyE({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i});Ot(e)}function xya(e,t){if(e!=null)return{type:"page",title:e.page,absolutePath:nB(e.path,t),slug:e.slug,icon:NE(e.icon,t),hidden:e.hidden,noindex:e.noindex,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability}}function ydo(e,t){return typeof e=="string"?[{type:"item",value:e}]:hup(e)?[xya(e,t)]:yup(e)?[{type:"link",text:e.link,url:e.href,icon:NE(e.icon,t),target:e.target}]:yyE(e)?[{type:"section",title:e.section,referencedSubpackages:e.referencedPackages??[],overviewAbsolutePath:nB(e.summary,t),contents:e.contents?.flatMap(r=>ydo(r,t))??[],slug:e.slug,hidden:e.hidden,skipUrlSlug:e.skipSlug,availability:e.availability,icon:NE(e.icon,t),playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)}]:byE(e)?[{type:"endpoint",endpoint:e.endpoint,title:e.title,icon:NE(e.icon,t),slug:e.slug,hidden:e.hidden,availability:e.availability,playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)}]:Object.entries(e).map(([r,i])=>vyE(i)?{type:"package",title:i.title,package:r,overviewAbsolutePath:nB(i.summary,t),contents:i.contents?.flatMap(n=>ydo(n,t))??[],slug:i.slug,hidden:i.hidden,skipUrlSlug:i.skipSlug,icon:NE(i.icon,t),playground:i.playground,availability:i.availability,viewers:t3(i.viewers),orphaned:i.orphaned,featureFlags:e3(i.featureFlag)}:{type:"package",title:void 0,package:r,overviewAbsolutePath:void 0,contents:i.flatMap(n=>ydo(n,t)),hidden:!1,slug:void 0,skipUrlSlug:!1,icon:void 0,playground:void 0,availability:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}function fyE({rawConfig:e}){return{python:e.python,typescript:e.typescript,go:e.go,java:e.java,ruby:e.ruby,csharp:e.csharp,php:e.php,swift:e.swift}}function hup(e){return $c(e)&&typeof e.page=="string"&&typeof e.path=="string"}function dyE(e){return e.section!=null}function pyE(e){return e.api!=null}function yup(e){return P7.RawSchemas,$c(e)&&typeof e.link=="string"&&typeof e.href=="string"}function _yE(e){return $c(e)&&typeof e.changelog=="string"}function hyE(e){return $c(e)&&typeof e.folder=="string"}function yyE(e){return $c(e)&&typeof e.section=="string"&&Array.isArray(e.contents)}function byE(e){return $c(e)&&typeof e.endpoint=="string"}function vyE(e){return!Array.isArray(e)}function nB(e,t){if(e!=null)return wu(Zi(t),e)}function gyE(e){return Array.isArray(e)&&e.length>0&&e[0].tab!=null}function OyE(e){return"layout"in e&&Array.isArray(e.layout)}function AyE(e){return"variants"in e&&Array.isArray(e.variants)}function myE(e,t){return e?.map(r=>{if(r.type==="github"){let n=r.value;return typeof n=="string"?{type:"github",url:_i.Url(n),viewers:void 0,target:void 0}:{type:"github",url:_i.Url(n.url),viewers:CNs(n.viewers),target:n.target}}let i=CNs(r.viewers);return r.type==="dropdown"?{type:"dropdown",text:r.text,icon:NE(r.icon,t),rightIcon:NE(r.rightIcon,t),rounded:r.rounded,viewers:i,links:r.links?.map(n=>({href:n.href,target:n.target,url:_i.Url(n.url??n.href??"/"),text:n.text,icon:NE(n.icon,t),rightIcon:NE(n.rightIcon,t),rounded:n.rounded,viewers:CNs(n.viewers)}))??[]}:{type:r.type,text:r.text,url:_i.Url(r.href??r.url??"/"),target:r.target,icon:NE(r.icon,t),rightIcon:NE(r.rightIcon,t),rounded:r.rounded,viewers:i}})}function CNs(e){if(e!=null)return Array.isArray(e)?e.map(t=>_i.RoleId(t)):[_i.RoleId(e)]}function PyE(e){if(e==null)return;let t=[];if(Object.keys(e).forEach(r=>{let i=e[r];i!=null&&t.push({type:r,value:_i.Url(i)})}),t.length!==0)return t}async function jyE(e,t){if(e!=null)return{"og:site_name":e.ogSiteName,"og:title":e.ogTitle,"og:description":e.ogDescription,"og:url":e.ogUrl,"og:image":await qNs(e.ogImage,t),"og:image:width":e.ogImageWidth,"og:image:height":e.ogImageHeight,"og:locale":e.ogLocale,"og:logo":await qNs(e.ogLogo,t),"twitter:title":e.twitterTitle,"twitter:description":e.twitterDescription,"twitter:image":await qNs(e.twitterImage,t),"twitter:handle":e.twitterHandle,"twitter:site":e.twitterSite,"twitter:url":e.twitterUrl,"twitter:card":e.twitterCard,nofollow:void 0,noindex:void 0,canonicalHost:e.canonicalHost}}async function qNs(e,t){if(e==null)return;if(e.startsWith("http"))return{type:"url",value:e};let r=nB(e,t);return await qi(r)?{type:"filepath",value:r}:{type:"url",value:e}}function t3(e){if(e!=null){if(typeof e=="string")return[_i.RoleId(e)];if(e.length!==0)return e.map(_i.RoleId)}}function Gya(e){if(e!=null){if(typeof e=="string")return[e];if(e.length!==0)return e}}var vup=require("fs/promises");var bup=qt.strictObject({organization:qt.string(),version:qt.string()});async function U_e({directory:e,context:t}){let r=It(e,Ze.of($F)),i=await(0,vup.readFile)(r),n=JSON.parse(i.toString()),a=await _uo({schema:bup,value:n,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:a,organization:a.organization,version:a.version}}var P={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",GO_FIBER:"fernapi/fern-go-fiber",RUBY_MODEL:"fernapi/fern-ruby-model",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",PHP_MODEL:"fernapi/fern-php-model",PHP_SDK:"fernapi/fern-php-sdk",RUST_MODEL:"fernapi/fern-rust-model",RUST_SDK:"fernapi/fern-rust-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client"};var Hya={[P.JAVA]:{version:"2.38.1"},[P.TYPESCRIPT_EXPRESS]:{version:"0.18.4",output:{location:"local-file-system",path:"../src/fern"}},[P.JAVA_MODEL]:{version:"1.0.0"},[P.JAVA_SDK]:{version:"2.38.1",output:{location:"local-file-system",path:"../sdks/java/src/main/java/"}},[P.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"}},[P.TYPESCRIPT]:{version:"0.0.247"},[P.TYPESCRIPT_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.TYPESCRIPT_NODE_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.TYPESCRIPT_BROWSER_SDK]:{version:"1.0.0",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.PYTHON_PYDANTIC]:{version:"1.4.7"},[P.PYTHON_FASTAPI]:{version:"1.7.0",output:{location:"local-file-system",path:"../src/fern"}},[P.PYTHON_SDK]:{version:"4.23.2",output:{location:"local-file-system",path:"../sdks/python"}},[P.GO_FIBER]:{version:"0.23.5"},[P.GO_MODEL]:{version:"0.23.5"},[P.GO_SDK]:{version:"1.4.0",output:{location:"local-file-system",path:"../sdks/go"},config:{module:{path:"sdk"}}},[P.RUBY_MODEL]:{version:"0.0.8"},[P.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[P.OPENAPI]:{version:"0.1.7",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[P.STOPLIGHT]:{version:"0.0.28",config:{format:"yaml"}},[P.POSTMAN]:{version:"0.4.0",output:{location:"local-file-system",path:"../postman"}},[P.OPENAPI_PYTHON_CLIENT]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[P.CSHARP_MODEL]:{version:"0.0.1"},[P.CSHARP_SDK]:{version:"2.0.2",output:{location:"local-file-system",path:"../sdks/csharp"}},[P.SWIFT_MODEL]:{version:"0.0.0"},[P.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}},[P.PHP_MODEL]:{version:"0.0.0"},[P.PHP_SDK]:{version:"1.16.3",output:{location:"local-file-system",path:"../sdks/php/sdk"}},[P.RUST_MODEL]:{version:"0.0.1",output:{location:"local-file-system",path:"../models/rust"}},[P.RUST_SDK]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/rust"}}};function NMi(e,t){let r=wyE(e);return r??t.failAndThrow("Unrecognized generator: "+e)}function wyE(e){if(e.startsWith("fernapi/")||(e=`fernapi/${e}`),EyE(e))return e}function EyE(e){return Object.values(P).includes(e)}var n_o=ue(Pba(),1),P_p=ue(m_e(),1);async function dNt({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:i,includeMajor:n,context:a}){let o=P_p.default.parse(i),c=new n_o.FernRegistryClient({environment:"https://registry.buildwithfern.com"});a?.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${n}, prior version: ${o}`);let f={generator:tDE(e,a),releaseTypes:[r??n_o.FernRegistry.generators.ReleaseType.Ga],cliVersion:t==="0.0.0"?void 0:t};!n&&o!=null&&(f.generatorMajorVersion=o.major);let s=await c.generators.versions.getLatestGeneratorRelease(f);if(s.ok)return s.body.version}function tDE(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-go-fiber":return"go-fiber";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":return"ruby-sdk";case"fern-ruby-model":return"ruby-model";case"fern-postman":return"postman";case"fern-openapi":return"openapi";case"fern-php-sdk":return"php-sdk";case"fern-php-model":return"php-model";case"fern-rust-sdk":return"rust-sdk";case"fern-rust-model":return"rust-model";case"fern-swift-sdk":return"swift-sdk";case"fern-swift-model":return"swift-model";default:return t?.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}async function j_p({generatorsConfiguration:e,groupName:t=e[hn.DEFAULT_GROUP_GENERATORS_CONFIG_KEY],context:r,update:i}){if(t==null)return r.failAndThrow("No group specified.");let n=e.groups??={},a=n[t];if(a==null){let o=n[t]??={generators:[]};await i(o,t)}else await i(a,t);return e}async function kQs({generatorName:e,generatorsConfiguration:t,groupName:r=t[HMn],context:i,cliVersion:n}){let a=NMi(e,i),o=Hya[a];return await j_p({generatorsConfiguration:t,groupName:r,context:i,update:async c=>{c.generators.some(f=>f.name===a)&&i.failAndThrow(`${e} is already installed in group ${r}.`),c.generators.push({name:a,...o,version:await dNt({cliVersion:n,generatorName:a,context:i,channel:void 0})??o.version})}})}var _Nt=require("fs/promises"),PGi=ue(require("path"),1);var hhp=require("buffer"),m_o=ue(R_p(),1),g_o=ue(zS(),1),ayp=require("child_process"),Vyp=ue(nUs(),1),kyp=require("path"),CCn=ue(nUs(),1),ybp=require("events"),wUs=Object.defineProperty,BDE=Object.getOwnPropertyDescriptor,EUs=Object.getOwnPropertyNames,IDE=Object.prototype.hasOwnProperty,Yn=(e,t)=>function(){return e&&(t=(0,e[EUs(e)[0]])(e=0)),t},CDE=(e,t)=>function(){return t||(0,e[EUs(e)[0]])((t={exports:{}}).exports,t),t.exports},dB=(e,t)=>{for(var r in t)wUs(e,r,{get:t[r],enumerable:!0})},qDE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of EUs(t))!IDE.call(e,n)&&n!==r&&wUs(e,n,{get:()=>t[n],enumerable:!(i=BDE(t,n))||i.enumerable});return e},oD=e=>qDE(wUs({},"__esModule",{value:!0}),e);function TDE(...e){let t=new String(e);return A_o.set(t,e),t}function y_o(e){return e instanceof String&&A_o.has(e)}function z_p(e){return A_o.get(e)||[]}var A_o,Sba=Yn({"src/lib/args/pathspec.ts"(){"use strict";A_o=new WeakMap}}),tbi,fDi=Yn({"src/lib/errors/git-error.ts"(){"use strict";tbi=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Mba,TCn=Yn({"src/lib/errors/git-response-error.ts"(){"use strict";fDi(),Mba=class extends tbi{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),php,_hp=Yn({"src/lib/errors/task-configuration-error.ts"(){"use strict";fDi(),php=class extends tbi{constructor(e){super(void 0,e)}}}});function yhp(e){return typeof e!="function"?mGi:e}function bhp(e){return typeof e=="function"&&e!==mGi}function vhp(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function ghp(e,t=0){return Ohp(e)&&e.length>t?e[t]:void 0}function AGi(e,t=0){if(Ohp(e)&&e.length>t)return e[e.length-1-t]}function Ohp(e){return E_o(e)}function Dba(e="",t=!0,r=`
1103
+ `+Q.prev}function Mi(Ft,Q){var Z=Je(Ft),ut=[];if(Z){ut.length=Ft.length;for(var yt=0;yt<Ft.length;yt++)ut[yt]=lt(Ft,yt)?Q(Ft[yt],Ft):""}var Wt=typeof z=="function"?z(Ft):[],Nt;if(W){Nt={};for(var $=0;$<Wt.length;$++)Nt["$"+Wt[$]]=Wt[$]}for(var Se in Ft)lt(Ft,Se)&&(Z&&String(Number(Se))===Se&&Se<Ft.length||W&&Nt["$"+Se]instanceof Symbol||(E.call(/[^\w$]/,Se)?ut.push(Q(Se,Ft)+": "+Q(Ft[Se],Ft)):ut.push(Se+": "+Q(Ft[Se],Ft))));if(typeof z=="function")for(var he=0;he<Wt.length;he++)fe.call(Ft,Wt[he])&&ut.push("["+Q(Wt[he])+"]: "+Q(Ft[Wt[he]],Ft));return ut}}),qzs=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){return typeof r=="string"||typeof r=="symbol"}}),IuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=xfo(),n=qzs();t.exports=function(a,o){if(!n(o))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+i(o));return a[o]}}),CuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Function.prototype.toString,i=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,a;if(typeof i=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw a}}),a={},i(function(){throw 42},null,n)}catch(g){g!==a&&(i=null)}else i=null;var o=/^\s*class\b/,c=function(g){try{var m=r.call(g);return o.test(m)}catch{return!1}},f=function(g){try{return c(g)?!1:(r.call(g),!0)}catch{return!1}},s=Object.prototype.toString,u="[object Object]",l="[object Function]",p="[object GeneratorFunction]",_="[object HTMLAllCollection]",h="[object HTML document.all class]",y="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),O=function(){return!1};typeof document=="object"&&(A=document.all,s.call(A)===s.call(document.all)&&(O=function(g){if((v||!g)&&(typeof g>"u"||typeof g=="object"))try{var m=s.call(g);return(m===_||m===h||m===y||m===u)&&g("")==null}catch{}return!1}));var A;t.exports=i?function(g){if(O(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;try{i(g,null,n)}catch(m){if(m!==a)return!1}return!c(g)&&f(g)}:function(g){if(O(g))return!0;if(!g||typeof g!="function"&&typeof g!="object")return!1;if(b)return f(g);if(c(g))return!1;var m=s.call(g);return m!==l&&m!==p&&!/^\[object HTML/.test(m)?!1:f(g)}}),Btp=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=CuE()}),quE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=IuE(),n=Btp(),a=qzs(),o=xfo();t.exports=function(c,f){if(!a(f))throw new r("Assertion failed: IsPropertyKey(P) is not true");var s=i(c,f);if(s!=null){if(!n(s))throw new r(o(f)+" is not a function: "+o(s));return s}}}),TuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=itp();t.exports=function(){return r()&&!!Symbol.toStringTag}}),Itp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=TuE()(),n,a,o,c;i&&(n=r("Object.prototype.hasOwnProperty"),a=r("RegExp.prototype.exec"),o={},f=function(){throw o},c={toString:f,valueOf:f},typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=f));var f,s=r("Object.prototype.toString"),u=Object.getOwnPropertyDescriptor,l="[object RegExp]";t.exports=i?function(p){if(!p||typeof p!="object")return!1;var _=u(p,"lastIndex"),h=_&&n(_,"value");if(!h)return!1;try{a(p,c)}catch(y){return y===o}}:function(p){return!p||typeof p!="object"&&typeof p!="function"?!1:s(p)===l}}),Ctp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=Itp(),n=r("RegExp.prototype.exec"),a=MR();t.exports=function(o){if(!i(o))throw new a("`regex` must be a RegExp");return function(c){return n(o,c)!==null}}}),RuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r,i){for(var n=0;n<r.length;n+=1)if(!i(r[n],n,r))return!1;return!0}}),zuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){if(r===null)return"Null";if(typeof r>"u")return"Undefined";if(typeof r=="function"||typeof r=="object")return"Object";if(typeof r=="number")return"Number";if(typeof r=="boolean")return"Boolean";if(typeof r=="string")return"String"}}),qtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=zuE();t.exports=function(i){return typeof i=="symbol"?"Symbol":typeof i=="bigint"?"BigInt":r(i)}}),NuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=xfo(),n=qzs(),a=qtp();t.exports=function(o,c){if(a(o)!=="Object")throw new r("Assertion failed: Type(O) is not Object");if(!n(c))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+i(c));return o[c]}}),FuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi();t.exports=r("%Math.min%")}),Ttp=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=Number.isNaN||function(r){return r!==r}}),QuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ttp();t.exports=function(i){return(typeof i=="number"||typeof i=="bigint")&&!r(i)&&i!==1/0&&i!==-1/0}}),Tzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%Math.abs%"),n=r("%Math.floor%"),a=Ttp(),o=QuE();t.exports=function(c){if(typeof c!="number"||a(c)||!o(c))return!1;var f=i(c);return n(f)===f}}),Rtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt(),i=MR(),n=Tzs(),a=r("String.prototype.slice");t.exports=function(o,c,f){if(typeof o!="string")throw new i("Assertion failed: `string` must be a String");if(typeof c!="string")throw new i("Assertion failed: `searchValue` must be a String");if(!n(f)||f<0)throw new i("Assertion failed: `fromIndex` must be a non-negative integer");var s=o.length;if(c===""&&f<=s)return f;for(var u=c.length,l=f;l<=s-u;l+=1){var p=a(o,l,l+u);if(p===c)return l}return-1}}),Rzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR();t.exports=function(i){if(i==null)throw new r(arguments.length>0&&arguments[1]||"Cannot call method on "+i);return i}}),zzs=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%String%"),n=MR();t.exports=function(a){if(typeof a=="symbol")throw new n("Cannot convert a Symbol value to a string");return i(a)}}),ztp=wn((e,t)=>{"use strict";Ir(),Cr();var r=Rzs(),i=zzs(),n=QVt(),a=n("String.prototype.replace"),o=/^\s$/.test("\u180E"),c=o?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,f=o?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var s=i(r(this));return a(a(s,c,""),f,"")}}),Ntp=wn((e,t)=>{"use strict";Ir(),Cr();var r=ztp(),i="\u200B",n="\u180E";t.exports=function(){return String.prototype.trim&&i.trim()===i&&n.trim()===n&&("_"+n).trim()==="_"+n&&(n+"_").trim()===n+"_"?String.prototype.trim:r}}),UuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Lfo(),i=Ntp();t.exports=function(){var n=i();return r(String.prototype,{trim:n},{trim:function(){return String.prototype.trim!==n}}),n}}),LuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ezs(),i=Lfo(),n=Rzs(),a=ztp(),o=Ntp(),c=UuE(),f=r(o()),s=function(u){return n(u),f(u)};i(s,{getPolyfill:o,implementation:a,shim:c}),t.exports=s}),VuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=xyi(),i=r("%Number%"),n=r("%RegExp%"),a=MR(),o=r("%parseInt%"),c=QVt(),f=Ctp(),s=c("String.prototype.slice"),u=f(/^0b[01]+$/i),l=f(/^0o[0-7]+$/i),p=f(/^[-+]0x[0-9a-f]+$/i),_=["\x85","\u200B","\uFFFE"].join(""),h=new n("["+_+"]","g"),y=f(h),b=LuE();t.exports=function v(O){if(typeof O!="string")throw new a("Assertion failed: `argument` is not a String");if(u(O))return i(o(s(O,2),2));if(l(O))return i(o(s(O,2),8));if(y(O)||p(O))return NaN;var A=b(O);return A!==O?v(A):i(O)}}),WuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=Tzs(),n=QVt(),a=n("String.prototype.slice");t.exports=function(o,c,f){if(typeof o!="string"||!i(c)||arguments.length>2&&!i(f))throw new r("`S` must be a String, and `inclusiveStart` and `exclusiveEnd` must be integers");return a(o,c,arguments.length>2?f:o.length)}}),xuE=wn((e,t)=>{"use strict";Ir(),Cr(),t.exports=function(r){return typeof r=="string"||typeof r>"u"}}),GuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=QVt()("String.prototype.slice");t.exports=function(i,n){return i===n?!0:i.length>n.length?!1:r(n,0,i.length)===i}}),HuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=MR(),i=Ctp(),n=RuE(),a=xfo(),o=NuE(),c=ftp(),f=FuE(),s=Rtp(),u=VuE(),l=WuE(),p=zzs(),_=qtp(),h=Tzs(),y=xuE(),b=GuE(),v=i(/^\$[0-9]/),O=i(/^\$[0-9][0-9]/);t.exports=function(A,g,m,j,M,E){if(typeof A!="string")throw new r("Assertion failed: `matched` must be a String");if(typeof g!="string")throw new r("Assertion failed: `str` must be a String");if(!h(m)||m<0)throw new r("Assertion failed: `position` must be a nonnegative integer, got "+a(m));if(!c(j)||!n(j,y))throw new r("Assertion failed: `captures` must be a possibly-empty List of Strings or `undefined`, got "+a(j));if(typeof M<"u"&&_(M)!=="Object")throw new r("Assertion failed: `namedCaptures` must be `undefined` or an Object");if(typeof E!="string")throw new r("Assertion failed: `replacementTemplate` must be a String");var D=g.length;if(m>D)throw new r("Assertion failed: position > stringLength, got "+a(m));for(var B=E,F="";B!=="";){var N,R,z;if(b("$$",B))N="$$",R="$";else if(b("$`",B))N="$`",R=l(g,0,m);else if(b("$&",B))N="$&",R=A;else if(b("$'",B)){N="$'";var U=A.length,W=m+U;R=l(g,f(W,D))}else if(v(B)){var K=O(B)?2:1,fe=l(B,1,1+K),pe=u(fe);if(pe<0||pe>99)throw new r("Assertion failed: `index` must be >= 0 and <= 99");var L=j.length;pe>L&&K===2&&(K=1,fe=l(fe,0,1),pe=u(fe)),N=l(B,0,1+K),1<=pe&&pe<=L?(z=j[pe-1],typeof z>"u"?R="":R=z):R=N}else if(b("$<",B)){var G=s(B,">",0);if(G===-1||typeof M>"u")N="$<",R=N;else{N=l(B,0,G+1);var Re=l(B,2,G);if(_(M)!=="Object")throw new r("Assertion failed: Type(namedCaptures) is not Object");z=o(M,Re),typeof z>"u"?R="":R=p(z)}}else N=l(B,0,1),R=N;var le=N.length;B=l(B,le),F+=R}return F}}),Ftp=wn((e,t)=>{"use strict";Ir(),Cr();var r=cuE(),i=quE(),n=HuE(),a=Btp(),o=Rzs(),c=zzs(),f=Rtp(),s=xyi(),u=QVt(),l=etp()(),p=Itp(),_=s("%Math.max%"),h=MR(),y=u("Array.prototype.push"),b=u("String.prototype.slice"),v=u("String.prototype.indexOf"),O=u("String.prototype.replace");t.exports=function(A,g){var m=o(this),j=p(A);if(j&&v(b(A,A.source.length+2),"g")===-1)throw new h("use .replace for a non-global regex. NOTE: this may be allowed in the future.");if(l&&Symbol.replace){if(A!=null){var M=i(A,Symbol.replace);if(typeof M<"u")return r(M,A,[m,g])}}else if(j)return O(m,A,g);var E=c(m),D=c(A),B=a(g);B||(g=c(g));for(var F=D.length,N=_(1,F),R=[],z=f(E,D,0);z!==-1;)y(R,z),z=f(E,D,z+N);for(var U=0,W="",K=0;K<R.length;K+=1){var fe;if(B)fe=c(r(g,void 0,[D,R[K],E]));else{if(typeof g!="string")throw new h("Assertion failed: `replaceValue` should be a string at this point");var pe=[];fe=n(D,E,R[K],pe,void 0,g)}var L=b(E,U,R[K]);W+=L+fe,U=R[K]+F}return U<E.length&&(W+=b(E,U)),W}}),Qtp=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ftp();t.exports=function(){return String.prototype.replaceAll||r}}),KuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Lfo(),i=Qtp();t.exports=function(){var n=i();return r(String.prototype,{replaceAll:n},{replaceAll:function(){return String.prototype.replaceAll!==n}}),n}}),JuE=wn((e,t)=>{"use strict";Ir(),Cr();var r=Ezs(),i=Lfo(),n=Ftp(),a=Qtp(),o=KuE(),c=r(n);i(c,{getPolyfill:a,implementation:n,shim:o}),t.exports=c});Ir();Cr();var kMV=hiE(JuE(),1),$uE=Object.defineProperty,YuE=Object.defineProperties,XuE=Object.getOwnPropertyDescriptors,x6d=Object.getOwnPropertySymbols,ZuE=Object.prototype.hasOwnProperty,kuE=Object.prototype.propertyIsEnumerable,G6d=(e,t,r)=>t in e?$uE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,esE=(e,t)=>{for(var r in t||(t={}))ZuE.call(t,r)&&G6d(e,r,t[r]);if(x6d)for(var r of x6d(t))kuE.call(t,r)&&G6d(e,r,t[r]);return e},tsE=(e,t)=>YuE(e,XuE(t)),rsE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"nuget",registryUrl:"",packageName:"",apiKeyEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},isE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},nsE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"maven",registryUrl:"",coordinate:"",usernameEnvironmentVariable:"",passwordEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},asE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},osE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"pypi",registryUrl:"https://pypi.org",packageName:"",usernameEnvironmentVariable:"",passwordEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},usE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"rubygems",registryUrl:"https://rubygems.org",packageName:"",apiKeyEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},ssE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:null},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},csE={irFilepath:"/fern/ir.json",output:{mode:{type:"github",repoUrl:"",version:"",publishInfo:{type:"npm",registryUrl:"https://registry.npmjs.org",packageName:"",tokenEnvironmentVariable:""}},path:"/fern/output",publishingMetadata:null,snippetFilepath:"/fern/snippet.json",snippetTemplateFilepath:"/fern/snippet-templates.json"},publish:null,customConfig:{},workspaceName:"",organization:"",environment:{_type:"local"},dryRun:!1,whitelabel:!1,writeUnitTests:!0,generateOauthClients:!0,generatePaginatedClients:!0},lsE=class{constructor(){this.REFERENCE_REGEX=/^(GET|POST|PUT|DELETE|PATCH)\s(\/[a-zA-Z0-9/{}_-]*)$/}validate(e){return this.REFERENCE_REGEX.test(e)?{type:"valid"}:{type:"invalid"}}tryParse(e){if(this.validate(e).type==="invalid")return;let r=e.match(this.REFERENCE_REGEX);if(!(!r?.[1]||!r?.[2]))return{method:r[1],path:r[2]}}},fsE=class{constructor({generator:e,endpoint:t}){this.generator=e,this.endpoint=t}async generate(e){let t=e??this.resolveDefaultRequestOrThrow();return this.generator.generate({endpoint:this.endpoint.location,baseURL:t.baseURL,environment:t.environment,auth:t.auth,pathParameters:t.pathParameters,queryParameters:t.queryParameters,headers:t.headers,requestBody:t.requestBody})}generateSync(e){let t=e??this.resolveDefaultRequestOrThrow();return this.generator.generateSync({endpoint:this.endpoint.location,baseURL:t.baseURL,environment:t.environment,auth:t.auth,pathParameters:t.pathParameters,queryParameters:t.queryParameters,headers:t.headers,requestBody:t.requestBody})}resolveDefaultRequestOrThrow(){var e;for(let t of(e=this.endpoint.examples)!=null?e:[])return tsE(esE({},t),{environment:void 0});throw new Error("No default example found for endpoint; please specify a request payload")}},dsE=class{constructor({config:e,language:t,ir:r}){this.config=e,this.language=t,this.ir=r,this.httpEndpointReferenceParser=new lsE}endpoint(e,t={}){let r=this.parseEndpointOrThrow({endpoint:e}),i=this.getGenerator({ir:this.ir}),n=this.resolveEndpointOrThrow({ir:this.ir,parsedEndpoint:r});return new fsE({generator:i,endpoint:n})}getGenerator({ir:e}){switch(this.language){case"python":return new D$w({ir:e,config:this.config});case"typescript":return new QoE({ir:e,config:this.config});case"java":return new yLw({ir:e,config:this.config});case"php":return new CGw({ir:e,config:this.config});case"ruby":return new ZZw({ir:e,config:this.config});case"csharp":return new kTw({ir:e,config:this.config});case"go":return new uNw({ir:e,config:this.config});case"swift":return new ZtE({ir:e,config:this.config});default:throw new Error(`Unsupported language: ${this.language}`)}}parseEndpointOrThrow({endpoint:e}){let t=this.httpEndpointReferenceParser.tryParse(e);if(t==null)throw new Error(`Invalid endpoint reference: "${e}"`);return t}resolveEndpointOrThrow({ir:e,parsedEndpoint:t}){for(let r of Object.values(e.endpoints))if(this.parsedEndpointMatches({endpoint:r,parsedEndpoint:t}))return r;throw new Error(`Failed to find endpoint identified by "${t.method} ${t.path}"`)}parsedEndpointMatches({endpoint:e,parsedEndpoint:t}){return e.location.method===t.method&&e.location.path===t.path}},psE=class{constructor(e){this.snippetInputs=e.snippetInputs}sdk(e,t={}){return this.getGeneratorForLanguage({language:e})}getGeneratorForLanguage({language:e}){let t=this.snippetInputs.find(i=>i.language===e);if(!t)throw new Error(`No configuration found for language: ${e}`);let r=this.getGeneratorConfigForLanguage({language:e,customConfig:t.ir.generatorConfig});return new dsE({config:r,language:e,ir:t.ir})}getGeneratorConfigForLanguage({language:e,customConfig:t}){var r,i,n,a,o,c;let s={python:osE,typescript:csE,java:nsE,php:asE,ruby:usE,csharp:rsE,go:isE,swift:ssE}[e];if(!s)throw new Error(`Unsupported language: ${e}`);return t?.apiName&&(s.workspaceName=t.apiName),t?.organization&&(s.organization=t.organization),t?.customConfig&&(s.customConfig=t.customConfig),t?.outputConfig&&s.output.mode.type==="github"&&t.outputConfig.type==="publish"&&(t.outputConfig.value.type==="maven"&&((r=s.output.mode.publishInfo)==null?void 0:r.type)==="maven"?s.output.mode.publishInfo.coordinate=t.outputConfig.value.coordinate:t.outputConfig.value.type==="nuget"&&((i=s.output.mode.publishInfo)==null?void 0:i.type)==="nuget"||t.outputConfig.value.type==="npm"&&((n=s.output.mode.publishInfo)==null?void 0:n.type)==="npm"||t.outputConfig.value.type==="pypi"&&((a=s.output.mode.publishInfo)==null?void 0:a.type)==="pypi"||t.outputConfig.value.type==="rubygems"&&((o=s.output.mode.publishInfo)==null?void 0:o.type)==="rubygems"?s.output.mode.publishInfo.packageName=t.outputConfig.value.packageName:e==="go"&&(s.output.mode.repoUrl=(c=t.outputConfig.value.repoUrl)!=null?c:"")),s}};function _sE(e,t,r,i){let n={httpVersion:"1.1",method:"GET",url:"",headers:[],headersSize:-1,queryString:[],cookies:[],bodySize:-1};n.url=I9d({endpoint:e,pathParameters:t.pathParameters}),n.method=e.method;let a=Wlo(t.queryParameters,e.queryParameters)??{};n.queryString=Object.entries(a).map(([f,s])=>({name:f,value:G9i(s)})),n.headers=Object.entries(t.headers??{}).map(([f,s])=>({name:f,value:G9i(s)}));let o=e.requests?.[0]?.contentType;if(i!=null)if(o==null&&(o=i.type==="json"?"application/json":"multipart/form-data"),n.postData={mimeType:o},i.value&&typeof i.value=="object"&&!Array.isArray(i.value)&&(i.value=Object.fromEntries(Object.entries(i.value).filter(([f,s])=>Array.isArray(s)||typeof s!="object"||s==null?!0:Object.keys(s).length>0))),i.type==="json")n.postData.text=JSON.stringify(i.value,null,2);else if(i.type==="form"){n.postData.params=[];for(let[f,s]of Object.entries(i.value))if(s.type==="json")n.postData.params.push({name:f,value:typeof s.value=="string"?s.value:JSON.stringify(s.value,null,2)});else if(s.type==="filename")n.postData.params.push({name:f,fileName:s.value});else if(s.type==="filenameWithData")n.postData.params.push({name:f,fileName:s.filename});else if(s.type==="filenames")for(let u of s.value)n.postData.params.push({name:f,fileName:u});else if(s.type==="filenamesWithData")for(let{filename:u}of s.value)n.postData.params.push({name:f,fileName:u})}else i.type==="bytes"&&(n.postData.params=[{name:"file",value:i.value.value}]);let c=e.auth?.[0]!=null?r[e.auth[0]]:void 0;return c!=null&&Cco(c)._visit({basicAuth:({usernameName:f="username",passwordName:s="password"})=>{n.headers.push({name:"Authorization",value:`Basic <${f}>:<${s}>`})},bearerAuth:({tokenName:f="token"})=>{n.headers.push({name:"Authorization",value:`Bearer <${f}>`})},header:({headerWireValue:f,nameOverride:s=f,prefix:u})=>{n.headers.push({name:f,value:u!=null?`${u} <${s}>`:`<${s}>`})},oAuth:f=>{Cco(f.value,"type")._visit({clientCredentials:s=>{Cco(s.value,"type")._visit({referencedEndpoint:()=>{n.headers.push({name:s.value.headerName||"Authorization",value:`${s.value.tokenPrefix?`${s.value.tokenPrefix??"Bearer"} `:""}<token>.`})}})}})}}),o!=null&&n.headers.push({name:"Content-Type",value:o}),n}var hsE=[{targetId:"python",clientId:"requests"},{targetId:"javascript",clientId:"fetch"},{targetId:"go",clientId:"native"},{targetId:"ruby",clientId:"native"},{targetId:"java",clientId:"unirest"},{targetId:"php",clientId:"guzzle"},{targetId:"csharp",clientId:"restsharp"},{targetId:"swift",clientId:"nsurlsession"}];async function ysE(e,t,r){return{...e,endpoints:await Promise.all(Object.entries(e.endpoints).map(async([i,n])=>{let a={};try{t&&(a=vsE({endpoint:n,dynamicIr:t}))}catch(o){console.log("[backfill] error creating dynamic snippet generators:",o)}return[i,{...n,examples:await Promise.all(n.examples?.map(o=>bsE(e,a,n,o,r))??[])}]})).then(i=>Object.fromEntries(i))}}async function bsE(e,t,r,i,{httpSnippets:n,alwaysEnableJavaScriptFetch:a}){let o={...i.snippets},c=l=>{(o[l.language]??=[]).push(l)},f=n!==!1,s=Array.isArray(n)?n:null,u=l=>f?s==null||s.includes(l):l==="curl";if(!o.curl?.length&&u("curl")){let l=r.auth?.[0],p=dTs(pTs(r,i,l!=null?e.auths[l]:void 0));c({name:void 0,language:"curl",install:void 0,code:p,generated:!0,description:void 0})}o.curl?.length&&!u("curl")&&delete o.curl;for(let[l,p]of Object.entries(t))if(!(!p||r.method==="HEAD"))try{let _,h=r.auth?.[0];if(h){let O=e.auths[h];O?.type==="bearerAuth"?_={type:"bearer",token:"YOUR_TOKEN_HERE"}:_=O}let y;i.requestBody!=null&&i.requestBody.type==="json"&&i.requestBody.value&&(typeof i.requestBody.value=="object"&&!Array.isArray(i.requestBody.value)?y=Object.fromEntries(Object.entries(i.requestBody.value).filter(([A,g])=>Array.isArray(g)||typeof g!="object"||g==null?!0:Object.keys(g).length>0)):y=i.requestBody.value);let b={baseURL:r?.environments?.find(O=>O.id===r.defaultEnvironment)?.baseUrl??r?.environments?.[0]?.baseUrl,auth:_,pathParameters:i.pathParameters,queryParameters:i.queryParameters,headers:i.headers,requestBody:y,method:r.method},v;try{v=p.generateSync(b)}catch(O){console.error("Failed to generate snippet:",O);continue}v?.snippet&&c({name:void 0,language:l,install:void 0,code:v.snippet,generated:!0,description:void 0})}catch(_){console.error(`Error generating ${l} snippet:`,_)}if(f){let l=new kso(_sE(r,i,e.auths,i.requestBody));for(let{clientId:p,targetId:_}of hsE){if(o[_]?.length||t[_==="javascript"?"typescript":_]||_==="javascript"&&o.typescript?.length&&!a||!u(_))continue;let h=await l.convert(_,p),y=typeof h=="string"?h:h?.[0];y!=null&&c({name:void 0,language:_,install:void 0,code:y,generated:!0,description:void 0})}}return{...i,snippets:o}}function vsE({endpoint:e,dynamicIr:t}){if(e.method==="HEAD")return{};let r=[],i={};t.typescript&&r.push({language:"typescript",ir:t.typescript}),t.python&&r.push({language:"python",ir:t.python}),t.java&&r.push({language:"java",ir:t.java}),t.ruby&&r.push({language:"ruby",ir:t.ruby}),t.swift&&r.push({language:"swift",ir:t.swift}),t.csharp&&r.push({language:"csharp",ir:t.csharp}),t.go&&r.push({language:"go",ir:t.go}),t.php&&r.push({language:"php",ir:t.php});let n=new psE({snippetInputs:r}),a=`${e.method} ${e.path.map(o=>o.type==="pathParameter"?`{${o.value}}`:o.value).join("")}`;if(t.typescript){let o=n.sdk("typescript");i.typescript=o?.endpoint(a)}if(t.python){let o=n.sdk("python");i.python=o?.endpoint(a)}if(t.java){let o=n.sdk("java");i.java=o?.endpoint(a)}if(t.ruby){let o=n.sdk("ruby");i.ruby=o?.endpoint(a)}if(t.swift){let o=n.sdk("swift");i.swift=o?.endpoint(a)}if(t.csharp){let o=n.sdk("csharp");i.csharp=o?.endpoint(a)}if(t.go){let o=n.sdk("go");i.go=o?.endpoint(a)}if(t.php){let o=n.sdk("php");i.php=o?.endpoint(a)}return i}var gsE=class Gco{static with(t){return new Gco({EndpointDefinition:t.EndpointDefinition??Lm,HttpRequest:t.HttpRequest??Lm,HttpResponse:t.HttpResponse??Lm,ErrorResponse:t.ErrorResponse??Lm,ExampleEndpointCall:t.ExampleEndpointCall??Lm,CodeSnippet:t.CodeSnippet??Lm,ErrorExample:t.ErrorExample??Lm,WebhookDefinition:t.WebhookDefinition??Lm,WebhookPayload:t.WebhookPayload??Lm,WebSocketChannel:t.WebSocketChannel??Lm,WebSocketMessage:t.WebSocketMessage??Lm,ExampleWebSocketSession:t.ExampleWebSocketSession??Lm,TypeDefinition:t.TypeDefinition??Lm,TypeShape:t.TypeShape??Lm,ObjectType:t.ObjectType??Lm,ObjectProperty:t.ObjectProperty??Lm,EnumValue:t.EnumValue??Lm,UndiscriminatedUnionVariant:t.UndiscriminatedUnionVariant??Lm,DiscriminatedUnionVariant:t.DiscriminatedUnionVariant??Lm,FormDataRequest:t.FormDataRequest??Lm,FormDataField:t.FormDataField??Lm,FormDataFile:t.FormDataFile??Lm,FormDataFiles:t.FormDataFiles??Lm})}static descriptions(t){function r(i,n){let a=i.description!=null?t(i.description,n):void 0;return{...i,description:a}}return Gco.with({EndpointDefinition:r,HttpRequest:r,HttpResponse:r,ErrorResponse:r,ExampleEndpointCall:r,CodeSnippet:r,ErrorExample:r,WebhookDefinition:r,WebhookPayload:r,WebSocketChannel:r,WebSocketMessage:r,ExampleWebSocketSession:r,TypeDefinition:r,ObjectProperty:r,EnumValue:r,UndiscriminatedUnionVariant:r,DiscriminatedUnionVariant:r,FormDataRequest:r,FormDataField:r,FormDataFile:r,FormDataFiles:r})}static keys(t){function r(i,n){return t(n),i}return Gco.with({EndpointDefinition:r,HttpRequest:r,HttpResponse:r,ErrorResponse:r,ExampleEndpointCall:r,CodeSnippet:r,ErrorExample:r,WebhookDefinition:r,WebhookPayload:r,WebSocketChannel:r,WebSocketMessage:r,ExampleWebSocketSession:r,TypeDefinition:r,TypeShape:r,ObjectType:r,ObjectProperty:r,EnumValue:r,UndiscriminatedUnionVariant:r,DiscriminatedUnionVariant:r,FormDataRequest:r,FormDataField:r,FormDataFile:r,FormDataFiles:r})}visitor;constructor(t){this.visitor=this.#e(t)}apiDefinition=t=>{let r=Object.entries(t.endpoints).map(([c,f])=>[c,this.visitor.EndpointDefinition(f,`${t.id}/endpoint/${c}`)]),i=Object.entries(t.websockets).map(([c,f])=>[c,this.visitor.WebSocketChannel(f,`${t.id}/websocket/${c}`)]),n=Object.entries(t.webhooks).map(([c,f])=>[c,this.visitor.WebhookDefinition(f,`${t.id}/webhoook/${c}`)]),a=Object.entries(t.types).map(([c,f])=>[c,this.visitor.TypeDefinition(f,`${t.id}/type-definition/${c}`)]),o=t.globalHeaders?.map(c=>this.visitor.ObjectProperty(c,`${t.id}/global-headers/${c.key}`))??[];return{id:t.id,endpoints:Object.fromEntries(r),websockets:Object.fromEntries(i),webhooks:Object.fromEntries(n),types:Object.fromEntries(a),globalHeaders:o,auths:t.auths,subpackages:t.subpackages,snippetsConfiguration:t.snippetsConfiguration}};#e=t=>({CodeSnippet:t.CodeSnippet,ErrorExample:t.ErrorExample,ExampleWebSocketSession:t.ExampleWebSocketSession,ObjectProperty:t.ObjectProperty,EnumValue:t.EnumValue,UndiscriminatedUnionVariant:t.UndiscriminatedUnionVariant,FormDataFile:t.FormDataFile,FormDataFiles:t.FormDataFiles,EndpointDefinition:(i,n)=>t.EndpointDefinition(this.endpoint(i,n),n),HttpRequest:(i,n)=>t.HttpRequest(this.httpRequest(i,n),n),HttpResponse:(i,n)=>t.HttpResponse(this.httpResponse(i,n),n),ErrorResponse:(i,n)=>t.ErrorResponse(this.errorResponse(i,n),n),ExampleEndpointCall:(i,n)=>t.ExampleEndpointCall(this.exampleEndpointCall(i,n),n),WebhookDefinition:(i,n)=>t.WebhookDefinition(this.webhookDefinition(i,n),n),WebhookPayload:(i,n)=>t.WebhookPayload(this.webhookPayload(i,n),n),WebSocketChannel:(i,n)=>t.WebSocketChannel(this.webSocketChannel(i,n),n),WebSocketMessage:(i,n)=>t.WebSocketMessage(this.webSocketMessage(i,n),n),TypeDefinition:(i,n)=>t.TypeDefinition(this.typeDefinition(i,n),n),TypeShape:(i,n)=>t.TypeShape(this.typeShape(i,n),n),ObjectType:(i,n)=>t.ObjectType(this.objectType(i,n),n),DiscriminatedUnionVariant:(i,n)=>t.DiscriminatedUnionVariant(this.objectType(i,n),n),FormDataRequest:(i,n)=>t.FormDataRequest(this.formDataRequest(i,n),n),FormDataField:(i,n)=>t.FormDataField(this.formDataField(i,n),n)});endpoint=(t,r)=>{let i=t.pathParameters?.map(l=>({...this.visitor.ObjectProperty(l,`${r}/path/${l.key}`),explode:l.explode}))??[],n=t.queryParameters?.map(l=>({...this.visitor.ObjectProperty(l,`${r}/query/${l.key}`),explode:l.explode}))??[],a=t.requestHeaders?.map(l=>this.visitor.ObjectProperty(l,`${r}/requestHeader/${l.key}`))??[],o=t.responseHeaders?.map(l=>this.visitor.ObjectProperty(l,`${r}/responseHeader/${l.key}`))??[],c=t.requests?.map((l,p)=>this.visitor.HttpRequest(l,`${r}/request/${p}`)),f=t.responses?.map((l,p)=>this.visitor.HttpResponse(l,`${r}/response/${p}/${l.statusCode}`)),s=t.errors?.map((l,p)=>this.visitor.ErrorResponse(l,`${r}/error/${p}/${l.statusCode}`))??[],u=t.examples?.map((l,p)=>this.visitor.ExampleEndpointCall(l,`${r}/example/${p}`))??[];return{...t,pathParameters:i.length>0?i:void 0,queryParameters:n.length>0?n:void 0,requestHeaders:a.length>0?a:void 0,responseHeaders:o.length>0?o:void 0,requests:c,responses:f,errors:s.length>0?s:void 0,examples:u.length>0?u:void 0}};httpRequest=(t,r)=>{let i=jf(t.body)._visit({object:n=>({...n,...this.visitor.ObjectType(n,`${r}/object`)}),alias:Lm,bytes:Lm,formData:n=>({...n,...this.visitor.FormDataRequest(n,`${r}/formdata`)})});return{...t,body:i}};formDataField=(t,r)=>jf(t)._visit({file:i=>({...i,...this.visitor.FormDataFile(i,`${r}/file/${i.key}`)}),files:i=>({...i,...this.visitor.FormDataFiles(i,`${r}/files/${i.key}`)}),property:i=>({...i,...this.visitor.ObjectProperty(i,`${r}/property/${i.key}`)})});httpResponse=(t,r)=>{let i=jf(t.body)._visit({object:n=>({...n,...this.visitor.ObjectType(n,`${r}/object`)}),alias:Lm,fileDownload:Lm,streamingText:Lm,stream:n=>({...n,shape:this.visitor.TypeShape(n.shape,`${r}/stream/shape`)}),empty:Lm});return{...t,body:i}};objectType=(t,r)=>{let i=t.properties.map(n=>this.visitor.ObjectProperty(n,`${r}/property/${n.key}`));return{...t,properties:i}};errorResponse=(t,r)=>{let i=t.shape?this.visitor.TypeShape(t.shape,`${r}/error/shape`):void 0,n=t.examples?.map((a,o)=>this.visitor.ErrorExample(a,`${r}/example/${o}`))??[];return{...t,shape:i,examples:n.length>0?n:void 0}};exampleEndpointCall=(t,r)=>{let i=Object.entries(t.snippets??{}).map(([a,o])=>[a,o.map((c,f)=>this.visitor.CodeSnippet(c,`${r}/snippet/${a}/${f}`))]).filter(([,a])=>a.length>0),n=Object.fromEntries(i);return{...t,snippets:i.length>0?n:void 0}};webhookDefinition=(t,r)=>{let i=t.payloads?.[0]!=null?this.visitor.WebhookPayload(t.payloads[0],`${r}/payload`):void 0,n=t.headers?.map(o=>this.visitor.ObjectProperty(o,`${r}/header/${o.key}`))??[],a=t.responses?.map((o,c)=>this.visitor.HttpResponse(o,`${r}/response/${c}/${o.statusCode}`));return{...t,payloads:i!=null?[i]:void 0,headers:n.length>0?n:void 0,responses:a}};webhookPayload=(t,r)=>{let i=this.visitor.TypeShape(t.shape,`${r}/shape`);return{...t,shape:i}};webSocketChannel=(t,r)=>{let i=t.pathParameters?.map(f=>({...this.visitor.ObjectProperty(f,`${r}/path/${f.key}`),explode:f.explode}))??[],n=t.queryParameters?.map(f=>({...this.visitor.ObjectProperty(f,`${r}/query/${f.key}`),explode:f.explode}))??[],a=t.requestHeaders?.map(f=>this.visitor.ObjectProperty(f,`${r}/requestHeader/${f.key}`))??[],o=t.messages.map(f=>this.visitor.WebSocketMessage(f,`${r}/message/${f.origin}/${f.type}`)),c=t.examples?.map((f,s)=>this.visitor.ExampleWebSocketSession(f,`${r}/example/${s}`))??[];return{...t,pathParameters:i.length>0?i:void 0,queryParameters:n.length>0?n:void 0,requestHeaders:a.length>0?a:void 0,messages:o,examples:c.length>0?c:void 0}};webSocketMessage=(t,r)=>{let i=this.visitor.TypeShape(t.body,`${r}/body`);return{...t,body:i}};typeShape=(t,r)=>jf(t)._visit({object:i=>({...i,...this.visitor.ObjectType(i,`${r}/object`)}),alias:Lm,enum:i=>({...i,values:i.values.map(n=>this.visitor.EnumValue(n,`${r}/enum/value/${n.value}`))}),undiscriminatedUnion:i=>({...i,variants:i.variants.map((n,a)=>this.visitor.UndiscriminatedUnionVariant(n,`${r}/undiscriminatedUnion/variant/${a}`))}),discriminatedUnion:i=>({...i,variants:i.variants.map(n=>this.visitor.DiscriminatedUnionVariant(n,`${r}/discriminatedUnion/variant/${n.discriminantValue}`))})});formDataRequest=(t,r)=>({...t,fields:t.fields.map(i=>this.visitor.FormDataField(i,`${r}/field/${i.key}`))});typeDefinition=(t,r)=>({...t,shape:this.visitor.TypeShape(t.shape,`${r}/shape`)})},x9i={};Di(x9i,{latest:()=>l9d,v1:()=>Utp});var Utp={};Di(Utp,{SubpackageId:()=>OIn,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,commons:()=>h9d,db:()=>Ltp,read:()=>O9d,register:()=>Wtp});var Ltp={};Di(Ltp,{endpoint:()=>Vtp});var Vtp={},Wtp={};Di(Wtp,{ObjectPropertyAccess:()=>Qzs,SourceId:()=>Ktp,endpoint:()=>xtp,registerApiDefinition:()=>Nzs,type_:()=>Fzs,webhook:()=>Gtp,websocket:()=>Htp});var Nzs={};Di(Nzs,{Error:()=>OsE});var OsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);default:return t._other(e.content)}}},xtp={},Fzs={};Di(Fzs,{ObjectPropertyAccess:()=>Qzs});var Qzs={ReadOnly:"READ_ONLY",WriteOnly:"WRITE_ONLY"},Gtp={},Htp={};function Ktp(e){return e}var Uzs={};Di(Uzs,{getDocsSitesForOrg:()=>Jtp});var Jtp={};Di(Jtp,{Error:()=>AsE});var AsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);default:return t._other(e.content)}}},Lzs={};Di(Lzs,{diff:()=>$tp});var $tp={};Di($tp,{Error:()=>msE});var msE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Vw={};Di(Vw,{latest:()=>Ytp,v1:()=>Ztp,v2:()=>nrp});var Ytp={};Di(Ytp,{Layout:()=>Wzs,TwitterCardSetting:()=>Gzs,commons:()=>Xtp,frontmatter:()=>Vzs,seo:()=>xzs});var Xtp={},Vzs={};Di(Vzs,{Layout:()=>Wzs});var Wzs={Guide:"guide",Overview:"overview",Reference:"reference",Page:"page",Custom:"custom"},xzs={};Di(xzs,{TwitterCardSetting:()=>Gzs});var Gzs={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"},Ztp={};Di(Ztp,{commons:()=>ktp,db:()=>PsE,read:()=>erp,write:()=>trp});var ktp={};Di(ktp,{AiChatLocation:()=>yya,AiModel:()=>bya,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,HeaderPosition:()=>Eya,HttpSnippetLanguage:()=>Sya,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,PageActionOption:()=>Iya,ProgrammingLanguage:()=>Cya,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TwitterCardSetting:()=>Rya,commons:()=>hya});var hya={};Di(hya,{AiChatLocation:()=>yya,AiModel:()=>bya,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,HeaderPosition:()=>Eya,HttpSnippetLanguage:()=>Sya,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,PageActionOption:()=>Iya,ProgrammingLanguage:()=>Cya,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TwitterCardSetting:()=>Rya});var yya={Docs:"docs",Slack:"slack",Discord:"discord"},bya={Claude35:"claude-3.5",Claude37:"claude-3.7",Claude4:"claude-4",CommandA:"command-a"},vya={Center:"CENTER",Left:"LEFT"},gya={Default:"default",Canvas:"canvas"},Oya={Default:"default",Toolbar:"toolbar"},Aya={Default:"default",Minimal:"minimal"},mya={Default:"default",Bubble:"bubble"},Pya={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"},jya={Normal:"normal",Italic:"italic"},wya={Default:"default",Minimal:"minimal"},Eya={Fixed:"FIXED",Absolute:"ABSOLUTE"},Sya={Curl:"curl",Csharp:"csharp",Go:"go",Java:"java",Javascript:"javascript",Php:"php",Python:"python",Ruby:"ruby",Swift:"swift",Rust:"rust",Typescript:"typescript"},Mya={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"},Dya={En:"en",Es:"es",Fr:"fr",De:"de",It:"it",Pt:"pt",Ja:"ja",Zh:"zh",Ko:"ko",El:"el",No:"no",Pl:"pl",Ru:"ru",Sv:"sv",Tr:"tr"},Bya={Default:"default",Minimal:"minimal"},Iya={CopyPage:"copyPage",ViewAsMarkdown:"viewAsMarkdown",AskAi:"askAi",OpenAi:"openAi",Claude:"claude",Cursor:"cursor",Vscode:"vscode"},Cya={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"},qya={Header:"HEADER",HeaderTabs:"HEADER_TABS",Sidebar:"SIDEBAR"},Tya={Header:"HEADER",Sidebar:"SIDEBAR"},Rya={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"},PsE={},erp={};Di(erp,{getDocsForDomain:()=>Hzs,getDocsForDomainLegacy:()=>Kzs});var Hzs={};Di(Hzs,{Error:()=>jsE});var jsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},Kzs={};Di(Kzs,{Error:()=>wsE});var wsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},trp={};Di(trp,{DocsRegistrationId:()=>rrp,FilePath:()=>irp,finishDocsRegister:()=>Jzs,startDocsRegister:()=>$zs});var Jzs={};Di(Jzs,{Error:()=>EsE});var EsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),docsRegistrationIdNotFound:()=>({error:"DocsRegistrationIdNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"DocsRegistrationIdNotFound":return t.docsRegistrationIdNotFound();default:return t._other(e.content)}}},$zs={};Di($zs,{Error:()=>SsE});var SsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};function rrp(e){return e}function irp(e){return e}var nrp={};Di(nrp,{read:()=>arp,write:()=>hrp});var arp={};Di(arp,{DocsDefinitionField:()=>NsE,ensureDocsInS3:()=>orp,getDocsConfigById:()=>urp,getDocsFields:()=>srp,getDocsForUrl:()=>crp,getDocsUrlMetadata:()=>lrp,getOrganizationForUrl:()=>frp,getPrivateDocsForUrl:()=>drp,listAllDocsUrls:()=>prp,prepopulateFdrReadS3Bucket:()=>_rp});var orp={};Di(orp,{Error:()=>MsE});var MsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},urp={};Di(urp,{Error:()=>DsE});var DsE={docsDefinitionNotFoundError:()=>({error:"DocsDefinitionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsDefinitionNotFoundError":return t.docsDefinitionNotFoundError();default:return t._other(e.content)}}},srp={};Di(srp,{Error:()=>BsE});var BsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},crp={};Di(crp,{Error:()=>IsE});var IsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},lrp={};Di(lrp,{Error:()=>CsE});var CsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},frp={};Di(frp,{Error:()=>qsE});var qsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();default:return t._other(e.content)}}},drp={};Di(drp,{Error:()=>TsE});var TsE={domainNotRegisteredError:()=>({error:"DomainNotRegisteredError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DomainNotRegisteredError":return t.domainNotRegisteredError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},prp={};Di(prp,{Error:()=>RsE});var RsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},_rp={};Di(_rp,{Error:()=>zsE});var zsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},NsE={BaseUrl:"BASE_URL",FilesV2:"FILES_V2",ApisV2:"APIS_V2",Apis:"APIS",Pages:"PAGES",JsFiles:"JS_FILES",Config:"CONFIG",Root:"ROOT"},hrp={};Di(hrp,{addAlgoliaPreviewWhitelistEntry:()=>yrp,deleteDocsSite:()=>brp,finishDocsRegister:()=>vrp,listAlgoliaPreviewWhitelist:()=>grp,removeAlgoliaPreviewWhitelistEntry:()=>Orp,setDocsUrlMetadata:()=>Arp,setIsArchived:()=>mrp,startDocsPreviewRegister:()=>Prp,startDocsRegister:()=>jrp,transferOwnershipOfDomain:()=>wrp});var yrp={};Di(yrp,{Error:()=>FsE});var FsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},brp={};Di(brp,{Error:()=>QsE});var QsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},vrp={};Di(vrp,{Error:()=>UsE});var UsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),docsRegistrationIdNotFound:()=>({error:"DocsRegistrationIdNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"DocsRegistrationIdNotFound":return t.docsRegistrationIdNotFound();default:return t._other(e.content)}}},grp={};Di(grp,{Error:()=>LsE});var LsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Orp={};Di(Orp,{Error:()=>VsE});var VsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Arp={};Di(Arp,{Error:()=>WsE});var WsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},mrp={};Di(mrp,{Error:()=>xsE});var xsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Prp={};Di(Prp,{Error:()=>GsE});var GsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),invalidDomainError:()=>({error:"InvalidDomainError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"InvalidDomainError":return t.invalidDomainError();default:return t._other(e.content)}}},jrp={};Di(jrp,{Error:()=>HsE});var HsE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),invalidDomainError:()=>({error:"InvalidDomainError"}),invalidCustomDomainError:()=>({error:"InvalidCustomDomainError"}),domainBelongsToAnotherOrgError:e=>({content:e,error:"DomainBelongsToAnotherOrgError"}),invalidUrlError:e=>({content:e,error:"InvalidURLError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"InvalidDomainError":return t.invalidDomainError();case"InvalidCustomDomainError":return t.invalidCustomDomainError();case"DomainBelongsToAnotherOrgError":return t.domainBelongsToAnotherOrgError(e.content);case"InvalidURLError":return t.invalidUrlError(e.content);default:return t._other(e.content)}}},wrp={};Di(wrp,{Error:()=>KsE});var KsE={docsNotFoundError:()=>({error:"DocsNotFoundError"}),unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"DocsNotFoundError":return t.docsNotFoundError();case"UnauthorizedError":return t.unauthorizedError(e.content);default:return t._other(e.content)}}},Yzs={};Di(Yzs,{invalidate:()=>Erp});var Erp={};Di(Erp,{Error:()=>JsE});var JsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},aQ={};Di(aQ,{ChangelogEntryType:()=>Qrp,GeneratorId:()=>lcE,GeneratorLanguage:()=>fcE,ReleaseType:()=>Urp,cli:()=>Irp,commons:()=>Frp,getGenerator:()=>Srp,getGeneratorByImage:()=>Mrp,listGenerators:()=>Drp,upsertGenerator:()=>Brp,versions:()=>Lrp});var Srp={};Di(Srp,{Error:()=>$sE});var $sE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Mrp={};Di(Mrp,{Error:()=>YsE});var YsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Drp={};Di(Drp,{Error:()=>XsE});var XsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Brp={};Di(Brp,{Error:()=>ZsE});var ZsE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Irp={};Di(Irp,{getChangelog:()=>Crp,getCliRelease:()=>qrp,getLatestCliRelease:()=>Trp,getMinCliForIr:()=>Rrp,listCliReleases:()=>zrp,upsertCliRelease:()=>Nrp});var Crp={};Di(Crp,{Error:()=>ksE});var ksE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},qrp={};Di(qrp,{Error:()=>ecE});var ecE={cliVersionNotFoundError:e=>({content:e,error:"CliVersionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"CliVersionNotFoundError":return t.cliVersionNotFoundError(e.content);default:return t._other(e.content)}}},Trp={};Di(Trp,{Error:()=>tcE});var tcE={noValidClisFoundError:()=>({error:"NoValidClisFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidClisFoundError":return t.noValidClisFoundError();default:return t._other(e.content)}}},Rrp={};Di(Rrp,{Error:()=>rcE});var rcE={noValidClisFoundError:()=>({error:"NoValidClisFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidClisFoundError":return t.noValidClisFoundError();default:return t._other(e.content)}}},zrp={};Di(zrp,{Error:()=>icE});var icE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Nrp={};Di(Nrp,{Error:()=>ncE});var ncE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Frp={};Di(Frp,{ChangelogEntryType:()=>Qrp,ReleaseType:()=>Urp});var Qrp={Fix:"fix",Feat:"feat",Chore:"chore",Break:"break",Internal:"internal"},Urp={Ga:"GA",Rc:"RC"},Lrp={};Di(Lrp,{getChangelog:()=>Vrp,getGeneratorRelease:()=>Wrp,getLatestGeneratorRelease:()=>xrp,listGeneratorReleases:()=>Grp,upsertGeneratorRelease:()=>Hrp});var Vrp={};Di(Vrp,{Error:()=>acE});var acE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Wrp={};Di(Wrp,{Error:()=>ocE});var ocE={generatorVersionNotFoundError:e=>({content:e,error:"GeneratorVersionNotFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"GeneratorVersionNotFoundError":return t.generatorVersionNotFoundError(e.content);default:return t._other(e.content)}}},xrp={};Di(xrp,{Error:()=>ucE});var ucE={noValidGeneratorsFoundError:()=>({error:"NoValidGeneratorsFoundError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"NoValidGeneratorsFoundError":return t.noValidGeneratorsFoundError();default:return t._other(e.content)}}},Grp={};Di(Grp,{Error:()=>scE});var scE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Hrp={};Di(Hrp,{Error:()=>ccE});var ccE={invalidVersionError:e=>({content:e,error:"InvalidVersionError"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"InvalidVersionError":return t.invalidVersionError(e.content);default:return t._other(e.content)}}};function lcE(e){return e}var fcE={Python:"python",Go:"go",Java:"java",Typescript:"typescript",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust"},nVt={};Di(nVt,{PullRequestState:()=>tip,deletePullRequest:()=>Krp,deleteRepository:()=>Jrp,getPullRequest:()=>$rp,getRepository:()=>Yrp,listPullRequests:()=>Xrp,listRepositories:()=>Zrp,upsertPullRequest:()=>krp,upsertRepository:()=>eip});var Krp={};Di(Krp,{Error:()=>dcE});var dcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Jrp={};Di(Jrp,{Error:()=>pcE});var pcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},$rp={};Di($rp,{Error:()=>_cE});var _cE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Yrp={};Di(Yrp,{Error:()=>hcE});var hcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Xrp={};Di(Xrp,{Error:()=>ycE});var ycE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Zrp={};Di(Zrp,{Error:()=>bcE});var bcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},krp={};Di(krp,{Error:()=>vcE});var vcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},eip={};Di(eip,{Error:()=>gcE});var gcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},tip={Open:"open",Closed:"closed",Merged:"merged"},rip={};Di(rip,{latest:()=>iip,v1:()=>cip});var iip={};Di(iip,{NodeId:()=>nip,ProductId:()=>aip,Slug:()=>oip,TabId:()=>uip,VariantId:()=>sip});function nip(e){return e}function aip(e){return e}function oip(e){return e}function uip(e){return e}function sip(e){return e}var cip={};Di(cip,{NavigationV1Availability:()=>lip,NodeId:()=>fip,ProductId:()=>dip,Slug:()=>pip,TabId:()=>_ip,VariantId:()=>hip});var lip={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Beta:"beta",Deprecated:"deprecated"};function fip(e){return e}function dip(e){return e}function pip(e){return e}function _ip(e){return e}function hip(e){return e}var Xzs={};Di(Xzs,{Language:()=>vip,VersionBump:()=>gip,versions:()=>yip});var yip={};Di(yip,{Language:()=>vip,VersionBump:()=>gip,computeSemanticVersion:()=>bip});var bip={};Di(bip,{Error:()=>OcE});var OcE={failedToComputeExistingVersion:()=>({error:"FailedToComputeExistingVersion"}),failedToIncrementVersion:()=>({error:"FailedToIncrementVersion"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"FailedToComputeExistingVersion":return t.failedToComputeExistingVersion();case"FailedToIncrementVersion":return t.failedToIncrementVersion();default:return t._other(e.content)}}},vip={Go:"Go",TypeScript:"TypeScript",Java:"Java",Python:"Python",Csharp:"Csharp",Ruby:"Ruby",Php:"Php",Swift:"Swift",Rust:"Rust"},gip={Major:"MAJOR",Minor:"MINOR",Patch:"PATCH"},Qlo={};Di(Qlo,{get:()=>Oip,load:()=>Aip});var Oip={};Di(Oip,{Error:()=>AcE});var AcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),apiIdRequiredError:e=>({content:e,error:"ApiIdRequiredError"}),orgIdRequiredError:e=>({content:e,error:"OrgIdRequiredError"}),orgIdAndApiIdNotFound:e=>({content:e,error:"OrgIdAndApiIdNotFound"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),endpointNotFound:e=>({content:e,error:"EndpointNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"ApiIdRequiredError":return t.apiIdRequiredError(e.content);case"OrgIdRequiredError":return t.orgIdRequiredError(e.content);case"OrgIdAndApiIdNotFound":return t.orgIdAndApiIdNotFound(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"EndpointNotFound":return t.endpointNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}},Aip={};Di(Aip,{Error:()=>mcE});var mcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),unavailableError:e=>({content:e,error:"UnavailableError"}),invalidPageError:e=>({content:e,error:"InvalidPageError"}),apiIdRequiredError:e=>({content:e,error:"ApiIdRequiredError"}),orgIdRequiredError:e=>({content:e,error:"OrgIdRequiredError"}),orgIdAndApiIdNotFound:e=>({content:e,error:"OrgIdAndApiIdNotFound"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"UnavailableError":return t.unavailableError(e.content);case"InvalidPageError":return t.invalidPageError(e.content);case"ApiIdRequiredError":return t.apiIdRequiredError(e.content);case"OrgIdRequiredError":return t.orgIdRequiredError(e.content);case"OrgIdAndApiIdNotFound":return t.orgIdAndApiIdNotFound(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}};var Zzs={};Di(Zzs,{createSnippetsForSdk:()=>mip});var mip={};Di(mip,{Error:()=>PcE});var PcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),userNotInOrgError:e=>({content:e,error:"UserNotInOrgError"}),orgIdNotFound:e=>({content:e,error:"OrgIdNotFound"}),sdkNotFound:e=>({content:e,error:"SDKNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"UserNotInOrgError":return t.userNotInOrgError(e.content);case"OrgIdNotFound":return t.orgIdNotFound(e.content);case"SDKNotFound":return t.sdkNotFound(e.content);default:return t._other(e.content)}}},bha={};Di(bha,{PayloadLocation:()=>Eip,get:()=>Pip,register:()=>jip,registerBatch:()=>wip});var Pip={};Di(Pip,{Error:()=>jcE});var jcE={unauthorizedError:e=>({content:e,error:"UnauthorizedError"}),snippetNotFound:e=>({content:e,error:"SnippetNotFound"}),_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){case"UnauthorizedError":return t.unauthorizedError(e.content);case"SnippetNotFound":return t.snippetNotFound(e.content);default:return t._other(e.content)}}},jip={};Di(jip,{Error:()=>wcE});var wcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},wip={};Di(wip,{Error:()=>EcE});var EcE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Eip={Body:"BODY",Query:"QUERY",Path:"PATH",Headers:"HEADERS",Relative:"RELATIVE",Auth:"AUTH"},Ulo={};Di(Ulo,{generate:()=>Sip,revoke:()=>Mip});var Sip={};Di(Sip,{Error:()=>ScE});var ScE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}},Mip={};Di(Mip,{Error:()=>McE});var McE={_unknown:e=>({error:void 0,content:e}),_visit:(e,t)=>{switch(e.error){default:return t._other(e.content)}}};function Ru(...e){let t={};for(let[r,i]of e.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=r.toLowerCase();i!=null?t[n]=i:n in t&&delete t[n]}return t}function Ec(...e){let t={};for(let[r,i]of e.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=r.toLowerCase();i!=null&&(t[n]=i)}return t}var DcE={get:async(e,t)=>typeof e=="function"?e(t):e},z1s=(e,t,r)=>JSON.stringify(e,t,r);function N1s(e,t){return JSON.parse(e,t)}var Izt={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},H6d={[Izt.Debug]:1,[Izt.Info]:2,[Izt.Warn]:3,[Izt.Error]:4},kzs=class{debug(e,...t){console.debug(e,...t)}info(e,...t){console.info(e,...t)}warn(e,...t){console.warn(e,...t)}error(e,...t){console.error(e,...t)}},Llo=class{level;logger;silent;constructor(e){this.level=H6d[e.level],this.logger=e.logger,this.silent=e.silent}shouldLog(e){return!this.silent&&this.level<=H6d[e]}isDebug(){return this.shouldLog(Izt.Debug)}debug(e,...t){this.isDebug()&&this.logger.debug(e,...t)}isInfo(){return this.shouldLog(Izt.Info)}info(e,...t){this.isInfo()&&this.logger.info(e,...t)}isWarn(){return this.shouldLog(Izt.Warn)}warn(e,...t){this.isWarn()&&this.logger.warn(e,...t)}isError(){return this.shouldLog(Izt.Error)}error(e,...t){this.isError()&&this.logger.error(e,...t)}};function Dip(e){return e==null?BcE:e instanceof Llo?e:(e=e??{},e.level??=Izt.Info,e.logger??=new kzs,e.silent??=!0,new Llo(e))}var BcE=new Llo({level:Izt.Info,logger:new kzs,silent:!0}),IcE={arrayFormat:"indices",encode:!0};function K6d(e,t){if(e===void 0||e===null)return"";let r=String(e);return t?encodeURIComponent(r):r}function F1s(e,t="",r){let i=[];for(let[n,a]of Object.entries(e)){let o=t?`${t}[${n}]`:n;if(a!==void 0)if(Array.isArray(a)){if(a.length===0)continue;for(let c=0;c<a.length;c++){let f=a[c];if(f!==void 0)if(typeof f=="object"&&!Array.isArray(f)&&f!==null){let s=r.arrayFormat==="indices"?`${o}[${c}]`:o;i.push(...F1s(f,s,r))}else{let s=r.arrayFormat==="indices"?`${o}[${c}]`:o,u=r.encode?encodeURIComponent(s):s;i.push(`${u}=${K6d(f,r.encode)}`)}}}else if(typeof a=="object"&&a!==null){if(Object.keys(a).length===0)continue;i.push(...F1s(a,o,r))}else{let c=r.encode?encodeURIComponent(o):o;i.push(`${c}=${K6d(a,r.encode)}`)}}return i}function eNs(e,t){return e==null||typeof e!="object"?"":F1s(e,"",{...IcE,...t}).join("&")}function CcE(e,t){let r=eNs(t,{arrayFormat:"repeat"});return r?`${e}?${r}`:e}function qcE(e){let t={get bodyUsed(){return e.bodyUsed},stream:()=>e.body,arrayBuffer:e.arrayBuffer.bind(e),blob:e.blob.bind(e)};return"bytes"in e&&typeof e.bytes=="function"&&(t.bytes=e.bytes.bind(e)),t}function TcE(e){return e.body!=null}async function Bip(e,t){if(!TcE(e))return;switch(t){case"binary-response":return qcE(e);case"blob":return await e.blob();case"arrayBuffer":return await e.arrayBuffer();case"sse":return e.body;case"streaming":return e.body;case"text":return await e.text()}let r=await e.text();if(r.length>0)try{return N1s(r)}catch{return{ok:!1,error:{reason:"non-json",statusCode:e.status,rawBody:r}}}}async function RcE(e){let t=e.headers.get("Content-Type")?.toLowerCase();if(t==null||t.length===0)return Bip(e);switch(t.indexOf(";")!==-1&&(t=t.split(";")[0]?.trim()??""),t){case"application/hal+json":case"application/json":case"application/ld+json":case"application/problem+json":case"application/vnd.api+json":case"text/json":{let r=await e.text();return r.length>0?N1s(r):void 0}default:if(t.startsWith("application/vnd.")&&t.endsWith("+json")){let r=await e.text();return r.length>0?N1s(r):void 0}return await e.text()}}async function zcE(){return fetch}async function NcE({body:e,type:t}){return t==="form"?eNs(e,{arrayFormat:"repeat",encode:!0}):t.includes("json")?z1s(e):e}var bIn;typeof globalThis.Headers<"u"?bIn=globalThis.Headers:bIn=class Iip{headers;constructor(t){if(this.headers=new Map,t)if(t instanceof Iip)t.forEach((r,i)=>this.append(i,r));else if(Array.isArray(t))for(let[r,i]of t)if(typeof r=="string"&&typeof i=="string")this.append(r,i);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[r,i]of Object.entries(t))if(typeof i=="string")this.append(r,i);else throw new TypeError("Header values must be strings")}append(t,r){let i=t.toLowerCase(),n=this.headers.get(i)||[];this.headers.set(i,[...n,r])}delete(t){let r=t.toLowerCase();this.headers.delete(r)}get(t){let r=t.toLowerCase(),i=this.headers.get(r);return i?i.join(", "):null}has(t){let r=t.toLowerCase();return this.headers.has(r)}set(t,r){let i=t.toLowerCase();this.headers.set(i,[r])}forEach(t,r){let i=r?t.bind(r):t;this.headers.forEach((n,a)=>i(n.join(", "),a,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[t,r]of this.headers.entries())yield[t,r.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(let t of this.headers.values())yield t.join(", ")}[Symbol.iterator](){return this.entries()}};var FcE="timeout";function QcE(e){let t=new AbortController,r=setTimeout(()=>t.abort(FcE),e);return{signal:t.signal,abortId:r}}function UcE(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,r=new AbortController;for(let i of t){if(i.aborted){r.abort(i?.reason);break}i.addEventListener("abort",()=>r.abort(i?.reason),{signal:r.signal})}return r.signal}var LcE=async(e,t,r,i,n,a,o,c,f)=>{let s=[],u;if(a!=null){let{signal:_,abortId:h}=QcE(a);u=h,s.push(_)}o!=null&&s.push(o);let l=UcE(s),p=await e(t,{method:r,headers:i,body:n,signal:l,credentials:c?"include":void 0,duplex:f});return u!=null&&clearTimeout(u),p},J6d={headers:new bIn,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},$6d={headers:new bIn,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function Y6d(e){return{headers:e.headers,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url}}var VcE=1e3,Sco=6e4,WcE=2,Cip=.2;function xcE(e){let t=1+Math.random()*Cip;return e*t}function GcE(e){let t=1+(Math.random()-.5)*Cip;return e*t}function HcE(e,t){let r=e.headers.get("Retry-After");if(r){let n=parseInt(r,10);if(!Number.isNaN(n)&&n>0)return Math.min(n*1e3,Sco);let a=new Date(r);if(!Number.isNaN(a.getTime())){let o=a.getTime()-Date.now();if(o>0)return Math.min(Math.max(o,0),Sco)}}let i=e.headers.get("X-RateLimit-Reset");if(i){let n=parseInt(i,10);if(!Number.isNaN(n)){let a=n*1e3-Date.now();if(a>0)return xcE(Math.min(a,Sco))}}return GcE(Math.min(VcE*2**t,Sco))}async function KcE(e,t=WcE){let r=await e();for(let i=0;i<t&&([408,429].includes(r.status)||r.status>=500);++i){let n=HcE(r,i);await new Promise(a=>setTimeout(a,n)),r=await e()}return r}var JcE=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function tCs(e){let t={};for(let[r,i]of e instanceof bIn?e.entries():Object.entries(e))JcE.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=i;return t}var Q1s=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function $cE(e){if(e==null)return e;let t={};for(let[r,i]of Object.entries(e))Q1s.has(r.toLowerCase())?t[r]="[REDACTED]":t[r]=i;return t}function t9i(e){let t=e.indexOf("://");if(t===-1)return e;let r=t+3,i=e.indexOf("/",r),n=e.indexOf("?",r),a=e.indexOf("#",r),o=Math.min(i===-1?e.length:i,n===-1?e.length:n,a===-1?e.length:a),c=-1;for(let h=r;h<o;h++)e[h]==="@"&&(c=h);if(c!==-1&&(e=`${e.slice(0,r)}[REDACTED]@${e.slice(c+1)}`),n=e.indexOf("?"),n===-1)return e;a=e.indexOf("#",n);let f=a!==-1?a:e.length,s=e.slice(n+1,f);if(s.length===0)return e;let u=s.toLowerCase();if(!(u.includes("token")||u.includes("key")||u.includes("password")||u.includes("passwd")||u.includes("secret")||u.includes("session")||u.includes("auth")))return e;let p=[],_=s.split("&");for(let h of _){let y=h.indexOf("=");if(y===-1){p.push(h);continue}let b=h.slice(0,y),v=Q1s.has(b.toLowerCase());if(!v&&b.includes("%"))try{let O=decodeURIComponent(b);v=Q1s.has(O.toLowerCase())}catch{}p.push(v?`${b}=[REDACTED]`:h)}return e.slice(0,n+1)+p.join("&")+e.slice(f)}async function YcE(e){let t=new bIn;if(t.set("Accept",e.responseType==="json"?"application/json":e.responseType==="text"?"text/plain":"*/*"),e.body!==void 0&&e.contentType!=null&&t.set("Content-Type",e.contentType),e.headers==null)return t;for(let[r,i]of Object.entries(e.headers)){let n=await DcE.get(i,{endpointMetadata:e.endpointMetadata??{}});if(typeof n=="string"){t.set(r,n);continue}n!=null&&t.set(r,`${n}`)}return t}async function XcE(e){let t=CcE(e.url,e.queryParameters),r=await NcE({body:e.body,type:e.requestType??"other"}),i=e.fetchFn??await zcE(),n=await YcE(e),a=Dip(e.logging);if(a.isDebug()){let o={method:e.method,url:t9i(t),headers:tCs(n),queryParameters:$cE(e.queryParameters),hasBody:r!=null};a.debug("Making HTTP request",o)}try{let o=await KcE(async()=>LcE(i,t,e.method,n,r,e.timeoutMs,e.abortSignal,e.withCredentials,e.duplex),e.maxRetries);if(o.status>=200&&o.status<400){if(a.isDebug()){let c={method:e.method,url:t9i(t),statusCode:o.status,responseHeaders:tCs(o.headers)};a.debug("HTTP request succeeded",c)}return{ok:!0,body:await Bip(o,e.responseType),headers:o.headers,rawResponse:Y6d(o)}}else{if(a.isError()){let c={method:e.method,url:t9i(t),statusCode:o.status,responseHeaders:tCs(Object.fromEntries(o.headers.entries()))};a.error("HTTP request failed with error status",c)}return{ok:!1,error:{reason:"status-code",statusCode:o.status,body:await RcE(o)},rawResponse:Y6d(o)}}}catch(o){if(e.abortSignal?.aborted){if(a.isError()){let c={method:e.method,url:t9i(t)};a.error("HTTP request was aborted",c)}return{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:J6d}}else if(o instanceof Error&&o.name==="AbortError"){if(a.isError()){let c={method:e.method,url:t9i(t),timeoutMs:e.timeoutMs};a.error("HTTP request timed out",c)}return{ok:!1,error:{reason:"timeout"},rawResponse:J6d}}else if(o instanceof Error){if(a.isError()){let c={method:e.method,url:t9i(t),errorMessage:o.message};a.error("HTTP request failed with error",c)}return{ok:!1,error:{reason:"unknown",errorMessage:o.message},rawResponse:$6d}}if(a.isError()){let c={method:e.method,url:t9i(t),error:z1s(o)};a.error("HTTP request failed with unknown error",c)}return{ok:!1,error:{reason:"unknown",errorMessage:z1s(o)},rawResponse:$6d}}}var ku=XcE,es=class WBn extends Promise{innerPromise;unwrappedPromise;constructor(t){super(r=>{r(void 0)}),this.innerPromise=t}static fromFunction(t,...r){return new WBn(t(...r))}static interceptFunction(t){return(...r)=>WBn.fromPromise(t(...r))}static fromPromise(t){return new WBn(t)}static fromExecutor(t){let r=new Promise(t);return new WBn(r)}static fromResult(t){let r=Promise.resolve(t);return new WBn(r)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:t})=>t)),this.unwrappedPromise}then(t,r){return this.unwrap().then(t,r)}catch(t){return this.unwrap().catch(t)}finally(t){return this.unwrap().finally(t)}async withRawResponse(){return await this.innerPromise}},Jr={get:async e=>typeof e=="function"?e():e},qip={};Di(qip,{ConsoleLogger:()=>kzs,LogLevel:()=>Izt,Logger:()=>Llo,createLogger:()=>Dip});var X6d=ZcE();function ZcE(){return typeof window<"u"&&typeof window.document<"u"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis<"u"&&globalThis?.navigator?.userAgent==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof self?.importScripts=="function"&&(self.constructor?.name==="DedicatedWorkerGlobalScope"||self.constructor?.name==="ServiceWorkerGlobalScope"||self.constructor?.name==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u"?{type:"deno",version:Deno.version.deno}:typeof Bun<"u"&&typeof Bun.version<"u"?{type:"bun",version:Bun.version}:typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!process.versions?.node?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:typeof navigator<"u"&&navigator?.product==="ReactNative"?{type:"react-native"}:{type:"unknown"}}var On={};Di(On,{encodePathParam:()=>kcE,join:()=>elE,toQueryString:()=>eNs});function kcE(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:e=String(e);break}return encodeURIComponent(e)}function elE(e,...t){if(!e)return"";if(t.length===0)return e;if(e.includes("://")){let r;try{r=new URL(e)}catch{return Z6d(e,...t)}let n=t[t.length-1]?.endsWith("/");for(let a of t){let o=Rip(a);o&&(r.pathname=Tip(r.pathname,o))}return n&&!r.pathname.endsWith("/")&&(r.pathname+="/"),r.toString()}return Z6d(e,...t)}function Z6d(e,...t){if(t.length===0)return e;let r=e,n=t[t.length-1]?.endsWith("/");for(let a of t){let o=Rip(a);o&&(r=Tip(r,o))}return n&&!r.endsWith("/")&&(r+="/"),r}function Tip(e,t){return e.endsWith("/")?e+t:`${e}/${t}`}function Rip(e){if(!e)return e;let t=0,r=e.length;return e.startsWith("/")&&(t=1),e.endsWith("/")&&(r=e.length-1),t===0&&r===e.length?e:e.slice(t,r)}function vj(e){let t=Ru({"X-Fern-Language":"JavaScript","X-Fern-Runtime":X6d.type,"X-Fern-Runtime-Version":X6d.version},e?.headers);return{...e,logging:qip.createLogger(e?.logging),headers:t}}var ts={Prod:"https://registry.buildwithfern.com",Lambda:"https://registry-v2.buildwithfern.com"},tlE=class{_options;constructor(e={}){this._options=vj(e)}getApiLatest(e,t){return es.fromPromise(this.__getApiLatest(e,t))}async __getApiLatest(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/latest/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.latest.getApiLatest.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},rlE=class{_options;constructor(e={}){this._options=vj(e)}getApi(e,t){return es.fromPromise(this.__getApi(e,t))}async __getApi(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getApi.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getEndpointById(e,t,r){return es.fromPromise(this.__getEndpointById(e,t,r))}async __getEndpointById(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}/endpoint/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":case"EndpointDoesNotExistError":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getEndpointById.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}getEndpointByLocator(e,t,r){return es.fromPromise(this.__getEndpointByLocator(e,t,r))}async __getEndpointByLocator(e,t,r){let{method:i,path:n}=t,a={};a.method=i,a.path=n;let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/api/load/${On.encodePathParam(e)}/endpoint`),method:"GET",headers:o,queryParameters:{...a,...r?.queryParams},timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(c.ok)return{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.body?.error){case"UnauthorizedError":case"ApiDoesNotExistError":case"EndpointDoesNotExistError":return{data:{ok:!1,error:c.error.body,rawResponse:c.rawResponse},rawResponse:c.rawResponse}}return{data:{ok:!1,error:x9i.v1.read.getEndpointByLocator.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ilE=class{_options;constructor(e={}){this._options=vj(e)}registerApiDefinition(e,t){return es.fromPromise(this.__registerApiDefinition(e,t))}async __registerApiDefinition(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/api/register"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:x9i.v1.register.registerApiDefinition.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},nlE=class{_options;_read;_register;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new rlE(this._options)}get register(){return this._register??=new ilE(this._options)}},alE=class{_options;_latest;_v1;constructor(e={}){this._options=vj(e)}get latest(){return this._latest??=new tlE(this._options)}get v1(){return this._v1??=new nlE(this._options)}},olE=class{_options;constructor(e={}){this._options=vj(e)}getDocsSitesForOrg(e,t){return es.fromPromise(this.__getDocsSitesForOrg(e,t))}async __getDocsSitesForOrg(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/dashboard/get-docs-sites-for-org"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Uzs.getDocsSitesForOrg.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ulE=class{_options;constructor(e={}){this._options=vj(e)}diff(e,t){return es.fromPromise(this.__diff(e,t))}async __diff(e,t){let{previousApiDefinitionId:r,currentApiDefinitionId:i}=e,n={};n.previousApiDefinitionId=r,n.currentApiDefinitionId=i;let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/diff"),method:"GET",headers:a,queryParameters:{...n,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return o.ok?{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse}:{data:{ok:!1,error:Lzs.diff.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},slE=class{_options;constructor(e={}){this._options=vj(e)}getDocsForDomainLegacy(e,t){return es.fromPromise(this.__getDocsForDomainLegacy(e,t))}async __getDocsForDomainLegacy(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/docs/load/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v1.read.getDocsForDomainLegacy.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsForDomain(e,t){return es.fromPromise(this.__getDocsForDomain(e,t))}async __getDocsForDomain(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/docs/load"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v1.read.getDocsForDomain.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},clE=class{_options;constructor(e={}){this._options=vj(e)}startDocsRegister(e,t){return es.fromPromise(this.__startDocsRegister(e,t))}async __startDocsRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/registry/docs/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Vw.v1.write.startDocsRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}finishDocsRegister(e,t,r){return es.fromPromise(this.__finishDocsRegister(e,t,r))}async __finishDocsRegister(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/registry/docs/register/${On.encodePathParam(e)}`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"DocsRegistrationIdNotFound":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:Vw.v1.write.finishDocsRegister.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},llE=class{_options;_read;_write;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new slE(this._options)}get write(){return this._write??=new clE(this._options)}},flE=class{_options;constructor(e={}){this._options=vj(e)}getOrganizationForUrl(e,t){return es.fromPromise(this.__getOrganizationForUrl(e,t))}async __getOrganizationForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/organization-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getOrganizationForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsUrlMetadata(e,t){return es.fromPromise(this.__getDocsUrlMetadata(e,t))}async __getDocsUrlMetadata(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/metadata-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsUrlMetadata.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getDocsForUrl(e,t){return es.fromPromise(this.__getDocsForUrl(e,t))}async __getDocsForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/load-with-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}ensureDocsInS3(e,t){return es.fromPromise(this.__ensureDocsInS3(e,t))}async __ensureDocsInS3(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/ensure-docs-in-s3"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.ensureDocsInS3.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getPrivateDocsForUrl(e,t){return es.fromPromise(this.__getPrivateDocsForUrl(e,t))}async __getPrivateDocsForUrl(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/private/load-with-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getPrivateDocsForUrl.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listAllDocsUrls(e={},t){return es.fromPromise(this.__listAllDocsUrls(e,t))}async __listAllDocsUrls(e={},t){let{page:r,limit:i,custom:n}=e,a={};r!=null&&(a.page=r.toString()),i!=null&&(a.limit=i.toString()),n!=null&&(a.custom=n.toString());let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/urls/list"),method:"GET",headers:o,queryParameters:{...a,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(c.ok)return{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse};if(c.error.reason==="status-code")switch(c.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:c.error.body,rawResponse:c.rawResponse},rawResponse:c.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.listAllDocsUrls.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}getDocsConfigById(e,t){return es.fromPromise(this.__getDocsConfigById(e,t))}async __getDocsConfigById(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/v2/registry/docs/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsDefinitionNotFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsConfigById.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}prepopulateFdrReadS3Bucket(e){return es.fromPromise(this.__prepopulateFdrReadS3Bucket(e))}async __prepopulateFdrReadS3Bucket(e){let t=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/prepopulate-s3-bucket"),method:"POST",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return r.ok?{data:{ok:!0,body:void 0,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse}:{data:{ok:!1,error:Vw.v2.read.prepopulateFdrReadS3Bucket.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}getDocsFields(e,t){return es.fromPromise(this.__getDocsFields(e,t))}async __getDocsFields(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/load-fields"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DomainNotRegisteredError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.read.getDocsFields.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},dlE=class{_options;constructor(e={}){this._options=vj(e)}startDocsRegister(e,t){return es.fromPromise(this.__startDocsRegister(e,t))}async __startDocsRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/v2/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UnavailableError":case"UserNotInOrgError":case"InvalidDomainError":case"InvalidCustomDomainError":case"DomainBelongsToAnotherOrgError":case"InvalidURLError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.startDocsRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}startDocsPreviewRegister(e,t){return es.fromPromise(this.__startDocsPreviewRegister(e,t))}async __startDocsPreviewRegister(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/preview/init"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UnavailableError":case"UserNotInOrgError":case"InvalidDomainError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.startDocsPreviewRegister.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}finishDocsRegister(e,t,r){return es.fromPromise(this.__finishDocsRegister(e,t,r))}async __finishDocsRegister(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/v2/registry/docs/register/${On.encodePathParam(e)}`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"DocsRegistrationIdNotFound":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.finishDocsRegister.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}transferOwnershipOfDomain(e,t){return es.fromPromise(this.__transferOwnershipOfDomain(e,t))}async __transferOwnershipOfDomain(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/transfer-ownership"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.transferOwnershipOfDomain.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}setIsArchived(e,t){return es.fromPromise(this.__setIsArchived(e,t))}async __setIsArchived(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/set-is-archived"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.setIsArchived.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}setDocsUrlMetadata(e,t){return es.fromPromise(this.__setDocsUrlMetadata(e,t))}async __setDocsUrlMetadata(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/set-metadata-for-url"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.setDocsUrlMetadata.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}addAlgoliaPreviewWhitelistEntry(e,t){return es.fromPromise(this.__addAlgoliaPreviewWhitelistEntry(e,t))}async __addAlgoliaPreviewWhitelistEntry(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/add"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.addAlgoliaPreviewWhitelistEntry.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}removeAlgoliaPreviewWhitelistEntry(e,t){return es.fromPromise(this.__removeAlgoliaPreviewWhitelistEntry(e,t))}async __removeAlgoliaPreviewWhitelistEntry(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/remove"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.removeAlgoliaPreviewWhitelistEntry.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listAlgoliaPreviewWhitelist(e){return es.fromPromise(this.__listAlgoliaPreviewWhitelist(e))}async __listAlgoliaPreviewWhitelist(e){let t=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/algolia-preview-whitelist/list"),method:"GET",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:{ok:!0,body:r.body,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.body?.error){case"UnauthorizedError":return{data:{ok:!1,error:r.error.body,rawResponse:r.rawResponse},rawResponse:r.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.listAlgoliaPreviewWhitelist.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}deleteDocsSite(e,t){return es.fromPromise(this.__deleteDocsSite(e,t))}async __deleteDocsSite(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/v2/registry/docs/delete"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"DocsNotFoundError":case"UnauthorizedError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Vw.v2.write.deleteDocsSite.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},plE=class{_options;_read;_write;constructor(e={}){this._options=vj(e)}get read(){return this._read??=new flE(this._options)}get write(){return this._write??=new dlE(this._options)}},_lE=class{_options;_v1;_v2;constructor(e={}){this._options=vj(e)}get v1(){return this._v1??=new llE(this._options)}get v2(){return this._v2??=new plE(this._options)}},hlE=class{_options;constructor(e={}){this._options=vj(e)}invalidate(e,t){return es.fromPromise(this.__invalidate(e,t))}async __invalidate(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/docs-cache/invalidate"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Yzs.invalidate.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},ylE=class{_options;constructor(e={}){this._options=vj(e)}getLatestCliRelease(e={},t){return es.fromPromise(this.__getLatestCliRelease(e,t))}async __getLatestCliRelease(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli/latest"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidClisFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getLatestCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getChangelog(e,t){return es.fromPromise(this.__getChangelog(e,t))}async __getChangelog(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli/changelog"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.cli.getChangelog.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getMinCliForIr(e,t){return es.fromPromise(this.__getMinCliForIr(e,t))}async __getMinCliForIr(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/cli/for-ir/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidClisFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getMinCliForIr.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertCliRelease(e,t){return es.fromPromise(this.__upsertCliRelease(e,t))}async __upsertCliRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.cli.upsertCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getCliRelease(e,t){return es.fromPromise(this.__getCliRelease(e,t))}async __getCliRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/cli/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"CliVersionNotFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.cli.getCliRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listCliReleases(e={},t){return es.fromPromise(this.__listCliReleases(e,t))}async __listCliReleases(e={},t){let{page:r,pageSize:i}=e,n={};r!=null&&(n.page=r.toString()),i!=null&&(n.pageSize=i.toString());let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/cli"),method:"GET",headers:a,queryParameters:{...n,...t?.queryParams},timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return o.ok?{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse}:{data:{ok:!1,error:aQ.cli.listCliReleases.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},blE=class{_options;constructor(e={}){this._options=vj(e)}getLatestGeneratorRelease(e,t){return es.fromPromise(this.__getLatestGeneratorRelease(e,t))}async __getLatestGeneratorRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/versions/latest"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"NoValidGeneratorsFoundError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.versions.getLatestGeneratorRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getChangelog(e,t,r){return es.fromPromise(this.__getChangelog(e,t,r))}async __getChangelog(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}/changelog`),method:"POST",headers:i,contentType:"application/json",queryParameters:r?.queryParams,requestType:"json",body:t,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:aQ.versions.getChangelog.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}upsertGeneratorRelease(e,t){return es.fromPromise(this.__upsertGeneratorRelease(e,t))}async __upsertGeneratorRelease(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/versions"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"InvalidVersionError":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:aQ.versions.upsertGeneratorRelease.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGeneratorRelease(e,t,r){return es.fromPromise(this.__getGeneratorRelease(e,t,r))}async __getGeneratorRelease(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.body?.error){case"GeneratorVersionNotFoundError":return{data:{ok:!1,error:n.error.body,rawResponse:n.rawResponse},rawResponse:n.rawResponse}}return{data:{ok:!1,error:aQ.versions.getGeneratorRelease.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}listGeneratorReleases(e,t={},r){return es.fromPromise(this.__listGeneratorReleases(e,t,r))}async __listGeneratorReleases(e,t={},r){let{page:i,pageSize:n}=t,a={};i!=null&&(a.page=i.toString()),n!=null&&(a.pageSize=n.toString());let o=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),c=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/versions/${On.encodePathParam(e)}`),method:"GET",headers:o,queryParameters:{...a,...r?.queryParams},timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return c.ok?{data:{ok:!0,body:c.body,headers:c.headers,rawResponse:c.rawResponse},rawResponse:c.rawResponse}:{data:{ok:!1,error:aQ.versions.listGeneratorReleases.Error._unknown(c.error),rawResponse:c.rawResponse},rawResponse:c.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},vlE=class{_options;_cli;_versions;constructor(e={}){this._options=vj(e)}get cli(){return this._cli??=new ylE(this._options)}get versions(){return this._versions??=new blE(this._options)}upsertGenerator(e,t){return es.fromPromise(this.__upsertGenerator(e,t))}async __upsertGenerator(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.upsertGenerator.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGeneratorByImage(e,t){return es.fromPromise(this.__getGeneratorByImage(e,t))}async __getGeneratorByImage(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/by-image"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.getGeneratorByImage.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}getGenerator(e,t){return es.fromPromise(this.__getGenerator(e,t))}async __getGenerator(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/${On.encodePathParam(e)}`),method:"GET",headers:r,queryParameters:t?.queryParams,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:aQ.getGenerator.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}listGenerators(e){return es.fromPromise(this.__listGenerators(e))}async __listGenerators(e){let t=Ru(this._options?.headers,e?.headers),r=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators"),method:"GET",headers:t,queryParameters:e?.queryParams,timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:e?.maxRetries??this._options?.maxRetries,abortSignal:e?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return r.ok?{data:{ok:!0,body:r.body,headers:r.headers,rawResponse:r.rawResponse},rawResponse:r.rawResponse}:{data:{ok:!1,error:aQ.listGenerators.Error._unknown(r.error),rawResponse:r.rawResponse},rawResponse:r.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},glE=class{_options;constructor(e={}){this._options=vj(e)}getRepository(e,t,r){return es.fromPromise(this.__getRepository(e,t,r))}async __getRepository(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/repository/${On.encodePathParam(e)}/${On.encodePathParam(t)}`),method:"GET",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:n.body,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:nVt.getRepository.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}listRepositories(e={},t){return es.fromPromise(this.__listRepositories(e,t))}async __listRepositories(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/repository/list"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.listRepositories.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertRepository(e,t){return es.fromPromise(this.__upsertRepository(e,t))}async __upsertRepository(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/repository/upsert"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.upsertRepository.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}deleteRepository(e,t,r){return es.fromPromise(this.__deleteRepository(e,t,r))}async __deleteRepository(e,t,r){let i=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),r?.headers),n=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/repository/${On.encodePathParam(e)}/${On.encodePathParam(t)}/delete`),method:"DELETE",headers:i,queryParameters:r?.queryParams,timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:r?.maxRetries??this._options?.maxRetries,abortSignal:r?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return n.ok?{data:{ok:!0,body:void 0,headers:n.headers,rawResponse:n.rawResponse},rawResponse:n.rawResponse}:{data:{ok:!1,error:nVt.deleteRepository.Error._unknown(n.error),rawResponse:n.rawResponse},rawResponse:n.rawResponse}}getPullRequest(e,t,r,i){return es.fromPromise(this.__getPullRequest(e,t,r,i))}async __getPullRequest(e,t,r,i){let n=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),i?.headers),a=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/pull-request/${On.encodePathParam(e)}/${On.encodePathParam(t)}/${On.encodePathParam(r)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:i?.timeoutInSeconds!=null?i.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return a.ok?{data:{ok:!0,body:a.body,headers:a.headers,rawResponse:a.rawResponse},rawResponse:a.rawResponse}:{data:{ok:!1,error:nVt.getPullRequest.Error._unknown(a.error),rawResponse:a.rawResponse},rawResponse:a.rawResponse}}listPullRequests(e={},t){return es.fromPromise(this.__listPullRequests(e,t))}async __listPullRequests(e={},t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/pull-request/list"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.listPullRequests.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}upsertPullRequest(e,t){return es.fromPromise(this.__upsertPullRequest(e,t))}async __upsertPullRequest(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/generators/github/pull-request/upsert"),method:"PUT",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:nVt.upsertPullRequest.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}deletePullRequest(e,t,r,i){return es.fromPromise(this.__deletePullRequest(e,t,r,i))}async __deletePullRequest(e,t,r,i){let n=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),i?.headers),a=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,`/generators/github/pull-request/${On.encodePathParam(e)}/${On.encodePathParam(t)}/${On.encodePathParam(r)}/delete`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:i?.timeoutInSeconds!=null?i.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return a.ok?{data:{ok:!0,body:void 0,headers:a.headers,rawResponse:a.rawResponse},rawResponse:a.rawResponse}:{data:{ok:!1,error:nVt.deletePullRequest.Error._unknown(a.error),rawResponse:a.rawResponse},rawResponse:a.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},OlE=class{_options;constructor(e={}){this._options=vj(e)}computeSemanticVersion(e,t){return es.fromPromise(this.__computeSemanticVersion(e,t))}async __computeSemanticVersion(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/sdks/semantic-version/compute"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"FailedToComputeExistingVersion":case"FailedToIncrementVersion":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Xzs.versions.computeSemanticVersion.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},AlE=class{_options;_versions;constructor(e={}){this._options=vj(e)}get versions(){return this._versions??=new OlE(this._options)}},mlE=class{_options;constructor(e={}){this._options=vj(e)}get(e,t){return es.fromPromise(this.__get(e,t))}async __get(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"UnavailableError":case"ApiIdRequiredError":case"OrgIdRequiredError":case"OrgIdAndApiIdNotFound":case"OrgIdNotFound":case"EndpointNotFound":case"SDKNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Qlo.get.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}load(e={},t){return es.fromPromise(this.__load(e,t))}async __load(e={},t){let{page:r,...i}=e,n={};r!=null&&(n.page=r.toString());let a=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),o=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets/load"),method:"POST",headers:a,contentType:"application/json",queryParameters:{...n,...t?.queryParams},requestType:"json",body:i,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(o.ok)return{data:{ok:!0,body:o.body,headers:o.headers,rawResponse:o.rawResponse},rawResponse:o.rawResponse};if(o.error.reason==="status-code")switch(o.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"UnavailableError":case"InvalidPageError":case"ApiIdRequiredError":case"OrgIdRequiredError":case"OrgIdAndApiIdNotFound":case"OrgIdNotFound":case"SDKNotFound":return{data:{ok:!1,error:o.error.body,rawResponse:o.rawResponse},rawResponse:o.rawResponse}}return{data:{ok:!1,error:Qlo.load.Error._unknown(o.error),rawResponse:o.rawResponse},rawResponse:o.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},PlE=class{_options;constructor(e={}){this._options=vj(e)}createSnippetsForSdk(e,t){return es.fromPromise(this.__createSnippetsForSdk(e,t))}async __createSnippetsForSdk(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippets/create"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"UserNotInOrgError":case"OrgIdNotFound":case"SDKNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:Zzs.createSnippetsForSdk.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},jlE=class{_options;constructor(e={}){this._options=vj(e)}register(e,t){return es.fromPromise(this.__register(e,t))}async __register(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/register"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:bha.register.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}registerBatch(e,t){return es.fromPromise(this.__registerBatch(e,t))}async __registerBatch(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/register/batch"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:bha.registerBatch.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}get(e,t){return es.fromPromise(this.__get(e,t))}async __get(e,t){let r=Ru(this._options?.headers,Ec({Authorization:await this._getAuthorizationHeader()}),t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/snippet-template/get"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(i.ok)return{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.body?.error){case"UnauthorizedError":case"SnippetNotFound":return{data:{ok:!1,error:i.error.body,rawResponse:i.rawResponse},rawResponse:i.rawResponse}}return{data:{ok:!1,error:bha.get.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}async _getAuthorizationHeader(){let e=await Jr.get(this._options.token);if(e!=null)return`Bearer ${e}`}},wlE=class{_options;constructor(e={}){this._options=vj(e)}generate(e,t){return es.fromPromise(this.__generate(e,t))}async __generate(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/tokens/generate"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:i.body,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Ulo.generate.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}revoke(e,t){return es.fromPromise(this.__revoke(e,t))}async __revoke(e,t){let r=Ru(this._options?.headers,t?.headers),i=await ku({url:On.join(await Jr.get(this._options.baseUrl)??await Jr.get(this._options.environment)??ts.Prod,"/tokens/revoke"),method:"POST",headers:r,contentType:"application/json",queryParameters:t?.queryParams,requestType:"json",body:e,timeoutMs:t?.timeoutInSeconds!=null?t.timeoutInSeconds*1e3:this._options?.timeoutInSeconds!=null?this._options?.timeoutInSeconds*1e3:void 0,maxRetries:t?.maxRetries??this._options?.maxRetries,abortSignal:t?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});return i.ok?{data:{ok:!0,body:void 0,headers:i.headers,rawResponse:i.rawResponse},rawResponse:i.rawResponse}:{data:{ok:!1,error:Ulo.revoke.Error._unknown(i.error),rawResponse:i.rawResponse},rawResponse:i.rawResponse}}},zip=class{_options;_api;_dashboard;_docs;_generators;_diff;_docsCache;_git;_sdks;_snippetsFactory;_snippets;_templates;_tokens;constructor(e={}){this._options=vj(e)}get api(){return this._api??=new alE(this._options)}get dashboard(){return this._dashboard??=new olE(this._options)}get docs(){return this._docs??=new _lE(this._options)}get generators(){return this._generators??=new vlE(this._options)}get diff(){return this._diff??=new ulE(this._options)}get docsCache(){return this._docsCache??=new hlE(this._options)}get git(){return this._git??=new glE(this._options)}get sdks(){return this._sdks??=new AlE(this._options)}get snippetsFactory(){return this._snippetsFactory??=new PlE(this._options)}get snippets(){return this._snippets??=new mlE(this._options)}get templates(){return this._templates??=new jlE(this._options)}get tokens(){return this._tokens??=new wlE(this._options)}},ElE={};Di(ElE,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageId:()=>$zt,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SubpackageId:()=>OIn,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,WebhookId:()=>rNt,endpoint:()=>Vtp});var SlE={};Di(SlE,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,ObjectPropertyAccess:()=>Qzs,OrgId:()=>Jzt,PageId:()=>$zt,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SourceId:()=>Ktp,SubpackageId:()=>OIn,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebSocketMessageId:()=>Lha,WebSocketMessageOrigin:()=>Vha,WebhookHttpMethod:()=>Uha,WebhookId:()=>rNt,endpoint:()=>xtp,registerApiDefinition:()=>Nzs,type_:()=>Fzs,webhook:()=>Gtp,websocket:()=>Htp});var MlE={};Di(MlE,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya});var DlE={};Di(DlE,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya,getDocsForDomain:()=>Hzs,getDocsForDomainLegacy:()=>Kzs});var RW={};Di(RW,{AiChatLocation:()=>yya,AiModel:()=>bya,ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,ContentAlignment:()=>vya,DocsBodyConfig:()=>gya,DocsConfigId:()=>Fzt,DocsPageActionsConfig:()=>Oya,DocsRegistrationId:()=>rrp,DocsSidebarConfig:()=>Aya,DocsTabsConfig:()=>mya,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,FilePath:()=>irp,FontDisplay:()=>Pya,FontStyle:()=>jya,FooterNavConfig:()=>wya,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HeaderPosition:()=>Eya,HttpMethod:()=>Gzt,HttpSnippetLanguage:()=>Sya,JqString:()=>Hzt,JsScriptStrategy:()=>Mya,Language:()=>Dya,LanguageSwitcherConfig:()=>Bya,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageActionOption:()=>Iya,PageId:()=>$zt,ProgrammingLanguage:()=>Cya,PropertyKey:()=>Yzt,RoleId:()=>Xzt,SearchbarPlacement:()=>qya,TabsPlacement:()=>Tya,TokenId:()=>Zzt,TwitterCardSetting:()=>Rya,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,commons:()=>hya,finishDocsRegister:()=>Jzs,startDocsRegister:()=>$zs});var _i={};Di(_i,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,OrgId:()=>Jzt,PageId:()=>$zt,PayloadLocation:()=>Eip,PropertyKey:()=>Yzt,PullRequestState:()=>tip,RoleId:()=>Xzt,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,api:()=>x9i,commons:()=>y9d,dashboard:()=>Uzs,diff:()=>Lzs,docs:()=>Vw,docsCache:()=>Yzs,generators:()=>aQ,git:()=>nVt,navigation:()=>rip,sdks:()=>Xzs,snippets:()=>Qlo,snippetsFactory:()=>Zzs,templates:()=>bha,tokens:()=>Ulo});function Nip(e,t){return BlE(e)?t.versioned(e):t.unversioned(e)}function Fip(e,t){return IlE(e)?t.tabbed(e):t.untabbed(e)}function BlE(e){return Array.isArray(e.versions)}function IlE(e){return Array.isArray(e.tabs)||Array.isArray(e.tabsV2)}function ClE(e,t){return tNs(e)?t.link(e):t.group(e)}function tNs(e){return"url"in e&&typeof e.url=="string"}function qlE(e,t){return RlE(e)?t.versioned(e):t.unversioned(e)}function TlE(e,t){return zlE(e)?t.tabbed(e):t.untabbed(e)}function RlE(e){return Array.isArray(e.versions)}function zlE(e){return Array.isArray(e.tabs)}function NlE(e,t){return QlE(e)?t.versioned(e):t.unversioned(e)}function FlE(e,t){return UlE(e)?t.tabbed(e):t.untabbed(e)}function QlE(e){return Array.isArray(e.versions)}function UlE(e){return Array.isArray(e.tabs)||Array.isArray(e.tabsV2)}function LlE(e,t){switch(e.type){case"object":return J9i(e,t,!1,new Set,0);case"reference":return ER(e.value,t,!1,new Set,0);default:T7(e)}}function VlE(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!0,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!0,new Set,0)};case"json":return WlE(e.shape,t);case"fileUpload":return k6d(e.value,t);case"formData":return k6d(e,t);case"bytes":{if(e.isOptional)return;let r=btoa("Hello world!");return e.contentType!=null&&(r=`data:${e.contentType};base64,${r}`),{type:"bytes",value:{type:"base64",value:r}}}}}function k6d(e,t){if(e==null)return{type:"form",value:{}};let r={};return e.properties.forEach(i=>{switch(i.type){case"file":{if(i.value.isOptional)break;i.value.type==="fileArray"?r[i.value.key]={type:"filenames",value:["<filename1>","<filename2>"]}:r[i.value.key]={type:"filename",value:"<filename1>"};break}case"bodyProperty":{r[i.key]={type:"json",value:ER(i.valueType,t,!0,new Set,0)};break}}}),{type:"form",value:r}}function WlE(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!0,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!0,new Set,0)};default:T7(e)}}function iNs(e,t){switch(e.type){case"object":return{type:"json",value:J9i(e,t,!1,new Set,0)};case"reference":return{type:"json",value:ER(e.value,t,!1,new Set,0)};case"fileDownload":return{type:"filename",value:"<filename>"};case"streamingText":case"streamCondition":return{type:"stream",value:["example-text"]};case"stream":switch(e.shape.type){case"object":{let r=J9i(e.shape,t,!1,new Set,0);return{type:"stream",value:[r,r]}}case"reference":{let r=ER(e.shape.value,t,!1,new Set,0);return{type:"stream",value:[r,r]}}}}}function J9i(e,t,r,i,n){let a={};for(let o of Uip(e,t)){let c=ER(o.valueType,t,r,n===0?new Set:new Set(i),n+1);c!=null&&(a[o.key]=c)}return a}function ER(e,t,r,i,n){let a;switch(e.type){case"primitive":a=HlE(e.value);break;case"id":{i.add(e.value),a=xlE(e.value,t,r,i,n);break}case"optional":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=void 0;break}else i.add(e.itemType.value);r?a=void 0:a=e.defaultValue??ER(e.itemType,t,r,i,n);break;case"nullable":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=void 0;break}else i.add(e.itemType.value);a=ER(e.itemType,t,r,i,n);break;case"list":if(e.itemType.type==="id")if(i.has(e.itemType.value)){a=[];break}else i.add(e.itemType.value);a=[ER(e.itemType,t,r,i,n)];break;case"set":a=[ER(e.itemType,t,r,i,n)];break;case"map":a={[ER(e.keyType,t,r,i,n+1)]:ER(e.valueType,t,r,i,n+1)};break;case"unknown":a={};break;case"literal":a=GlE(e.value);break;default:T7(e)}return a}function xlE(e,t,r,i,n){let a=t(e).shape;return Qip(a,t,r,i,n)}function Qip(e,t,r,i,n){switch(e.type){case"object":return J9i(e,t,r,i,n);case"undiscriminatedUnion":return e.variants[0]==null?{}:ER(e.variants[0].type,t,r,i,n);case"discriminatedUnion":return e.variants[0]==null?{}:{[e.discriminant]:e.variants[0].discriminantValue,...J9i(e.variants[0].additionalProperties,t,r,i,n)};case"alias":return ER(e.value,t,r,i,n);case"enum":return e.values[0]?.value??""}}function GlE(e){return e.value}function HlE(e){switch(e.type){case"string":return"string";case"integer":return 0;case"uint":return 0;case"uint64":return 0;case"double":return 1;case"boolean":return!0;case"long":return 99999;case"datetime":return"2023-01-01T00:00:00Z";case"uuid":return"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32";case"base64":return"SGVsbG8gV29ybGQ=";case"date":return"2023-01-01";case"bigInteger":return"123456789123456789"}}function Uip(e,t){return[...e.properties,...e.extends.flatMap(r=>{let i=t(r);return i.shape.type==="alias"&&i.shape.value.type==="id"&&(i=KlE(i.shape.value.value,t)),i.shape.type!=="object"?[]:Uip(i.shape,t)})]}function KlE(e,t){let r=t(e);return r.shape.type==="alias"&&r.shape.value.type==="id"?t(r.shape.value.value):r}var JlE=2;function $lE({endpointDefinition:e,apiDefinition:t,errorDeclaration:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:r.statusCode,responseBodyV3:r.type!=null?{type:"json",value:Qip(r.type,i,!1,new Set,0)}:void 0}}function YlE({endpointDefinition:e,apiDefinition:t,nonStreamResponse:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:200,responseBodyV3:iNs(r.shape,i)}}function XlE({endpointDefinition:e,apiDefinition:t,streamResponse:r}){let i=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:i}),responseStatusCode:200,responseBodyV3:iNs(r.shape,i)}}function ZlE({endpointDefinition:e,apiDefinition:t}){let r=Hfo(t);return{...Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:r}),responseStatusCode:200,responseBodyV3:e.response!=null?iNs(e.response.type,r):void 0}}function Gfo({endpointDefinition:e,apiDefinition:t,resolveTypeById:r}){let i=klE({pathParameters:e.path.pathParameters,apiDefinition:t,resolveTypeById:r}),n=rfE(e.path,i),a=efE({resolveTypeById:r,queryParameters:e.queryParameters}),o=tfE({headers:[...t.globalHeaders??[],...e.headers],resolveTypeById:r}),c=e.request!=null?VlE(e.request.type,r):void 0;return{path:n,pathParameters:i,queryParameters:a,headers:o,requestBodyV3:c,name:void 0,requestBody:void 0,responseBody:void 0,responseBodyV3:void 0,codeSamples:void 0,description:void 0}}function klE({pathParameters:e,apiDefinition:t,resolveTypeById:r}){return e.reduce((i,n)=>{let a=Lip({typeReference:n.type,types:t.types});return{...i,[n.key]:a?`:${n.key}`:ER(n.type,r,!1,new Set,0)}},{})}function efE({queryParameters:e,resolveTypeById:t}){let r={},i=0;for(let n of e){let a=ER(n.type,t,i>=JlE,new Set,0);n.type.type==="optional"&&(i+=1),r[n.key]=a}return r}function tfE({headers:e,resolveTypeById:t}){return e.reduce((r,i)=>{let n=ER(i.type,t,!1,new Set,0);return n==null?r:{...r,[i.key]:n}},{})}function Hfo(e){return t=>{let r=e.types[t];if(r==null)throw new Error(`Failed to find ${t}`);return r}}function rfE(e,t){let r="";for(let i of e.parts)switch(i.type){case"literal":r+=i.value;break;case"pathParameter":{let n=t[i.value];if(n==null)throw new Error("Path parameter is missing: "+i.value);r+=n}break;default:T7(i)}return r}function Lip({typeReference:e,types:t}){if(e.type==="primitive"&&e.value.type==="string")return!0;if(e.type==="id"){let r=t[e.value];if(r!=null&&r.shape.type==="alias")return Lip({typeReference:r.shape.value,types:t})}return!1}function ifE({webhookDefinition:e,apiDefinition:t}){try{let r=i=>{let n=t.types[i];if(n==null)throw new Error(`Failed to find ${i}`);return n};return{payload:LlE(e.payload.type,r)}}catch{throw new Error}}function Kfo(e,t,r){let i={};for(let[a,o]of r9d(e.subpackages))for(let c of o.subpackages)i[c]=a;let n=new hfE;return{id:t,rootPackage:{endpoints:e.rootPackage.endpoints.map(a=>xip({writeShape:a,apiDefinition:e,context:n,snippets:r})??[]),webhooks:e.rootPackage.webhooks?.map(a=>Wip({writeShape:a,apiDefinition:e}))??[],websockets:e.rootPackage.websockets?.map(a=>Vip({writeShape:a}))??[],subpackages:e.rootPackage.subpackages,types:e.rootPackage.types,pointsTo:void 0},types:Object.fromEntries(Object.entries(e.types).map(([a,o])=>[a,ffE({writeShape:o})])),subpackages:r9d(e.subpackages).reduce((a,[o,c])=>(a[o]=nfE({writeShape:c,id:o,subpackageToParent:i,apiDefinition:e,context:n,snippets:r}),a),{}),snippetsConfiguration:e.snippetsConfiguration,auth:e.auth,authSchemes:e.authSchemes,globalHeaders:e.globalHeaders,hasMultipleBaseUrls:n.hasMultipleBaseUrls(),navigation:e.navigation}}function nfE({writeShape:e,id:t,subpackageToParent:r,apiDefinition:i,context:n,snippets:a}){let o=r[t],c=e.endpoints.map(u=>xip({writeShape:u,apiDefinition:i,context:n,snippets:a})),f=e.webhooks?.map(u=>Wip({writeShape:u,apiDefinition:i})),s=e.websockets?.map(u=>Vip({writeShape:u}));return{subpackageId:t,parent:o,name:e.name,endpoints:c,websockets:s??[],types:e.types,subpackages:e.subpackages,pointsTo:e.pointsTo,urlSlug:oC(e.name),description:e.description,displayName:e.displayName,webhooks:f??[]}}function Vip({writeShape:e}){return{urlSlug:oC(e.id),auth:e.auth,headers:e.headers,messages:e.messages,availability:e.availability,defaultEnvironment:e.defaultEnvironment,environments:e.environments,description:e.description,id:e.id,name:e.name,path:e.path,queryParameters:e.queryParameters,examples:e.examples}}function Wip({apiDefinition:e,writeShape:t}){let r=oC(t.id),i=oC(t.name??t.id);return{urlSlug:r,migratedFromUrlSlugs:(0,rNs.default)(i,r)?void 0:[i],description:t.description,method:t.method,id:t.id,name:t.name,path:t.path,headers:t.headers,responses:t.responses?.map(afE),payload:t.payload,examples:t.examples.length>0?t.examples:[ifE({webhookDefinition:t,apiDefinition:e})]}}function afE(e){let t=e.type;switch(t.type){case"fileDownload":case"object":case"reference":case"streamingText":case"stream":return{...e,type:t};case"streamCondition":return{...e,type:t.response.shape}}}function xip({writeShape:e,apiDefinition:t,context:r,snippets:i}){r.registerEnvironments(e.environments??[]);let n=oC(e.id),a=oC(e.name??e.id);return{availability:e.availability,environments:e.environments,defaultEnvironment:e.defaultEnvironment,urlSlug:e.slug??n,migratedFromUrlSlugs:(0,rNs.default)(a,n)?void 0:[a],method:e.method,id:e.id,originalEndpointId:e.originalEndpointId,name:e.name,path:e.path,queryParameters:e.queryParameters,headers:e.headers,request:e.request!=null?t9d({writeShape:e.request}):void 0,requestsV2:e.requestsV2!=null?{requests:e.requestsV2.requests?.map(o=>t9d({writeShape:o}))}:void 0,response:e.response!=null?e9d({writeShape:e.response,apiDefinition:t,sdkSnippetHolder:i,endpointDefinition:e}):void 0,responsesV2:e.responsesV2!=null?{responses:e.responsesV2.responses?.map(o=>e9d({writeShape:o,apiDefinition:t,sdkSnippetHolder:i,endpointDefinition:e}))}:void 0,errors:e.errors??[],errorsV2:ofE(e),examples:sfE({writeShape:e,apiDefinition:t,snippets:i}),description:e.description,authed:e.auth,authV2:e.authV2,multiAuth:e.multiAuth,snippetTemplates:i.getSnippetTemplateForEndpoint({endpointPath:xBn(e),endpointMethod:e.method,endpointId:e.originalEndpointId}),protocol:e.protocol,includeInApiExplorer:e.includeInApiExplorer}}function ofE(e){if(e.errorsV2!=null)return e.errorsV2.map(t=>({...t,name:t.name!=null?Jco(t.name):void 0,type:t.type!=null?Gip({writeShape:t.type}):void 0}));if(e.errors!=null)return e.errors.map(t=>({name:void 0,isWildcard:void 0,examples:void 0,headers:void 0,...t,type:t.type!=null?{type:"alias",value:t.type}:void 0}))}function e9d({writeShape:e,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i}){let n=e.type;switch(n.type){case"fileDownload":case"object":case"reference":case"streamingText":case"stream":return{...e,type:n};case"streamCondition":return{...e,type:{type:"streamCondition",...ufE({writeShape:n,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i})}}}}function ufE({writeShape:e,apiDefinition:t,endpointDefinition:r,sdkSnippetHolder:i}){let n=e.response.examples??YlE({apiDefinition:t,nonStreamResponse:e.response,endpointDefinition:r}),a=e.response.examples??XlE({apiDefinition:t,streamResponse:e.response,endpointDefinition:r});return{...e,response:{...e.response,examples:n.map(o=>U1s({writeShape:o,endpointDefinition:r,snippets:i}))},streamResponse:{...e.streamResponse,examples:a.map(o=>U1s({writeShape:o,endpointDefinition:r,snippets:i}))}}}function sfE({writeShape:e,apiDefinition:t,snippets:r}){let i=[],{successExamples:n,errorExamples:a}=cfE(e.examples);if(n.length>0)i.push(...n);else{let s=ZlE({endpointDefinition:e,apiDefinition:t});i.push(s)}let o=new Set(a.map(s=>s.responseStatusCode)),f=(e.errorsV2??[]).filter(s=>!o.has(s.statusCode)).map(s=>$lE({endpointDefinition:e,apiDefinition:t,errorDeclaration:s}));return i.push(...a,...f),i.map(s=>U1s({writeShape:s,endpointDefinition:e,snippets:r}))}function cfE(e){let t=[],r=[];return e.forEach(i=>{i.responseStatusCode<400?t.push(i):r.push(i)}),{successExamples:t,errorExamples:r}}function t9d({writeShape:e}){switch(e.type.type){case"object":case"reference":return{contentType:"application/json",description:e.description,type:e.type};case"fileUpload":case"formData":return{contentType:"multipart/form-data",description:e.description,type:e.type};case"json":return{contentType:e.type.contentType,description:e.description,type:e.type.shape};case"bytes":return{contentType:e.type.contentType??"application/octet-stream",description:e.description,type:{type:"bytes",isOptional:e.type.isOptional,contentType:e.type.contentType}};default:T7(e.type)}}function U1s({writeShape:e,endpointDefinition:t,snippets:r}){return{name:e.name,description:e.description,path:e.path,pathParameters:e.pathParameters,queryParameters:e.queryParameters,headers:e.headers,requestBody:e.requestBody,responseStatusCode:e.responseStatusCode,responseBody:e.responseBody,codeExamples:lfE({endpointDefinition:t,snippets:r,exampleId:e.name}),requestBodyV3:e.requestBodyV3??(e.requestBody!=null?{type:"json",value:e.requestBody}:void 0),responseBodyV3:e.responseBodyV3??(e.responseBody!=null?{type:"json",value:e.responseBody}:void 0),codeSamples:e.codeSamples??[]}}function lfE({exampleId:e,endpointDefinition:t,snippets:r}){let i=r.getPythonCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),n=r.getTypeScriptCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),a=r.getGoCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),o=r.getRubyCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e}),c=r.getCsharpCodeSnippetForEndpoint({endpointMethod:t.method,endpointPath:xBn(t),endpointId:t.originalEndpointId,exampleId:e});return{nodeAxios:"",pythonSdk:i,typescriptSdk:n,goSdk:a,rubySdk:o,csharpSdk:c}}function xBn(e){let t="";for(let r of e.path.parts)r.type==="literal"?t+=r.value:t+=`{${r.value}}`;return _i.EndpointPathLiteral(t)}function ffE({writeShape:e}){return{description:e.description,availability:e.availability,name:e.name,displayName:e.displayName,shape:Gip({writeShape:e.shape})}}function Gip({writeShape:e}){switch(e.type){case"object":return{type:"object",extends:e.extends,properties:e.properties.map(t=>Hip({writeShape:t})),extraProperties:e.extraProperties};case"alias":return{type:"alias",value:e.value};case"enum":return{type:"enum",default:e.default,values:e.values.map(t=>dfE({writeShape:t}))};case"discriminatedUnion":return{type:"discriminatedUnion",discriminant:e.discriminant,variants:e.variants.map(t=>pfE({writeShape:t}))};case"undiscriminatedUnion":return{type:"undiscriminatedUnion",variants:e.variants.map(t=>_fE({writeShape:t}))};default:T7(e)}}function Hip({writeShape:e}){return{description:e.description,availability:e.availability,key:e.key,valueType:e.valueType,propertyAccess:e.propertyAccess}}function dfE({writeShape:e}){return{availability:e.availability,description:e.description,value:e.value}}function pfE({writeShape:e}){return{description:e.description,availability:e.availability,displayName:e.displayName,discriminantValue:e.discriminantValue,additionalProperties:{extends:e.additionalProperties.extends,properties:e.additionalProperties.properties.map(t=>Hip({writeShape:t})),extraProperties:e.additionalProperties.extraProperties}}}function _fE({writeShape:e}){return{description:e.description,availability:e.availability,type:e.type,displayName:e.displayName}}function r9d(e){return Object.entries(e)}var hfE=class{uniqueBaseUrls={};registerEnvironments(e){for(let t of e){let r=this.uniqueBaseUrls[t.id];r!=null?r.add(this.getHost(t.baseUrl)):this.uniqueBaseUrls[t.id]=new Set([this.getHost(t.baseUrl)])}}hasMultipleBaseUrls(){for(let[,e]of Object.entries(this.uniqueBaseUrls))if(e.size>1)return!0;return!1}getHost(e){try{return new URL(e).host}catch{return""}}},L1s={r:129,g:140,b:248,a:void 0},V1s={r:129,g:140,b:248,a:void 0};function Kip({writeShape:e,files:t}){let r=e.config.navigation?yfE(e.config.navigation):void 0,i={};Object.entries(t).forEach(([,f])=>{i[f.presignedUrl.fileId]=f.imageMetadata!=null?{type:"image",s3Key:f.key,width:f.imageMetadata.width,height:f.imageMetadata.height,blurDataUrl:f.imageMetadata.blurDataUrl,alt:f.imageMetadata.alt}:{type:"s3Key",s3Key:f.key}});let n=e.config.logo,a=e.config.logoV2;a==null&&n!=null&&(a={dark:n,light:void 0});let o=e.config.colors,c=e.config.colorsV2;return c==null&&o!=null&&(c={accentPrimary:{type:"themed",dark:o.accentPrimary,light:void 0},background:void 0}),{type:"v3",referencedApis:OfE(r,e.config.root),files:i,config:{navigation:r,root:e.config.root,logo:n,logoV2:a,logoHeight:e.config.logoHeight,logoHref:e.config.logoHref,logoRightText:e.config.logoRightText,colors:o,colorsV2:c,colorsV3:e.config.colorsV3!=null?jfE({writeShape:e.config.colorsV3,docsConfig:e.config}):void 0,navbarLinks:e.config.navbarLinks,footerLinks:e.config.footerLinks,hideNavLinks:e.config.hideNavLinks,title:e.config.title,favicon:e.config.favicon,backgroundImage:e.config.backgroundImage,typography:e.config.typography,typographyV2:e.config.typographyV2,layout:e.config.layout,theme:e.config.theme,settings:e.config.settings,css:e.config.css,js:e.config.js,metadata:e.config.metadata,redirects:e.config.redirects,integrations:e.config.integrations,defaultLanguage:e.config.defaultLanguage,languages:e.config.languages,analyticsConfig:e.config.analyticsConfig,announcement:e.config.announcement,aiChatConfig:e.config.aiChatConfig,pageActions:e.config.pageActions},pages:e.pages,jsFiles:e.jsFiles}}function yfE(e){return NlE(e,{unversioned:t=>Jip(t),versioned:t=>bfE(t)})}function bfE(e){return{versions:e.versions.map(t=>({urlSlug:t.urlSlugOverride??oC(t.version),availability:t.availability,version:t.version,config:Jip(t.config)}))}}function Jip(e){return FlE(e,{untabbed:t=>({items:t.items?.map(Jfo),landingPage:Vlo(t.landingPage,"")}),tabbed:t=>({tabs:t.tabs?.map(vfE),tabsV2:t.tabsV2?.map(gfE),landingPage:Vlo(t.landingPage,"")})})}function vfE(e){return tNs(e)?e:{...e,items:e.items?.map(Jfo),urlSlug:e.urlSlugOverride??oC(e.title??"")}}function gfE(e){switch(e.type){case"group":return{...e,items:e.items.map(Jfo),urlSlug:e.urlSlugOverride??oC(e.title)};case"link":return e;case"changelog":return{type:"changelog",...$ip(e)};case"changelogV3":return e}}function $ip(e){return{title:e.title,icon:e.icon,hidden:e.hidden??!1,description:e.description,items:e.items.map(t=>({date:t.date,pageId:t.pageId,tags:t.tags})),pageId:e.pageId,urlSlug:e.urlSlugOverride??(e.title!=null?oC(e.title):"changelog"),fullSlug:e.fullSlug}}function Jfo(e){switch(e.type){case"api":return{...e,icon:e.icon,hidden:e.hidden??!1,longScrolling:e.longScrolling,flattened:e.flattened,fullSlug:e.fullSlug,urlSlug:e.urlSlugOverride??oC(e.title),artifacts:e.artifacts!=null?AfE(e.artifacts):void 0,skipUrlSlug:e.skipUrlSlug??!1,showErrors:e.showErrors??!1,changelog:e.changelog!=null?{title:e.changelog.title,description:e.changelog.description,items:e.changelog.items.map(t=>({date:t.date,pageId:t.pageId,tags:t.tags})),pageId:e.changelog.pageId,urlSlug:e.changelog.urlSlug,fullSlug:e.fullSlug,icon:e.changelog.icon,hidden:e.changelog.hidden??!1}:void 0,navigation:wfE(e.navigation)};case"page":return Vlo(e);case"section":return{type:"section",title:e.title,icon:e.icon,urlSlug:e.urlSlugOverride??oC(e.title),collapsed:e.collapsed??!1,hidden:e.hidden??!1,items:e.items.map(t=>Jfo(t)),skipUrlSlug:e.skipUrlSlug??!1,fullSlug:e.fullSlug,overviewPageId:e.overviewPageId};case"link":return{type:"link",title:e.title,icon:e.icon,url:e.url,target:e.target};case"changelog":return{type:"changelog",...$ip(e)};case"apiV2":return e;case"changelogV3":return e;default:T7(e)}}function OfE(e,t){if(t!=null){let r=Ct.migrate.FernNavigationV1ToLatest.create().root(t);return Ct.utils.collectApiReferences(r).map(i=>i.apiDefinitionId)}return e!=null?Nip(e,{unversioned:r=>i9d(r),versioned:r=>r.versions.flatMap(i=>i9d(i.config))}):[]}function i9d(e){return Fip(e,{untabbed:t=>t.items.flatMap(Hco),tabbed:t=>{let r=[];return t.tabs?.forEach(i=>{tNs(i)||i.items&&r.push(...i.items.flatMap(Hco))}),t.tabsV2?.forEach(i=>{i.type==="group"&&i.items&&r.push(...i.items.flatMap(Hco))}),r}})}function Hco(e){switch(e.type){case"api":return[e.api];case"page":return[];case"section":return e.items.flatMap(t=>Hco(t));case"link":return[];case"changelog":return[];case"apiV2":return[e.node.apiDefinitionId];case"changelogV3":return[];default:T7(e)}}function AfE(e){return{sdks:e.sdks.map(t=>mfE(t)),postman:e.postman!=null?PfE(e.postman):void 0}}function mfE(e){switch(e.type){case"maven":return{type:"maven",coordinate:e.coordinate,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version};case"npm":return{type:"npm",packageName:e.packageName,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version};case"pypi":return{type:"pypi",packageName:e.packageName,githubRepo:{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)},version:e.version}}}function PfE(e){return{url:e.url,githubRepo:e.githubRepoName!=null?{name:e.githubRepoName,url:_i.Url(`https://github.com/${e.githubRepoName}`)}:void 0}}function jfE({writeShape:e,docsConfig:t}){switch(e.type){case"dark":return{type:"dark",accentPrimary:e.accentPrimary??L1s,logo:e.logo??t.logoV2?.dark??t.logo,background:e.background!=null?{type:"solid",...e.background}:{type:"gradient"},backgroundImage:e.backgroundImage??t.backgroundImage,border:e.border,cardBackground:e.cardBackground,sidebarBackground:e.sidebarBackground,headerBackground:e.headerBackground};case"light":return{type:"light",accentPrimary:e.accentPrimary??V1s,logo:e.logo??t.logoV2?.dark??t.logo,background:e.background!=null?{type:"solid",...e.background}:{type:"gradient"},backgroundImage:e.backgroundImage??t.backgroundImage,border:e.border,cardBackground:e.cardBackground,sidebarBackground:e.sidebarBackground,headerBackground:e.headerBackground};case"darkAndLight":return{type:"darkAndLight",light:{accentPrimary:e.light.accentPrimary??V1s,logo:e.light.logo??t.logoV2?.light??t.logo,background:e.light.background!=null?{type:"solid",...e.light.background}:{type:"gradient"},backgroundImage:e.light.backgroundImage??t.backgroundImage,border:e.light.border,cardBackground:e.light.cardBackground,sidebarBackground:e.light.sidebarBackground,headerBackground:e.light.headerBackground},dark:{accentPrimary:e.dark.accentPrimary??L1s,logo:e.dark.logo??t.logoV2?.dark??t.logo,background:e.dark.background!=null?{type:"solid",...e.dark.background}:{type:"gradient"},backgroundImage:e.dark.backgroundImage??t.backgroundImage,border:e.dark.border,cardBackground:e.dark.cardBackground,sidebarBackground:e.dark.sidebarBackground,headerBackground:e.dark.headerBackground}};default:T7(e)}}function Vlo(e,t){if(e!=null)return{type:"page",id:e.id,title:e.title,icon:e.icon,urlSlug:e.urlSlugOverride??t??oC(e.title),fullSlug:e.fullSlug,hidden:e.hidden??!1}}function wfE(e){if(e!=null)return{items:Yip(e.items),summaryPageId:e.summaryPageId}}function Yip(e){return e.map(t=>t.type==="subpackage"?{type:"subpackage",subpackageId:t.subpackageId,items:Yip(t.items),summaryPageId:t.summaryPageId}:t.type==="page"?Vlo(t):t)}var $fo=class{snippetsBySdkId;snippetsBySdkIdAndEndpointId;snippetsConfigWithSdkId;snippetTemplatesByEndpoint;snippetTemplatesByEndpointId;constructor({snippetsBySdkId:e,snippetsConfigWithSdkId:t,snippetTemplatesByEndpoint:r,snippetsBySdkIdAndEndpointId:i,snippetTemplatesByEndpointId:n}){this.snippetsBySdkId=e,this.snippetsConfigWithSdkId=t,this.snippetTemplatesByEndpoint=r,this.snippetsBySdkIdAndEndpointId=i,this.snippetTemplatesByEndpointId=n}getPythonCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.pythonSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.pythonSdk,getSnippet:n=>n.type==="python"?{...n,install:void 0}:void 0})}getTypeScriptCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.typescriptSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.typescriptSdk,getSnippet:n=>n.type==="typescript"?{...n,install:void 0}:void 0})}getGoCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.goSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.goSdk,getSnippet:n=>n.type==="go"?{...n,install:void 0}:void 0})}getRubyCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.rubySdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.rubySdk,getSnippet:n=>n.type==="ruby"?{...n,install:void 0}:void 0})}getCsharpCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i}){if(this.snippetsConfigWithSdkId.csharpSdk!=null)return this.getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n=>n.csharpSdk,getSnippet:n=>n.type==="csharp"?{...n,install:void 0}:void 0})}getCodeSnippetForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r,exampleId:i,getSdk:n,getSnippet:a}){let o=n(this.snippetsConfigWithSdkId);if(o==null)return;let c=o.sdkId,f=[];r!=null&&(f=this.snippetsBySdkIdAndEndpointId[c]?.[r]??[]),(r==null||f.length===0)&&(f=this.snippetsBySdkId[c]?.[e]?.[t]??[]);let s=f.filter(u=>i!=null&&u.exampleIdentifier===i);if(s.length===0&&f[0]!=null&&(s=[f[0]]),s[0]!=null)return a(s[0])}getSnippetTemplateForEndpoint({endpointPath:e,endpointMethod:t,endpointId:r}){let i;return r!=null&&(i=this.snippetTemplatesByEndpointId[r]),(r==null||this.snippetTemplatesByEndpointId[r]==null)&&(i=this.snippetTemplatesByEndpoint[e]?.[t]),i}};function Yfo(e){return{id:e.id,rootPackage:{endpoints:e.rootPackage.endpoints.map(t=>Xip({dbShape:t})),subpackages:e.rootPackage.subpackages,types:e.rootPackage.types,webhooks:e.rootPackage.webhooks??[],websockets:e.rootPackage.websockets??[],pointsTo:e.rootPackage.pointsTo},types:e.types,subpackages:Object.fromEntries(Object.entries(e.subpackages).map(([t,r])=>[t,EfE({dbShape:r})])),snippetsConfiguration:e.snippetsConfiguration,auth:e.auth,authSchemes:e.authSchemes,hasMultipleBaseUrls:e.hasMultipleBaseUrls,navigation:e.navigation,globalHeaders:e.globalHeaders}}function EfE({dbShape:e}){return{subpackageId:e.subpackageId,parent:e.parent,name:e.name,endpoints:e.endpoints.map(t=>Xip({dbShape:t})),types:e.types,subpackages:e.subpackages,pointsTo:e.pointsTo,urlSlug:e.urlSlug,description:e.description,webhooks:e.webhooks??[],websockets:e.websockets??[],displayName:e.displayName}}function Xip({dbShape:e}){return{environments:e.environments??[],availability:e.availability,defaultEnvironment:e.defaultEnvironment,urlSlug:e.urlSlug,migratedFromUrlSlugs:e.migratedFromUrlSlugs,method:e.method,id:e.id,originalEndpointId:e.originalEndpointId,name:e.name,path:e.path,queryParameters:e.queryParameters,headers:e.headers,request:e.request!=null?rCs({dbShape:e.request}):void 0,requestsV2:(()=>{if(e.requestsV2!=null)return e.requestsV2.requests==null||e.requestsV2.requests.length===0?e.request!=null?{requests:[rCs({dbShape:e.request})]}:void 0:{requests:e.requestsV2.requests.map(t=>rCs({dbShape:t}))}})(),response:e.response,responsesV2:e.responsesV2,errors:e.errors??[],errorsV2:MfE(e),examples:e.examples.map(t=>DfE({dbShape:t})),description:e.description,authed:e.authed??!1,authV2:e.authV2,multiAuth:SfE(e),snippetTemplates:e.snippetTemplates,protocol:e.protocol,includeInApiExplorer:e.includeInApiExplorer??!0}}function SfE(e){if(e.multiAuth!=null)return e.multiAuth;if(e.authV2!=null)return e.authV2.length===0?[]:e.authV2.map(t=>({schemes:[t]}));if(e.authed===!0)return[{schemes:["default"]}]}function MfE(e){if(e.errorsV2!=null)return e.errorsV2;if(e.errors!=null)return e.errors.map(t=>({isWildcard:void 0,name:void 0,examples:void 0,headers:void 0,...t,type:t.type!=null?{type:"alias",value:t.type}:void 0}))}function rCs({dbShape:e}){switch(e.type.type){case"object":case"reference":return{contentType:e.contentType??"application/json",description:e.description,type:e.type};case"fileUpload":case"formData":return{contentType:e.contentType??"multipart/form-data",description:e.description,type:e.type};case"bytes":return{contentType:e.contentType??"application/octet-stream",description:e.description,type:e.type};default:T7(e.type)}}function DfE({dbShape:e}){return{name:e.name,description:e.description,path:e.path,pathParameters:e.pathParameters,queryParameters:e.queryParameters,headers:e.headers,requestBody:e.requestBody,responseStatusCode:e.responseStatusCode,responseBody:e.responseBody,codeExamples:e.codeExamples,requestBodyV3:e.requestBodyV3??(e.requestBody!=null?{type:"json",value:e.requestBody}:void 0),responseBodyV3:e.responseBodyV3??(e.responseBody!=null?{type:"json",value:e.responseBody}:void 0),codeSamples:e.codeSamples??[]}}function Zip({dbShape:e}){return{navigation:e.navigation!=null?IfE(e.navigation):void 0,root:e.root,logoHeight:e.logoHeight,logoHref:e.logoHref,logoRightText:e.logoRightText,colorsV3:e.colorsV3??NfE(e),navbarLinks:e.navbarLinks,footerLinks:e.footerLinks,hideNavLinks:e.hideNavLinks,title:e.title,favicon:e.favicon,typographyV2:e.typographyV2??BfE(e.typography),layout:e.layout,theme:e.theme,settings:e.settings,css:e.css,js:e.js,metadata:e.metadata,redirects:e.redirects,integrations:e.integrations,defaultLanguage:e.defaultLanguage,languages:e.languages,analyticsConfig:e.analyticsConfig,announcement:e.announcement,aiChatConfig:e.aiChatConfig,pageActions:e.pageActions}}function iCs(e){if(e!=null)return{type:"custom",name:e.name,variants:[{fontFile:e.fontFile,weight:void 0,style:void 0}],display:void 0,fallback:void 0,fontVariationSettings:void 0}}function BfE(e){if(e!=null)return{headingsFont:iCs(e.headingsFont),bodyFont:iCs(e.bodyFont),codeFont:iCs(e.codeFont)}}function IfE(e){return Nip(e,{unversioned:t=>kip(t),versioned:t=>CfE(t)})}function CfE(e){return{versions:e.versions.map(t=>({urlSlug:t.urlSlug??oC(t.version),availability:t.availability,version:t.version,config:kip(t.config)}))}}function kip(e){return Fip(e,{tabbed:t=>({tabs:t.tabsV2?.map(TfE)??t.tabs?.map(qfE)??[],landingPage:t.landingPage}),untabbed:t=>({items:t.items.map(Xfo),landingPage:t.landingPage})})}function qfE(e){return ClE(e,{link:t=>({type:"link",...t}),group:t=>({type:"group",...t,items:t.items.map(Xfo),skipUrlSlug:t.skipUrlSlug??!1,hidden:void 0,fullSlug:void 0})})}function TfE(e){switch(e.type){case"link":return e;case"group":return{...e,items:e.items.map(Xfo),skipUrlSlug:e.skipUrlSlug??!1,hidden:void 0,fullSlug:void 0};case"changelog":case"changelogV3":return e;default:T7(e)}}function Xfo(e){switch(e.type){case"api":return{...e,showErrors:e.showErrors??!1};case"section":return{...e,items:e.items.map(t=>Xfo(t))};case"page":case"link":case"changelog":case"apiV2":case"changelogV3":return e;default:T7(e)}}var RfE={accentPrimary:L1s,background:{type:"gradient"},logo:void 0,backgroundImage:void 0,border:void 0,sidebarBackground:void 0,headerBackground:void 0,cardBackground:void 0},zfE={accentPrimary:V1s,background:{type:"gradient"},logo:void 0,backgroundImage:void 0,border:void 0,sidebarBackground:void 0,headerBackground:void 0,cardBackground:void 0};function NfE(e){let t=!1,r=!1,i={},n={};if(e.colorsV3!=null)if(e.colorsV3.type==="dark"){t=!0;let{type:c,...f}=e.colorsV3;i={...i,...f}}else if(e.colorsV3.type==="light"){r=!0;let{type:c,...f}=e.colorsV3;n={...n,...f}}else e.colorsV3.type==="darkAndLight"&&(t=!0,r=!0,i=e.colorsV3.dark,n=e.colorsV3.light);e.colorsV2!=null&&(e.colorsV2.background!=null&&(e.colorsV2.background.type==="themed"?(e.colorsV2.background.dark!=null&&i.background==null&&(t=!0,i.background={type:"solid",...e.colorsV2.background.dark}),e.colorsV2.background.light!=null&&n.background==null&&(r=!0,n.background={type:"solid",...e.colorsV2.background.light})):e.colorsV2.background.type==="unthemed"&&e.colorsV2.background.color!=null&&(go(e.colorsV2.background.color).isDark()?(t=!0,i.background={type:"solid",...e.colorsV2.background.color}):(r=!0,n.background={type:"solid",...e.colorsV2.background.color}))),e.colorsV2.accentPrimary?.type==="themed"?(e.colorsV2.accentPrimary.dark!=null&&i.accentPrimary==null&&(t=!0,i.accentPrimary=e.colorsV2.accentPrimary.dark),e.colorsV2.accentPrimary.light!=null&&n.accentPrimary==null&&(r=!0,n.accentPrimary=e.colorsV2.accentPrimary.light)):e.colorsV2.accentPrimary?.type==="unthemed"&&e.colorsV2.accentPrimary.color!=null&&(i.accentPrimary==null&&(i.accentPrimary=e.colorsV2.accentPrimary.color),n.accentPrimary==null&&(n.accentPrimary=e.colorsV2.accentPrimary.color))),e.colors!=null&&e.colors.accentPrimary!=null&&(i.accentPrimary==null&&(i.accentPrimary=e.colors.accentPrimary),n.accentPrimary==null&&(n.accentPrimary=e.colors.accentPrimary)),e.logoV2!=null&&(i.logo==null&&(i.logo=e.logoV2.dark),n.logo==null&&(n.logo=e.logoV2.light)),e.logo!=null&&(i.logo==null&&(i.logo=e.logo),n.logo==null&&(n.logo=e.logo)),e.backgroundImage!=null&&(i.backgroundImage==null&&(i.backgroundImage=e.backgroundImage),n.backgroundImage==null&&(n.backgroundImage=e.backgroundImage));let a={...RfE,...i},o={...zfE,...n};return t&&r?{type:"darkAndLight",dark:a,light:o}:t?{type:"dark",...a}:r?{type:"light",...o}:{type:"darkAndLight",dark:a,light:o}}var FfE={};Di(FfE,{EMPTY_FRONTMATTER:()=>QfE,Layout:()=>Wzs,TwitterCardSetting:()=>Gzs,commons:()=>Xtp,frontmatter:()=>Vzs,getS3KeyForDynamicIr:()=>LfE,getS3KeyForV1DocsDefinition:()=>UfE,seo:()=>xzs});var QfE={title:void 0,headline:void 0,description:void 0,subtitle:void 0,layout:void 0,slug:void 0,image:void 0,"edit-this-page-url":void 0,"hide-toc":void 0,"force-toc":void 0,"max-toc-depth":void 0,"hide-nav-links":void 0,"hide-feedback":void 0,"hide-page-actions":void 0,"no-image-zoom":void 0,breadcrumb:void 0,excerpt:void 0,"canonical-url":void 0,"og:site_name":void 0,"og:title":void 0,"og:description":void 0,"og:url":void 0,"og:image":void 0,"og:image:width":void 0,"og:image:height":void 0,"og:locale":void 0,"og:logo":void 0,"twitter:title":void 0,"twitter:description":void 0,"twitter:handle":void 0,"twitter:image":void 0,"twitter:site":void 0,"twitter:url":void 0,"twitter:card":void 0,noindex:void 0,nofollow:void 0,"jsonld:breadcrumb":void 0,keywords:void 0,logo:void 0,tags:void 0,"last-updated":void 0};function UfE(e){return process.env.LOCAL_MODE_OVERRIDE==="true"?"v1/fdr.json":`${e}/v1/fdr.json`}function LfE({orgName:e,apiName:t,language:r}){return`${e}/${t}/${r}.json`}var Ct={};Di(Ct,{ApiDefinitionHolder:()=>F_e,ApiDefinitionId:()=>Rzt,ApiDefinitionPruner:()=>kfE,ApiId:()=>zzt,ApiTypeIdVisitor:()=>GBn,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,NodeCollector:()=>fNs,NodeId:()=>nip,OrgId:()=>Jzt,PageId:()=>$zt,ProductId:()=>aip,PropertyKey:()=>Yzt,Pruner:()=>BdE,RoleId:()=>Xzt,Slug:()=>oip,TabId:()=>uip,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,V1:()=>ynp,VariantId:()=>sip,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,getChildren:()=>aNs,getPageId:()=>rnp,hasMarkdown:()=>cnp,hasMetadata:()=>KfE,hasPointsTo:()=>lnp,hasRedirect:()=>JfE,isApiLeaf:()=>Zfo,isApiReferenceNode:()=>inp,isExternalProductNode:()=>VfE,isInternalProductNode:()=>WfE,isLeaf:()=>tnp,isMarkdownLeaf:()=>nNs,isNeighbor:()=>GfE,isPage:()=>HfE,isProductGroupNode:()=>nnp,isProductNode:()=>oNs,isSection:()=>snp,isSectionOverview:()=>uNs,isSidebarRootNode:()=>x1s,isTabbedNode:()=>G1s,isUnversionedNode:()=>anp,isVariantNode:()=>onp,isVariantedNode:()=>xfE,isVersionNode:()=>unp,migrate:()=>qnp,slugjoin:()=>$fE,toDefaultSlug:()=>YfE,traverseBF:()=>XfE,traverseDF:()=>ZfE,utils:()=>Nnp});function W1s(e){return typeof e.subpackageId=="string"}function Zfo(e){return e.type==="endpoint"||e.type==="webSocket"||e.type==="webhook"||e.type==="grpc"}function nNs(e){return e.type==="page"||e.type==="landingPage"||e.type==="changelogEntry"}function tnp(e){return Zfo(e)||nNs(e)||e.type==="link"}function aNs(e){if(tnp(e))return[];switch(e.type){case"apiPackage":case"changelog":case"changelogMonth":case"changelogYear":case"section":case"sidebarGroup":case"sidebarRoot":case"tabbed":case"versioned":case"varianted":return e.children;case"product":case"root":case"tab":return[e.child];case"productLink":return[];case"variant":return e.children;case"apiReference":return[...e.children,...e.changelog?[e.changelog]:[]];case"endpointPair":return[e.nonStream,e.stream];case"productgroup":return[...e.landingPage?[e.landingPage]:[],...e.children];case"unversioned":case"version":return[...e.landingPage?[e.landingPage]:[],e.child];default:throw new enp.UnreachableCaseError(e)}}var nCs=e=>e.pageId,Mco=e=>e.overviewPageId,Dco=()=>{};function rnp(e){return jf(e)._visit({section:Mco,apiReference:Mco,changelog:Mco,apiPackage:Mco,changelogEntry:nCs,page:nCs,landingPage:nCs,endpoint:Dco,webSocket:Dco,webhook:Dco,grpc:Dco})}function inp(e){return e.type==="apiReference"}function VfE(e){return e.type==="productLink"}function WfE(e){return e.type==="product"}function nnp(e){return e.type==="productgroup"}function oNs(e){return e.type==="product"||e.type==="productLink"}function x1s(e){return e.type==="sidebarRoot"}function G1s(e){return e.type==="tabbed"}function anp(e){return e.type==="unversioned"}function xfE(e){return e?.type==="varianted"}function onp(e){return e?.type==="variant"}function unp(e){return e.type==="version"}function snp(e){return e.type==="section"||e.type==="apiReference"||e.type==="changelog"||e.type==="apiPackage"}function uNs(e){return snp(e)&&e.overviewPageId!=null}function cnp(e){return nNs(e)||uNs(e)}function GfE(e){return Zfo(e)||e.type==="page"||e.type==="changelog"||e.type==="changelogEntry"||uNs(e)}function HfE(e){return Zfo(e)||e.type==="changelog"||cnp(e)}function KfE(e){return typeof e.title=="string"&&typeof e.slug=="string"}function lnp(e){return e.type==="root"||e.type==="product"||e.type==="version"||e.type==="tab"||e.type==="section"||e.type==="apiReference"||e.type==="apiPackage"}function JfE(e){return lnp(e)?e.pointsTo!=null:!1}function $fE(...e){let t=e.filter(PBn).flatMap(n=>typeof n=="string"?[n.trim()]:n.map(a=>a.trim())).map(n=>decodeURIComponent(n)),i=((0,fnp.default)(t)??"").replaceAll("//*","/").replace(/^\//,"").replace(/\/$/,"");return i}function YfE(e,t,r){if(e!=null)return e.startsWith(r)?e.replace(new RegExp(`^${Ghi(r)}`),t).replace(/^\//,""):e}var dnp="skip",pnp=!1;function _np(e,t,r,i=n=>!0){let n=[[e,[]]];for(;n.length>0;){let[a,o]=n.shift()??[];if(!a)continue;let c=t(a,o??[]);if(c!==dnp){if(c===pnp)return;if(i(a))for(let f of[...r(a)])n.push([f,[...o??[],a]])}}}function XfE(e,t){return _np(e,t,aNs)}function hnp(e,t,r,i=n=>!0){let n=[[e,[]]];for(;n.length>0;){let[a,o]=n.pop()??[];if(!a)continue;let c=t(a,o??[]);if(c!==dnp){if(c===pnp)return;if(i(a))for(let f of[...r(a)].reverse())n.push([f,[...o??[],a]])}}}function ZfE(e,t){return hnp(e,t,aNs)}var F_e=class I_a{constructor(t){this.api=t,[t.rootPackage,...Object.values(t.subpackages)].forEach(r=>{let i=W1s(r)?r.subpackageId:Pzt;r.endpoints.forEach(n=>{this.#e.set(I_a.createEndpointId(n,i),n)}),r.websockets.forEach(n=>{this.#t.set(I_a.createWebSocketId(n,i),n)}),r.webhooks.forEach(n=>{this.#r.set(I_a.createWebhookId(n,i),n)})})}static create(t){return new I_a(t)}#e=new Map;#t=new Map;#r=new Map;get endpoints(){return this.#e}get webSockets(){return this.#t}get webhooks(){return this.#r}static createEndpointId(t,r=Pzt){return t.originalEndpointId??`${r}.${t.id}`}static createWebSocketId(t,r=Pzt){return`${r}.${t.id}`}static createWebhookId(t,r=Pzt){return`${r}.${t.id}`}static createGrpcId(t,r=Pzt){return`${r}.${t.id}`}},GBn=class tv{static visitEndpointDefinition(t,r){t.path.pathParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.queryParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.request!=null&&tv.visitHttpRequestBodyShape(t.request.type,r),t.response!=null&&tv.visitHttpResponseBodyShape(t.response.type,r),t.errorsV2!=null&&t.errorsV2.forEach(i=>{i.type!=null&&tv.visitTypeShape(i.type,r)})}static visitWebSocketChannel(t,r){t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.path.pathParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.queryParameters.forEach(i=>{tv.visitTypeReference(i.type,r)}),t.messages.forEach(i=>{tv.visitObjectOrReference(i.body,r)})}static visitWebhookDefinition(t,r){t.headers.forEach(i=>{tv.visitTypeReference(i.type,r)}),tv.visitObjectOrReference(t.payload.type,r)}static visitHttpRequestBodyShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r),bytes:Zhi.noop,formData:i=>tv.visitFormDataRequest(i,r),fileUpload:i=>i.value!=null?tv.visitFormDataRequest(i.value,r):void 0})}static visitHttpResponseBodyShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r),fileDownload:Zhi.noop,streamingText:Zhi.noop,stream:i=>tv.visitObjectOrReference(i.shape,r),streamCondition:i=>{tv.visitObjectOrReference(i.response.shape,r),tv.visitObjectOrReference(i.streamResponse.shape,r)}})}static visitObjectOrReference(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),reference:i=>tv.visitTypeReference(i.value,r)})}static visitFormDataRequest(t,r){return t.properties.forEach(i=>jf(i)._visit({file:Zhi.noop,bodyProperty:n=>tv.visitTypeReference(n.valueType,r)}))}static visitTypeDefinition(t,r){return tv.visitTypeShape(t.shape,r)}static visitTypeShape(t,r){return jf(t)._visit({object:i=>tv.visitObjectType(i,r),alias:i=>tv.visitTypeReference(i.value,r),enum:Zhi.noop,undiscriminatedUnion:i=>i.variants.forEach(n=>tv.visitTypeReference(n.type,r)),discriminatedUnion:i=>i.variants.forEach(n=>tv.visitObjectType(n.additionalProperties,r))})}static visitObjectType(t,r){t.extends.forEach(r),t.properties.forEach(i=>{tv.visitTypeReference(i.valueType,r)})}static visitTypeReference(t,r){return jf(t)._visit({id:i=>r(i.value),primitive:Zhi.noop,nullable:i=>tv.visitTypeReference(i.itemType,r),optional:i=>tv.visitTypeReference(i.itemType,r),list:i=>tv.visitTypeReference(i.itemType,r),set:i=>tv.visitTypeReference(i.itemType,r),map:i=>{tv.visitTypeReference(i.keyType,r),tv.visitTypeReference(i.valueType,r)},literal:Zhi.noop,unknown:Zhi.noop})}},kfE=class{constructor(e){this.api=e}prune(e){let t=this.pruneRootPackage(e),r=this.pruneSubpackages(e),i=this.pruneTypes(t,r,this.api.globalHeaders);return{id:this.api.id,rootPackage:t,subpackages:r,snippetsConfiguration:this.api.snippetsConfiguration,types:i,auth:this.api.auth,authSchemes:this.api.authSchemes,hasMultipleBaseUrls:this.api.hasMultipleBaseUrls,navigation:void 0,globalHeaders:this.api.globalHeaders}}pruneTypes(e,t,r){let i=new Set;r?.forEach(a=>{GBn.visitTypeReference(a.type,o=>i.add(o))}),i=this.expandTypeIds(i),[e,...Object.values(t)].forEach(a=>{a.types.forEach(o=>i.add(o))});let n={};return i.forEach(a=>{let o=this.api.types[a];o!=null&&(n[a]=o)}),n}expandTypeIds(e){let t=new Set,r=Array.from(e);for(;r.length>0;){let i=r.pop();if(i!=null&&!t.has(i)){t.add(i);let n=this.api.types[i];n&&GBn.visitTypeDefinition(n,a=>{r.push(a)})}}return t}pruneRootPackage(e){return this.prunePackage(e,this.api.rootPackage)}pruneSubpackages(e){let t={};for(let[r,i]of Object.entries(this.api.subpackages))t[r]=this.prunePackage(e,i,r);return t}prunePackage(e,t,r){let i=this.pruneEndpoints(e,t.endpoints,r),n=this.pruneWebSockets(e,t.websockets,r),a=this.pruneWebhooks(e,t.webhooks,r),o=new Set;i.forEach(f=>{GBn.visitEndpointDefinition(f,s=>o.add(s))}),n.forEach(f=>{GBn.visitWebSocketChannel(f,s=>o.add(s))}),a.forEach(f=>{GBn.visitWebhookDefinition(f,s=>o.add(s))});let c=this.expandTypeIds(o);return{...t,endpoints:i,websockets:n,webhooks:a,types:Array.from(c)}}pruneEndpoints(e,t,r){if(e.type!=="endpoint"&&e.type!=="endpointPair")return[];if(e.type==="endpointPair")return[...this.pruneEndpoints(e.stream,t,r),...this.pruneEndpoints(e.nonStream,t,r)];let i=e.endpointId,n=t.find(a=>F_e.createEndpointId(a,r)===i);return n?[n]:[]}pruneWebSockets(e,t,r){if(e.type!=="webSocket")return[];let i=e.webSocketId,n=t.find(a=>F_e.createWebSocketId(a,r)===i);return n?[n]:[]}pruneWebhooks(e,t,r){if(e.type!=="webhook")return[];let i=e.webhookId,n=t.find(a=>F_e.createWebhookId(a,r)===i);return n?[n]:[]}};function edE(e,t,r){if(e!=null)return Ct.traverseDF(e,i=>{if(Ct.hasMetadata(i)){let n=Ct.toDefaultSlug(i.slug,t,r);if(i.slug===n)return"skip";i.canonicalSlug=i.canonicalSlug??i.slug,i.slug=n}Ct.hasRedirect(i)&&(i.pointsTo=Ct.toDefaultSlug(i.pointsTo,t,r))}),e}var ynp={};Di(ynp,{ApiDefinitionId:()=>Rzt,ApiId:()=>zzt,ApiReferenceNavigationConverter:()=>Pnp,AuthSchemeId:()=>Nzt,Availability:()=>o1,DocsConfigId:()=>Fzt,EndpointId:()=>Qzt,EndpointPathLiteral:()=>Uzt,EnvironmentId:()=>Lzt,FileId:()=>Vzt,GrpcId:()=>Wzt,GrpcMethod:()=>xzt,HttpMethod:()=>Gzt,JqString:()=>Hzt,LinkTarget:()=>Kzt,NavigationV1Availability:()=>lip,NodeId:()=>fip,OrgId:()=>Jzt,PageId:()=>$zt,ProductId:()=>dip,PropertyKey:()=>Yzt,RoleId:()=>Xzt,Slug:()=>pip,SlugGenerator:()=>sNs,TabId:()=>_ip,TokenId:()=>Zzt,TypeId:()=>kzt,Url:()=>eNt,VariantId:()=>hip,VersionId:()=>tNt,WebSocketId:()=>iNt,WebhookId:()=>rNt,convertAvailability:()=>tdE,followRedirect:()=>mzt,followRedirects:()=>jMi,getPageId:()=>fdE,hasMarkdown:()=>Bnp,hasMetadata:()=>Snp,hasRedirect:()=>_dE,isApiLeaf:()=>kfo,isLeaf:()=>Mnp,isMarkdownLeaf:()=>cNs,isNeighbor:()=>ddE,isPage:()=>pdE,isSection:()=>Dnp,isSectionOverview:()=>lNs,slugjoin:()=>hdE,toDefaultSlug:()=>ydE,toRootNode:()=>udE,traverseDF:()=>vdE});function tdE(e){if(e!=null)switch(e){case _i.Availability.Beta:return Ct.V1.NavigationV1Availability.Beta;case _i.Availability.Stable:return Ct.V1.NavigationV1Availability.Stable;case _i.Availability.GenerallyAvailable:return Ct.V1.NavigationV1Availability.GenerallyAvailable;case _i.Availability.Deprecated:return Ct.V1.NavigationV1Availability.Deprecated;case _i.Availability.InDevelopment:return Ct.V1.NavigationV1Availability.InDevelopment;case _i.Availability.PreRelease:return Ct.V1.NavigationV1Availability.PreRelease;default:throw new bnp.UnreachableCaseError(e)}}function Bco(e){return(0,Onp.default)("/",...e.map(t=>t.type==="literal"?t.value:`:${t.value}`))}vIn.default.extend(Anp.default);var H1s=class mnp{constructor(t,r,i){this.fullSlugMap=r,this.noindexMap=i,this.#e=t}static convert(t,r,i,n,a){return new mnp(a,r,i).convert(t,n)}#e;convert(t,r){return this.#e.with("log",i=>{let n=r.apply(t),a=t.pageId!=null?Ct.V1.PageId(t.pageId):void 0,o=a!=null?this.noindexMap[a]:void 0,c=a!=null?this.fullSlugMap[a]:void 0;return c!=null&&(n=r.set(c)),{id:i,type:"changelog",title:t.title??"Changelog",overviewPageId:a,noindex:o,slug:n.get(),icon:t.icon,hidden:t.hidden,children:this.convertYear(t.items,n),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}convertYear(t,r){let i=aCs(t.map(n=>this.convertChangelogEntry(n,r)),n=>n.date,"desc");return this.groupByYear(i,r)}groupByYear(t,r){let i=rdE(t);return aCs(Array.from(i.entries()).map(([n,a])=>this.#e.with(n.toString(),o=>{let c=r.append(n.toString());return{id:o,type:"changelogYear",title:n.toString(),year:n,slug:c.get(),icon:void 0,hidden:void 0,children:this.groupByMonth(a,c),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})),"year","desc")}groupByMonth(t,r){let i=idE(t);return aCs(Array.from(i.entries()).map(([n,[a,o]])=>this.#e.with(n.toString(),c=>({id:c,type:"changelogMonth",title:(0,vIn.default)(new Date(a,n-1)).format("MMMM YYYY"),month:n,slug:r.append(n.toString()).get(),icon:void 0,hidden:void 0,children:o,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))),"month","desc")}convertChangelogEntry(t,r){let i=vIn.default.utc(t.date);return this.#e.with(i.format("YYYY-M-D"),n=>{let a=Ct.V1.PageId(t.pageId),o=this.noindexMap[a];return{id:n,type:"changelogEntry",title:i.format("MMMM D, YYYY"),date:t.date,pageId:a,noindex:o,slug:r.append(i.format("YYYY/M/D")).get(),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,tags:t.tags}})}};function aCs(e,t,r="asc"){return e.concat().sort((i,n)=>{let a=typeof t=="function"?t(i):i[t],o=typeof t=="function"?t(n):n[t];return a<o?r==="asc"?-1:1:a>o?r==="asc"?1:-1:0})}function rdE(e){let t=new Map;for(let r of e){let i=vIn.default.utc(r.date).year(),n=t.get(i)??[];n.push(r),t.set(i,n)}return t}function idE(e){let t=new Map;for(let r of e){let i=vIn.default.utc(r.date),n=i.month()+1,a=i.year(),o=t.get(n)??[a,[]];o[1].push(r),t.set(n,o)}return t}var K1s=class{#e=[];with(e,t){this.#e.push(e);let r=t(this.#r());return this.#e.pop(),r}#t=new Set;#r(){let e=this.#e.join("."),t=e,r=0;for(;this.#t.has(t);)t=`${e}-${r}`,r++;return this.#t.add(t),Ct.V1.NodeId(t)}},sNs=class HBn{constructor(t,r,i,n){this.baseSlug=t,this.productSlug=r,this.versionSlug=i,this.slug=n}static init(t){return new HBn(t,void 0,void 0,t)}get(){return Ct.V1.Slug(Ct.V1.slugjoin(this.slug))}setProductSlug(t){if(this.productSlug!=null){if(this.productSlug===Ct.V1.slugjoin(this.baseSlug,t))return this;throw new Error("Product already set")}let r=Ct.V1.slugjoin(this.baseSlug,t);if(this.baseSlug===t)throw new Error("Product slug is the same as base slug");return new HBn(this.baseSlug,r,this.versionSlug,r)}setVersionSlug(t){if(this.versionSlug!=null){if(this.productSlug){let i=Ct.V1.slugjoin(this.productSlug,t);if(this.versionSlug===i)return this}else if(this.versionSlug===Ct.V1.slugjoin(this.baseSlug,t))return this;throw new Error("Version already set")}let r=this.productSlug?Ct.V1.slugjoin(this.productSlug,t):Ct.V1.slugjoin(this.baseSlug,t);if(this.baseSlug===t)throw new Error("Version slug is the same as base slug");return new HBn(this.baseSlug,this.productSlug,r,r)}append(t){return new HBn(this.baseSlug,this.productSlug,this.versionSlug,Ct.V1.slugjoin(this.slug,t))}set(t){t=Ct.V1.slugjoin(t);let r=a=>new HBn(this.baseSlug,this.productSlug,this.versionSlug,a),i=a=>a.substring(this.baseSlug.length),n=a=>this.productSlug&&a.startsWith(this.productSlug)?a.substring(this.productSlug.length):a;if(this.productSlug!=null&&this.versionSlug!=null){if(t.startsWith(this.productSlug)){let a=n(t);return r(Ct.V1.slugjoin(this.versionSlug,a))}if(this.baseSlug.length>0&&t.startsWith(this.baseSlug)){let a=i(t);return r(Ct.V1.slugjoin(this.baseSlug,a))}return r(Ct.V1.slugjoin(this.versionSlug,t))}return this.versionSlug!=null?t.startsWith(this.versionSlug)?r(t):this.baseSlug.length>0&&t.startsWith(this.baseSlug)?r(Ct.V1.slugjoin(this.versionSlug,i(t))):r(Ct.V1.slugjoin(this.versionSlug,t)):this.productSlug!=null?t.startsWith(this.productSlug)?r(t):this.baseSlug.length>0&&t.startsWith(this.baseSlug)?r(Ct.V1.slugjoin(i(t))):r(Ct.V1.slugjoin(this.productSlug,t)):this.baseSlug.length>0?t.startsWith(this.baseSlug)?r(t):r(Ct.V1.slugjoin(this.baseSlug,t)):r(t)}apply({fullSlug:t,urlSlug:r,skipUrlSlug:i}){return t!=null?this.set(t.join("/")):i?this:this.append(r)}},Pnp=class jnp{constructor(t,r,i={},n={},a=sNs.init(""),o=new K1s,c=!1,f=!1,s){this.apiSection=t,this.api=r,this.fullSlugMap=i,this.noindexMap=n,this.parentSlug=a,this.lexicographic=c,this.disableEndpointPairs=f,this.paginated=s,this.apiDefinitionId=Ct.V1.ApiDefinitionId(r.id),this.#e=F_e.create(r),this.#o=o}static convert(t,r,i,n,a,o,c,f,s){return new jnp(t,r,i,n,a,o??new K1s,c,f,s).convert()}apiDefinitionId;#e;#t=new Set;#r=new Set;#i=new Set;#n=new Set;#a=new Set;#o;convert(){return this.#o.with(this.apiSection.urlSlug,t=>{let r=this.apiSection.navigation?.summaryPageId!=null?Ct.V1.PageId(this.apiSection.navigation.summaryPageId):void 0,i=r!=null?this.noindexMap[r]:void 0,n=this.parentSlug.apply(this.apiSection),a=r!=null?this.fullSlugMap[r]:void 0;a!=null&&(n=this.parentSlug.set(a));let o=this.convertChildren(n),c=this.apiSection.changelog!=null?H1s.convert(this.apiSection.changelog,this.fullSlugMap,this.noindexMap,n,this.#o):void 0,f=Ct.V1.followRedirects(o)??c?.slug;return{id:t,type:"apiReference",title:this.apiSection.title,apiDefinitionId:Ct.V1.ApiDefinitionId(this.apiSection.api),overviewPageId:r,noindex:i,paginated:this.paginated??(this.apiSection.longScrolling===!1?!0:void 0),slug:n.get(),icon:this.apiSection.icon,hidden:this.apiSection.hidden,hideTitle:this.apiSection.flattened,showErrors:this.apiSection.showErrors,changelog:c,children:o,availability:void 0,pointsTo:f,playground:void 0,postmanCollectionUrl:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}convertChildren(t){return this.apiSection.navigation!=null?this.convertApiNavigationItems(this.apiSection.navigation.items,t,oQ.SubpackageId("root")):this.convertPackageToChildren(this.api.rootPackage,t)}convertEndpointNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"endpoint",title:r.name??Bco(r.path.parts),endpointId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,method:r.method,apiDefinitionId:this.apiDefinitionId,availability:Ct.V1.convertAvailability(r.availability),isResponseStream:r.response?.type.type==="stream",playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertGrpcNode(t,r,i,n){return this.#o.with(t,a=>({id:a,type:"grpc",title:r.name??Bco(r.path.parts),grpcId:t,slug:n.apply(r).get(),icon:void 0,hidden:void 0,method:i,apiDefinitionId:this.apiDefinitionId,availability:void 0,isResponseStream:!1,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertWebSocketNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"webSocket",title:r.name??Bco(r.path.parts),webSocketId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,apiDefinitionId:this.apiDefinitionId,availability:Ct.V1.convertAvailability(r.availability),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertWebhookNode(t,r,i){return this.#o.with(t,n=>({id:n,type:"webhook",title:r.name??(0,gnp.default)("/",...r.path),webhookId:t,slug:i.apply(r).get(),icon:void 0,hidden:void 0,method:r.method,apiDefinitionId:this.apiDefinitionId,availability:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}))}convertPackageToChildren(t,r){let i=[],n=W1s(t)?t.subpackageId:"__package__";for(;t.pointsTo!=null;){n=t.pointsTo;let o=this.api.subpackages[t.pointsTo];if(o==null)return[];t=o}if(this.#a.has(n))return i;t.endpoints.forEach(o=>{if(o.protocol?.type==="grpc"&&o.protocol.methodType!=null){let c=F_e.createGrpcId(o,n);if(this.#n.has(c))return;i.push(this.convertGrpcNode(c,o,o.protocol.methodType,r)),this.#n.add(c)}else{let c=F_e.createEndpointId(o,n);if(this.#t.has(c))return;i.push(this.convertEndpointNode(c,o,r)),this.#t.add(c)}}),t.websockets.forEach(o=>{let c=F_e.createWebSocketId(o,n);this.#r.has(c)||(i.push(this.convertWebSocketNode(c,o,r)),this.#r.add(c))}),t.webhooks.forEach(o=>{let c=F_e.createWebhookId(o,n);this.#i.has(c)||(i.push(this.convertWebhookNode(c,o,r)),this.#i.add(c))}),t.subpackages.forEach(o=>{let c=this.api.subpackages[o];if(c==null){console.error(`Subpackage ${o} not found in ${this.apiDefinitionId}`);return}let f=this.#o.with(o,s=>{let u=r.apply(c),l=this.convertPackageToChildren(c,u);if(l.length===0)return;let p=Ct.V1.followRedirects(l);return{id:s,type:"apiPackage",children:l,title:c.displayName??Jco(c.name),slug:u.get(),icon:void 0,hidden:void 0,overviewPageId:void 0,noindex:void 0,availability:void 0,apiDefinitionId:this.apiDefinitionId,pointsTo:p,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}});f!=null&&i.push(f)}),this.#a.add(n);let a=this.mergeEndpointPairs(i);return this.lexicographic&&a.sort((o,c)=>{let f=o.type==="endpointPair"?o.nonStream.title:o.title,s=c.type==="endpointPair"?c.nonStream.title:c.title;return f.localeCompare(s)}),a}convertApiNavigationItems(t,r,i){let n=[],a=i==="root"?this.api.rootPackage:this.api.subpackages[i];if(a==null)throw new Error(`${i} is not present within known subpackages: ${Object.keys(this.api.subpackages).join(", ")}`);for(;a.pointsTo!=null;)if(a=this.api.subpackages[a.pointsTo],a==null)return[];let o=W1s(a)?a.subpackageId:Pzt,c=new Map,f=new Map,s=new Map,u=new Map;return a.endpoints.forEach(l=>{c.set(l.id,l)}),a.websockets.forEach(l=>{f.set(l.id,l)}),a.webhooks.forEach(l=>{s.set(l.id,l)}),a.endpoints.forEach(l=>{l.protocol?.type==="grpc"&&u.set(l.id,l)}),t.forEach(l=>{jf(l,"type")._visit({page:p=>{n.push(this.#o.with(p.urlSlug,_=>{let h=Ct.V1.PageId(p.id),y=this.noindexMap[h];return{id:_,type:"page",title:p.title,pageId:h,noindex:y,slug:r.apply(p).get(),icon:p.icon,hidden:p.hidden,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}))},endpointId:p=>{let _=c.get(p.value);if(_==null){console.error(`Endpoint ${p.value} not found in ${o}`);return}if(_.protocol?.type==="grpc"){let h=F_e.createGrpcId(_,o);n.push(this.convertGrpcNode(h,_,_.protocol.methodType??"UNARY",r)),this.#n.add(h)}else{let h=F_e.createEndpointId(_,o);n.push(this.convertEndpointNode(h,_,r)),this.#t.add(h)}},websocketId:p=>{let _=f.get(p.value);if(_==null){console.error(`WebSocket ${p.value} not found in ${o}`);return}let h=F_e.createWebSocketId(_,o);n.push(this.convertWebSocketNode(h,_,r)),this.#r.add(h)},webhookId:p=>{let _=s.get(p.value);if(_==null){console.error(`Webhook ${p.value} not found in ${o}`);return}let h=F_e.createWebhookId(_,o);n.push(this.convertWebhookNode(h,_,r)),this.#i.add(h)},subpackage:({subpackageId:p,items:_,summaryPageId:h})=>{let y=this.api.subpackages[p];if(y==null){console.error(`Subpackage ${p} not found in ${o}`);return}let b=r.apply(y),v=h!=null?Ct.V1.PageId(h):void 0,O=v!=null?this.noindexMap[v]:void 0,A=v!=null?this.fullSlugMap[v]:void 0;A!=null&&(b=this.parentSlug.set(A)),this.#o.with(p,g=>{let m=this.convertApiNavigationItems(_,b,p);n.push({id:g,type:"apiPackage",children:m,title:y.displayName??Jco(y.name),slug:b.get(),icon:void 0,hidden:void 0,overviewPageId:v,noindex:O,availability:void 0,apiDefinitionId:this.apiDefinitionId,pointsTo:Ct.V1.followRedirects(m),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})})},_other:vnp.noop})}),n.push(...this.convertPackageToChildren(a,r)),this.mergeEndpointPairs(n)}mergeEndpointPairs(t){if(this.disableEndpointPairs)return t;let r=[],i=new Map;return t.forEach(n=>{if(n.type!=="endpoint"){r.push(n);return}let a=this.#e.endpoints.get(n.endpointId);if(a==null)throw new Error(`Endpoint ${n.endpointId} not found`);let o=`${a.method} ${Bco(a.path.parts)}`,c=i.get(o);if(i.set(o,n),c==null||r.indexOf(c)===-1||c.isResponseStream===n.isResponseStream){r.push(n);return}let f=r.indexOf(c),s=this.#o.with("endpoint-pair",u=>({id:u,type:"endpointPair",stream:n.isResponseStream?n:c,nonStream:n.isResponseStream?c:n}));r[f]=s}),r}};function ndE(e){let t=/^---\s*([\s\S]*?)\s*---/.exec(e.trimStart());if(!(!t||t[1]==null))return t[1]}function wnp(e){if(/noindex:\s*true/.test(e))return!0;if(/noindex:\s*false/.test(e))return!1}function adE(e){let t=e.match(/slug:\s*"?([^"\n\s]+)"?/);if(t!=null&&t[1]!=null)return Ct.V1.slugjoin(t[1])}var odE=class Enp{constructor(t,r,i,n,a,o,c,f,s){this.title=t,this.config=r,this.fullSlugMap=i,this.noindexMap=n,this.apis=a,this.basePath=o,this.lexicographic=c,this.disableEndpointPairs=f,this.paginated=s}static convert(t,r,i,n,a,o,c,f,s){return new Enp(t,r,i,n,a,o,c,f,s).convert()}#e=new K1s;convert(){return this.#e.with("root",t=>{let r=sNs.init(this.basePath??""),i=qlE(this.config,{versioned:o=>this.convertVersionedNavigationConfig(o,r),unversioned:o=>this.convertUnversionedNavigationConfig(o,r)}),n=Ct.V1.followRedirect(i);if(n!=null&&i.type==="versioned"){let o=i.children.find(c=>c.default);o!=null&&(n=Ct.V1.toDefaultSlug(n,r.get(),o.slug))}let a={id:t,type:"root",version:"v1",child:i,slug:r.get(),title:this.title??"Documentation",hidden:!1,icon:void 0,pointsTo:n,authed:void 0,viewers:void 0,orphaned:void 0,roles:void 0,featureFlags:void 0};return Ct.V1.traverseDF(a,(o,c)=>{Ct.V1.hasMetadata(o)&&c.some(f=>Ct.V1.hasMetadata(f)&&f.hidden)&&(o.hidden=!0)}),a})}convertVersionedNavigationConfig(t,r){return this.#e.with("",i=>{let n=t.versions.map((a,o)=>{let c=r.setVersionSlug(a.urlSlug);return this.#e.with(a.urlSlug,f=>{let s=this.convertUnversionedNavigationConfig(a.config,c),u=Ct.V1.followRedirect(s);return{id:f,type:"version",title:a.version,default:o===0,versionId:Ct.V1.VersionId(a.version),slug:c.get(),icon:void 0,hidden:!1,child:s.child,availability:Ct.V1.convertAvailability(a.availability),pointsTo:u,landingPage:s.landingPage,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,announcement:void 0}})});return{id:i,type:"versioned",children:n}})}convertUnversionedNavigationConfig(t,r){return this.#e.with("uv",i=>{let n=TlE(t,{tabbed:a=>({id:i,type:"tabbed",children:a.tabs.map(o=>{if(o.type==="group"||o.type==null)return this.#e.with(o.urlSlug,c=>{let f=r.apply(o),s=this.#e.with(o.urlSlug,l=>({id:l,type:"sidebarRoot",children:this.groupSidebarRootChildren(o.items.map(p=>this.convertNavigationItem(p,f)))})),u=Ct.V1.followRedirect(s);return{id:c,type:"tab",title:o.title,slug:f.get(),icon:o.icon,hidden:o.hidden,child:s,pointsTo:u,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}});if(o.type==="link")return this.#e.with("link",c=>({id:c,type:"link",title:o.title,url:Ct.V1.Url(o.url),icon:o.icon,target:o.target}));if(o.type==="changelog"){let c=r.apply(o);return H1s.convert(o,this.fullSlugMap,this.noindexMap,c,this.#e)}else{if(o.type==="changelogV3")return o.node;T7(o)}})}),untabbed:a=>({id:i,type:"sidebarRoot",children:this.groupSidebarRootChildren(a.items.map(o=>this.convertNavigationItem(o,r)))})});return{id:i,type:"unversioned",child:n,landingPage:this.#e.with("landing-page",a=>{if(t.landingPage==null)return;let o=Ct.V1.PageId(t.landingPage.id);return{id:a,type:"landingPage",pageId:o,title:t.landingPage.title,slug:r.apply(t.landingPage).get(),icon:t.landingPage.icon,hidden:t.landingPage.hidden,noindex:this.noindexMap[o],authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}})}groupSidebarRootChildren(t){let r=[];return t.forEach(i=>{if(i.type==="apiReference"){r.push(i);return}if(i.type==="section"&&!i.collapsed){r.push(i);return}let n=r.length>0?r[r.length-1]:void 0,a;n?.type==="sidebarGroup"?a=n:(a=this.#e.with("group",o=>({id:o,type:"sidebarGroup",children:[]})),r.push(a)),a.children.push(i)}),r}convertNavigationItem(t,r){return jf(t,"type")._visit({page:i=>this.#e.with(i.urlSlug,n=>{let a=Ct.V1.PageId(i.id);return{id:n,type:"page",pageId:a,title:i.title,slug:r.apply(i).get(),icon:i.icon,hidden:i.hidden,noindex:this.noindexMap[a],authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}),link:i=>this.#e.with(oC(i.title),n=>({id:n,type:"link",title:i.title,url:Ct.V1.Url(i.url),icon:i.icon,target:i.target})),section:i=>this.#e.with(i.urlSlug,n=>{let a=r.apply(i),o=i.items.map(l=>this.convertNavigationItem(l,a)),c=Ct.V1.followRedirects(o),f=i.overviewPageId!=null?Ct.V1.PageId(i.overviewPageId):void 0,s=f!=null?this.noindexMap[f]:void 0,u=f!=null?this.fullSlugMap[f]:void 0;return u!=null&&(a=r.set(u)),{id:n,type:"section",collapsed:i.collapsed,title:i.title,icon:i.icon,hidden:i.hidden,overviewPageId:f,noindex:s,slug:a.get(),children:o,pointsTo:c,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}}),api:i=>{let n=this.apis[i.api];if(n==null)throw new Error(`API ${i.api} not found}`);return Pnp.convert(i,n,this.fullSlugMap,this.noindexMap,r,this.#e,this.lexicographic,this.disableEndpointPairs,this.paginated)},changelog:i=>H1s.convert(i,this.fullSlugMap,this.noindexMap,r,this.#e),apiV2:i=>{let n=i.node;return this.paginated&&(n.paginated=!0),n},changelogV3:i=>i.node,_other:i=>T7(i)})}};function udE(e,t=!1,r){let i={},n={};return Object.entries(e.definition.pages).forEach(([a,o])=>{let c=ndE(o.markdown);if(c==null)return;let f=wnp(c);f!=null&&(i[Ct.V1.PageId(a)]=f);let s=adE(c);s!=null&&(n[Ct.V1.PageId(a)]=s)}),e.definition.config.root?e.definition.config.root:e.definition.config.navigation?odE.convert(e.definition.config.title,e.definition.config.navigation,n,i,cdE(e.definition.apis,e.baseUrl.domain),e.baseUrl.basePath,sdE(e.baseUrl.domain),t,r):(console.error("No root node found"),{type:"root",version:"v1",child:{type:"unversioned",id:Ct.V1.NodeId("root-unversioned"),child:{type:"sidebarRoot",id:Ct.V1.NodeId("root-sidebar"),children:[]},landingPage:void 0},title:e.definition.config.title??"",slug:Ct.V1.Slug(""),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,id:Ct.V1.NodeId("root"),pointsTo:void 0,roles:void 0})}function sdE(e){return e.toLowerCase().includes("aia.docs.buildwithfern.com")}function cdE(e,t){return t.includes("assemblyai")?rQ(e,r=>ldE(r)):e}function ldE(e){let t=oQ.SubpackageId("subpackage_realtime"),r=oQ.SubpackageId("subpackage_streaming"),i=e.subpackages[t],n=e.subpackages[r];return i==null||n==null||(n.endpoints=[...i.endpoints,...n.endpoints],n.websockets=[...i.websockets,...n.websockets],n.webhooks=[...i.webhooks,...n.webhooks],delete e.subpackages[t],e.rootPackage.subpackages=e.rootPackage.subpackages.filter(a=>a!==t)),e}function Snp(e){return typeof e.title=="string"&&typeof e.slug=="string"}function mzt(e){if(e!=null)return jf(e)._visit({link:()=>{},page:t=>t.slug,changelog:t=>t.slug,changelogYear:t=>t.slug,changelogMonth:t=>t.slug,changelogEntry:t=>t.slug,endpoint:t=>t.slug,webSocket:t=>t.slug,webhook:t=>t.slug,grpc:t=>t.slug,landingPage:t=>t.slug,apiPackage:t=>t.overviewPageId!=null?t.slug:jMi(t.children),section:t=>t.overviewPageId!=null?t.slug:jMi(t.children),apiReference:t=>t.overviewPageId!=null?t.slug:jMi(t.children),product:t=>mzt(t.child),productLink:()=>{},productgroup:t=>mzt(t.landingPage??t.children.filter(r=>!r.hidden)[0]),versioned:t=>mzt(t.children.filter(r=>!r.hidden)[0]),unversioned:t=>mzt(t.landingPage??t.child),varianted:t=>mzt(t.children.filter(r=>!r.hidden)[0]),variant:t=>jMi(t.children),tabbed:t=>jMi(t.children),sidebarRoot:t=>jMi(t.children),endpointPair:t=>mzt(t.nonStream),root:t=>mzt(t.child),version:t=>mzt(t.child),tab:t=>mzt(t.child),sidebarGroup:t=>jMi(t.children)})}function jMi(e){for(let t of e){if(Snp(t)&&t.hidden)continue;let r=mzt(t);if(r!=null)return r}}var oCs=e=>e.pageId,Ico=e=>e.overviewPageId,ABn=()=>{};function fdE(e){return jf(e)._visit({section:Ico,apiReference:Ico,changelog:Ico,apiPackage:Ico,changelogEntry:oCs,page:oCs,landingPage:oCs,endpoint:ABn,webSocket:ABn,webhook:ABn,grpc:ABn,changelogYear:ABn,changelogMonth:ABn})}function kfo(e){return e.type==="endpoint"||e.type==="webSocket"||e.type==="webhook"||e.type==="grpc"}function cNs(e){return e.type==="page"||e.type==="landingPage"||e.type==="changelogEntry"}function Mnp(e){return kfo(e)||cNs(e)||e.type==="link"}function Dnp(e){return e.type==="section"||e.type==="apiReference"||e.type==="changelog"||e.type==="apiPackage"}function lNs(e){return Dnp(e)&&e.overviewPageId!=null}function Bnp(e){return cNs(e)||lNs(e)}function ddE(e){return kfo(e)||e.type==="page"||e.type==="changelog"||e.type==="changelogEntry"||lNs(e)}function pdE(e){return kfo(e)||e.type==="changelog"||Bnp(e)}function _dE(e){return typeof e.pointsTo=="string"}function hdE(...e){let t=e.map(n=>n.trim()),i=((0,Inp.default)(t)??"").replaceAll("//*","/").replace(/^\//,"").replace(/\/$/,"");return i}function ydE(e,t,r){if(e!=null)return e.startsWith(r)?e.replace(new RegExp(`^${Ghi(r)}`),t).replace(/^\//,""):e}function bdE(e){if(Mnp(e))return[];switch(e.type){case"apiPackage":case"changelog":case"changelogMonth":case"changelogYear":case"section":case"sidebarGroup":case"sidebarRoot":case"tabbed":case"versioned":case"varianted":case"variant":return e.children;case"product":case"root":case"tab":return[e.child];case"productLink":return[];case"apiReference":return[...e.children,...e.changelog?[e.changelog]:[]];case"endpointPair":return[e.nonStream,e.stream];case"productgroup":return[...e.landingPage?[e.landingPage]:[],...e.children];case"unversioned":case"version":return[...e.landingPage?[e.landingPage]:[],e.child];default:throw new Cnp.UnreachableCaseError(e)}}function vdE(e,t){return hnp(e,t,bdE)}var n9d=new WeakMap,fNs=class Kco{static EMPTY=new Kco(void 0);nodesInOrder=[];idToNode=new Map;idToNodeParents=new Map;slugToNode=new Map;orphanedNodes=[];static collect(t){if(t==null)return Kco.EMPTY;let r=n9d.get(t);if(r!=null)return r;let i=new Kco(t);return n9d.set(t,i),i}#e;#t;#r(t,r,i){let n={node:r,parents:i,prev:this.#t,next:void 0};this.slugToNode.set(t,n),Ct.isNeighbor(r)&&(this.#t=r,this.#e!=null&&(this.#e.next=r),this.#e=n)}versionNodes=[];defaultVersion;productNodes=[];defaultProduct;variantNodes=[];defaultVariant;constructor(t){t!=null&&Ct.traverseDF(t,(r,i)=>{if(r.type==="product"&&this.productNodes.push(r),r.type==="version"&&this.versionNodes.push(r),r.type==="variant"&&this.variantNodes.push(r),r.type==="version"&&r.default&&t.type==="root"){let n=i.find(oNs),a=JSON.parse(JSON.stringify(r)),o=n?.type==="product"?n.slug:t.slug;this.defaultVersion=edE(a,o,r.slug),Ct.traverseDF(this.defaultVersion,(c,f)=>{this.visitNode(c,[...i,...f],!0)})}this.visitNode(r,i)})}visitNode(t,r,i=!1){if((!this.idToNode.has(t.id)||i)&&(this.idToNode.set(t.id,t),this.idToNodeParents.set(t.id,r),this.nodesInOrder.push(t)),t.type==="sidebarRoot"&&(this.#e=void 0,this.#t=void 0),!Ct.hasMetadata(t)||t.type==="changelogMonth"||t.type==="changelogYear")return;let n=this.slugToNode.get(t.slug);n==null?this.#r(t.slug,t,r):!t.hidden&&Ct.isPage(t)&&(n.node.hidden||!Ct.isPage(n.node))?(this.orphanedNodes.push(n.node),this.#r(t.slug,t,r)):this.orphanedNodes.push(t)}getOrphanedNodes(){return this.orphanedNodes}getOrphanedPages=_Mi(()=>this.orphanedNodes.filter(Ct.isPage));getSlugMap=_Mi(()=>new Map([...this.slugToNode.entries()].map(([t,{node:r}])=>[t,r])));get slugMap(){return this.getSlugMap()}get defaultVersionNode(){return this.defaultVersion}get defaultProductNode(){return this.defaultProduct}get defaultVariantNode(){return this.defaultVariant}get(t){return this.idToNode.get(t)}getParents(t){return this.idToNodeParents.get(t)??UPw}getSlugMapWithParents=()=>this.slugToNode;#i=_Mi(()=>[...this.slugToNode.keys()]);get slugs(){return this.#i()}#n=_Mi(()=>Array.from(new Set([...this.slugToNode.values()].filter(({node:t})=>Ct.isPage(t)).filter(({node:t})=>!t.authed).map(({node:t})=>t.slug))));get staticPageSlugs(){return this.#n()}#a=_Mi(()=>Array.from(new Set([...this.slugToNode.values()].filter(({node:t})=>Ct.isPage(t)).filter(({node:t})=>!t.hidden&&!t.authed).filter(({node:t})=>Ct.hasMarkdown(t)?!t.noindex:!0).map(({node:t})=>t.canonicalSlug??t.slug))));get indexablePageSlugs(){return this.#a()}#o=_Mi(()=>{let t={};return[...this.slugToNode.values()].filter(({node:r})=>Ct.isPage(r)).filter(({node:r})=>!r.hidden).filter(({node:r})=>Ct.hasMarkdown(r)?!r.noindex:!0).forEach(r=>{let i=r.node.canonicalSlug??r.node.slug;i in t||(t[i]=r.node)}),Object.values(t)});get indexablePageNodesWithAuth(){return this.#o()}getProductNodes=()=>this.productNodes;getVersionNodes=()=>this.versionNodes;getVariantNodes=()=>this.variantNodes;getNodesInOrder=()=>this.nodesInOrder},qnp={};Di(qnp,{FernNavigationV1ToLatest:()=>Rnp});var Rnp=class znp{static create(){return new znp}constructor(){}#e;#t;#r;root=t=>(this.#e=Ct.Slug(t.slug),{type:"root",child:jf(t.child)._visit({versioned:i=>this.versioned(i,[t]),unversioned:i=>this.unversioned(i,[t]),productgroup:i=>this.productGroup(i,[t])}),version:"v2",title:t.title,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,viewers:t.viewers,orphaned:t.orphaned,roles:t.roles,featureFlags:t.featureFlags});versioned=(t,r)=>{if(t.children.length===0)return{type:"versioned",id:Ct.NodeId(t.id),children:[]};let i=t.children.findIndex(f=>f.default);i===-1&&(i=0);let n=t.children[i];if(!n)throw new Error("default version is undefined");this.#r=Ct.Slug(n.slug);let a=this.version(n,[...r,t]),o=[...t.children.slice(0,i).map(f=>this.version(f,[...r,t])),a,...t.children.slice(i+1).map(f=>this.version(f,[...r,t]))];return{type:"versioned",id:Ct.NodeId(t.id),children:o}};version=(t,r)=>{let i=t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0;return{type:"version",default:t.default,versionId:t.versionId,landingPage:i,child:jf(t.child)._visit({tabbed:a=>this.tabbed(a,[...r,t]),sidebarRoot:a=>this.sidebarRoot(a,[...r,t]),varianted:a=>this.varianted(a,[...r,t])}),availability:this.#s(t.availability),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement}};landingPage=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p([t.pageId,this.#d(t,r)],i);return{type:"landingPage",title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};tabbed=(t,r)=>({type:"tabbed",id:Ct.NodeId(t.id),children:t.children.map(n=>jf(n)._visit({tab:a=>this.tab(a,[...r,t]),link:a=>this.link(a,[...r,t]),changelog:a=>this.changelog(a,[...r,t])}))});varianted=(t,r)=>({type:"varianted",id:Ct.NodeId(t.id),children:t.children.map(n=>this.variant(n,[...r,t]))});variant=(t,r)=>{let i=t.children.map(o=>this.#i(o,[...r,t])),n=t.pointsTo?Ct.Slug(t.pointsTo):void 0;return n==null&&(n=this.#o(i)),{type:"variant",default:t.default,variantId:Ct.VariantId(t.variantId),subtitle:t.subtitle,image:t.image,children:i,title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:n,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};tab=(t,r)=>({type:"tab",child:this.sidebarRoot(t.child,[...r,t]),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});link=(t,r)=>({type:"link",id:Ct.NodeId(t.id),title:t.title,url:t.url,icon:t.icon,target:t.target});unversioned=(t,r)=>({type:"unversioned",child:jf(t.child)._visit({tabbed:n=>this.tabbed(n,[...r,t]),sidebarRoot:n=>this.sidebarRoot(n,[...r,t]),varianted:n=>this.varianted(n,[...r,t])}),landingPage:t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0,id:Ct.NodeId(t.id)});productGroup=(t,r)=>{let i=t.landingPage?this.landingPage(t.landingPage,[...r,t]):void 0;if(t.children.length===0)return{type:"productgroup",landingPage:i,id:Ct.NodeId(t.id),children:[]};let n=t.children.findIndex(s=>s.default);n===-1&&(n=0);let a=t.children[n];if(!a)throw new Error("default product is undefined");let o=this.product(a,[...r,t]),c=[...t.children.slice(0,n).map(s=>this.product(s,[...r,t])),o,...t.children.slice(n+1).map(s=>this.product(s,[...r,t]))];return{type:"productgroup",landingPage:i,children:c,id:Ct.NodeId(t.id)}};product=(t,r)=>jf(t)._visit({product:i=>this.internalProduct(i,r),productLink:i=>this.externalProduct(i)});internalProduct=(t,r)=>(this.#t=t.slug,{type:"product",id:Ct.NodeId(t.id),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,image:t.image,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,default:t.default,productId:Ct.ProductId(t.productId),child:jf(t.child)._visit({unversioned:n=>this.unversioned(n,[...r,t]),versioned:n=>this.versioned(n,[...r,t])}),subtitle:t.subtitle,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,announcement:t.announcement});externalProduct=t=>({type:"productLink",id:Ct.NodeId(t.id),title:t.title,href:t.href,target:t.target,default:t.default,productId:Ct.ProductId(t.productId),subtitle:t.subtitle,icon:t.icon,image:t.image,hidden:t.hidden,authed:t.authed,viewers:t.viewers,orphaned:t.orphaned,featureFlags:void 0});sidebarRoot=(t,r)=>({type:"sidebarRoot",id:Ct.NodeId(t.id),children:t.children.map(n=>jf(n)._visit({sidebarGroup:a=>this.sidebarGroup(a,[...r,t]),apiReference:a=>this.apiReference(a,[...r,t]),section:a=>this.section(a,[...r,t]),varianted:a=>this.varianted(a,[...r,t])}))});sidebarGroup=(t,r)=>({type:"sidebarGroup",id:Ct.NodeId(t.id),children:t.children.map(n=>this.#n(n,[...r,t]))});page=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p([t.pageId,this.#d(t,r)],i);return{type:"page",id:Ct.NodeId(t.id),title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,availability:this.#s(t.availability)}};section=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"section",id:Ct.NodeId(t.id),children:t.children.map(c=>this.#n(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,collapsed:t.collapsed,overviewPageId:n,noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,availability:this.#s(t.availability)}};apiReference=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"apiReference",paginated:t.paginated,showErrors:t.showErrors,hideTitle:t.hideTitle,children:t.children.map(c=>this.#a(c,[...r,t])),changelog:t.changelog?this.changelog(t.changelog,[...r,t]):void 0,playground:t.playground,postmanCollectionUrl:t.postmanCollectionUrl,title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,id:Ct.NodeId(t.id),overviewPageId:n,noindex:t.noindex,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};changelog=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p(n,i):void 0;return{type:"changelog",id:Ct.NodeId(t.id),children:t.children.map(c=>this.changelogYear(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,overviewPageId:n,noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};changelogYear=(t,r)=>({type:"changelogYear",id:Ct.NodeId(t.id),children:t.children.map(n=>this.changelogMonth(n,[...r,t])),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,year:t.year,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});changelogMonth=(t,r)=>({type:"changelogMonth",id:Ct.NodeId(t.id),children:t.children.map(n=>this.changelogEntry(n,[...r,t])),title:t.title,slug:Ct.Slug(t.slug),canonicalSlug:void 0,icon:t.icon,hidden:t.hidden,authed:t.authed,month:t.month,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags});changelogEntry=(t,r)=>{let i=Ct.Slug(t.slug),n=this.#p(t.pageId,i);return{type:"changelogEntry",id:Ct.NodeId(t.id),title:t.title,slug:i,canonicalSlug:n,icon:t.icon,hidden:t.hidden,authed:t.authed,date:t.date,pageId:Ct.PageId(t.pageId),noindex:t.noindex,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,tags:t.tags}};apiPackage=(t,r)=>{let i=Ct.Slug(t.slug),n=t.overviewPageId?Ct.PageId(t.overviewPageId):void 0,a=n!=null?this.#p([n,this.#d(t,r)],i):void 0;return{type:"apiPackage",id:Ct.NodeId(t.id),children:t.children.map(c=>this.#a(c,[...r,t])),title:t.title,slug:i,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,pointsTo:t.pointsTo?Ct.Slug(t.pointsTo):void 0,playground:t.playground,overviewPageId:n,noindex:t.noindex,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};endpoint=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:endpoint:${t.method}:${t.endpointId}`,this.#d(t,r)],n);return{type:"endpoint",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,playground:t.playground,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,endpointId:t.endpointId,isResponseStream:t.isResponseStream,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};endpointPair=(t,r)=>({type:"endpointPair",id:Ct.NodeId(t.id),nonStream:this.endpoint(t.nonStream,[...r,t]),stream:this.endpoint(t.stream,[...r,t])});webSocket=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:websocket:${t.webSocketId}`,this.#d(t,r)],n);return{type:"webSocket",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,playground:t.playground,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),webSocketId:t.webSocketId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};webhook=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:webhook:${t.method}:${t.webhookId}`,this.#d(t,r)],n);return{type:"webhook",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,webhookId:t.webhookId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};grpc=(t,r)=>{let i=this.#l(r),n=Ct.Slug(t.slug),a=this.#p([`${i}:api:grpc:${t.method}:${t.grpcId}`,this.#d(t,r)],n);return{type:"grpc",id:Ct.NodeId(t.id),title:t.title,slug:n,canonicalSlug:a,icon:t.icon,hidden:t.hidden,authed:t.authed,apiDefinitionId:t.apiDefinitionId,availability:this.#s(t.availability),method:t.method,grpcId:t.grpcId,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}};#i=(t,r)=>jf(t)._visit({apiReference:i=>this.apiReference(i,r),section:i=>this.section(i,r),sidebarGroup:i=>this.sidebarGroup(i,r),link:i=>this.link(i,r),page:i=>this.page(i,r),changelog:i=>this.changelog(i,r)});#n=(t,r)=>jf(t)._visit({apiReference:i=>this.apiReference(i,r),section:i=>this.section(i,r),link:i=>this.link(i,r),page:i=>this.page(i,r),changelog:i=>this.changelog(i,r),varianted:i=>this.varianted(i,r)});#a=(t,r)=>jf(t)._visit({page:i=>this.page(i,r),link:i=>this.link(i,r),apiPackage:i=>this.apiPackage(i,r),endpoint:i=>this.endpoint(i,r),endpointPair:i=>this.endpointPair(i,r),webSocket:i=>this.webSocket(i,r),webhook:i=>this.webhook(i,r),grpc:i=>this.grpc(i,r)});#o=t=>{for(let r of t){if(Ct.isPage(r))return r.slug;let i=Ct.getChildren(r);if(i!=null&&i.length>0){let n=this.#o(i);if(n!=null)return n}}};#s(t){if(t!=null)switch(t){case"beta":return Ct.Availability.Beta;case"deprecated":return Ct.Availability.Deprecated;case"generally-available":return Ct.Availability.GenerallyAvailable;case"in-development":return Ct.Availability.InDevelopment;case"pre-release":return Ct.Availability.PreRelease;case"stable":return Ct.Availability.Stable;default:throw new Tnp.UnreachableCaseError(t)}}#u=new Map;#c=t=>{if(typeof t=="string")return this.#u.get(t);for(let r of t){let i=this.#u.get(r);if(i!==void 0)return i}};#f=(t,r)=>{let i=this.#t??""+this.#e,n=this.#r?r.replace(new RegExp(`(^|/)${this.#r}(/|$)`,"g"),`$1${i}$2`):r,a=Ct.Slug(n.replace(/^\//,""));if(typeof t=="string")return this.#u.set(t,a),a;for(let o of t)this.#u.set(o,a);return a};#p=(t,r)=>{if(t==null)return;let i=this.#c(t);return i??this.#f(t,r)};#d=(t,r)=>[...this.#_(r).filter(Ct.V1.hasMetadata).map(a=>a.title),t.title].join("###");#l=t=>[...this.#_(t).filter(n=>n.type==="apiReference").map(n=>n.title.replaceAll(" ",""))].join(":");#_=t=>{let r=t.findIndex(n=>n.type==="version");return r>=0?t.slice(r+1):t}},Nnp={};Di(Nnp,{collectApiReferences:()=>gdE,collectPageIds:()=>OdE,createBreadcrumb:()=>Fnp,findNode:()=>AdE,getApiReferenceId:()=>mdE,getNoIndexFromFrontmatter:()=>wnp,mutableUpdatePointsTo:()=>dNs,toApis:()=>PdE,toPages:()=>jdE,toRootNode:()=>EdE,toUnversionedSlug:()=>SdE});function gdE(e){let t=[];return Ct.traverseDF(e,r=>r.type==="apiReference"?(t.push(r),"skip"):!0),t}function OdE(e){let t=new Set;return Ct.traverseDF(e,r=>{if(Ct.isPage(r)){let i=rnp(r);i!=null&&t.add(i)}}),t}function Fnp(e){let t=[];return e.forEach(r=>{!Ct.hasMetadata(r)||Ct.isLeaf(r)||jf(r)._visit({root:KBn.noop,version:KBn.noop,variant:KBn.noop,tab:KBn.noop,product:KBn.noop,section:i=>{t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})},apiReference:i=>{i.hideTitle||t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})},changelog:i=>{t.push({title:i.title,pointsTo:i.slug})},changelogYear:i=>{t.push({title:i.title,pointsTo:i.slug})},changelogMonth:i=>{t.push({title:i.title,pointsTo:i.slug})},apiPackage:i=>{t.push({title:i.title,pointsTo:i.overviewPageId!=null?i.slug:i.pointsTo})}})}),t.filter(r=>r.title.trim().length>0)}function AdE(e,t){let r=fNs.collect(e),i=r.getSlugMapWithParents().get(t);if(i==null){let h=e,y=!1;for(let b of r.getProductNodes())if(b.type==="product"&&t.startsWith(b.slug)){h=b,y=!0;break}if(!y){for(let b of r.getVersionNodes())if(t.startsWith(b.slug)){h=b;break}}return{type:"notFound",redirect:h.type==="root"||h.type==="product"||h.type==="version"?h.pointsTo:void 0,authed:h.authed}}let n=i.parents.find(x1s),a=i.parents.find(nnp),o=i.parents.find(oNs),c=i.parents.find(unp),f=i.parents.find(anp),s=(c??f)?.child,u=i.parents.find(onp);!n&&c!=null&&x1s(c.child)&&(n=c.child);let l=(a??c??f)?.landingPage,p=i.parents.find(G1s)??(s!=null&&G1s(s)?s:void 0),_=i.parents.find(inp)??(i.node.type==="apiReference"?i.node:void 0);if(Ct.isPage(i.node)){let h=[...i.parents,i.node],y=h.findIndex(M=>M===p),b=y!==-1?h[y+1]:void 0,v=r.getProductNodes().map(M=>M.default?M.id===o?.id?o:r.defaultProductNode??M:M),O=r.getVersionNodes().map(M=>M.default?M.id===c?.id?c:r.defaultVersionNode??M:M),A=r.getVariantNodes().map(M=>M.default?M.id===u?.id?u:r.defaultVariantNode??M:M),g=b?.type==="tab"||b?.type==="changelog"?b:void 0,m=u?.slug??(o?.type==="product"?o.slug:void 0)??c?.slug??e.slug,j=Ct.Slug(i.node.slug.replace(new RegExp(`^${Ghi(m)}/`),""));return{type:"found",node:i.node,breadcrumb:Fnp(i.parents),parents:i.parents,root:e,versions:O,tabs:p?.children??[],products:v,currentProduct:o,currentVersion:c,isCurrentProductDefault:o?.default?o===r.defaultProductNode:!1,isCurrentVersionDefault:c?.default?c===r.defaultVersionNode:!1,variants:A,currentVariant:u,isCurrentVariantDefault:u?.default?u===r.defaultVariantNode:!1,currentTab:g,sidebar:n,apiReference:_,landingPage:l,next:i.next,prev:i.prev,collector:r,unversionedSlug:j}}if(e.type==="root"&&e.slug===t&&e.pointsTo!=null)return{type:"redirect",redirect:e.pointsTo};if(Ct.hasRedirect(i.node)&&i.node.pointsTo!=null)return{type:"redirect",redirect:i.node.pointsTo};if(i.node.type==="variant"&&(i.node.pointsTo==null||i.node.pointsTo===void 0)){let h=Qnp(i.node);if(h!=null)return{type:"redirect",redirect:h}}return{type:"notFound",redirect:c?.pointsTo??e.pointsTo,authed:i.node.authed}}function Qnp(e){if(Ct.isPage(e))return e.slug;let t=Ct.getChildren(e);if(t!=null)for(let r of t){let i=Qnp(r);if(i!=null)return i}}var tB=()=>{},mBn=e=>e.apiDefinitionId;function mdE(e){if(e!=null)return jf(e)._visit({root:tB,versioned:tB,varianted:tB,tabbed:tB,sidebarRoot:tB,sidebarGroup:tB,version:tB,variant:tB,tab:tB,link:tB,page:tB,section:tB,changelog:tB,changelogYear:tB,changelogMonth:tB,changelogEntry:tB,product:tB,productLink:tB,productgroup:tB,apiReference:mBn,endpoint:mBn,endpointPair:t=>t.nonStream.apiDefinitionId,webSocket:mBn,webhook:mBn,grpc:mBn,apiPackage:mBn,unversioned:tB,landingPage:tB})}function PdE(e){return{...rQ(e.definition.apis,t=>gIn.ApiDefinitionV1ToLatest.from(t).migrate()),...e.definition.apisV2}}function jdE(e){return rQ(e.definition.pages,t=>t.markdown)}function Lnp(e){if(e!=null){if(Ct.isPage(e)&&!e.authed)return e.slug;if(!Ct.isLeaf(e))switch(e.type){case"productgroup":case"versioned":return a9d([...e.children].sort(wdE));case"apiReference":case"apiPackage":case"changelogMonth":case"changelogYear":case"endpointPair":case"product":case"productLink":case"root":case"section":case"sidebarRoot":case"sidebarGroup":case"tab":case"tabbed":case"unversioned":case"version":case"changelog":case"varianted":case"variant":return a9d(Ct.getChildren(e));default:throw new Unp.UnreachableCaseError(e)}}}function a9d(e){for(let t of e){if(Ct.hasMetadata(t)&&t.hidden)continue;let r=Lnp(t);if(r!=null)return r}}function o9d(e){return e.default&&!e.hidden?1:e.hidden?-1:0}function wdE(e,t){return o9d(t)-o9d(e)}function dNs(e){let r=fNs.collect(e).getSlugMapWithParents();Ct.traverseDF(e,i=>{if(Ct.hasPointsTo(i)){let n=Lnp(i);if(n!=null)if(i.type==="root"){let a=r.get(n)?.node;a!=null&&(i.pointsTo=a.canonicalSlug??(i.slug===a.slug?void 0:a.slug))}else i.pointsTo=i.slug===n?void 0:n;else i.pointsTo=void 0}})}function EdE(e,t=!1){let r=Ct.V1.toRootNode(e,t),i=Rnp.create().root(r);return dNs(i),i}function SdE(e,t){return e.replace(new RegExp(`^${Ghi(t)}(/|$)`),"")}function MdE(e,t){let{predicate:r,getChildren:i,deleter:n,getPointer:a=f=>f}=t,o=new Set,c=[];return _np(e,(f,s)=>{c.unshift([f,s])},i),c.forEach(([f,s])=>{let u=[...s,f],l=u.findIndex(b=>o.has(a(b)));if(l!==-1){u.slice(l).forEach(b=>o.add(a(b)));return}if(r(f,s))return;let p=[...s],_=p.pop(),h=n(_,f),y=f;for(;h==="should-delete-parent"&&_!=null;)o.add(a(y)),y=_,h=n(p.pop(),_);h==="deleted"&&o.add(a(y))}),o.has(a(e))?[void 0,o]:[e,o]}function DdE(e,t){if(!Ct.isLeaf(t)&&Ct.isPage(t)&&Ct.getChildren(t).length>0&&t.type!=="changelog"){if(Ct.isSectionOverview(t))return t.overviewPageId=void 0,t.children.length===0?"deleted":"noop";throw new J1s.UnreachableCaseError(t)}if(!Ct.isLeaf(t)&&Ct.getChildren(t).length>0)return"noop";if(e==null)return"deleted";switch(e.type){case"apiPackage":e.children=e.children.filter(r=>r.id!==t.id);break;case"apiReference":e.children=e.children.filter(r=>r.id!==t.id),e.changelog=e.changelog?.id===t.id?void 0:e.changelog;break;case"changelog":e.children=e.children.filter(r=>r.id!==t.id);break;case"changelogYear":e.children=e.children.filter(r=>r.id!==t.id);break;case"changelogMonth":e.children=e.children.filter(r=>r.id!==t.id);break;case"endpointPair":return"should-delete-parent";case"productgroup":e.children=e.children.filter(r=>r.id!==t.id),e.landingPage=e.landingPage?.id===t.id?void 0:e.landingPage;break;case"product":case"productLink":case"root":return"should-delete-parent";case"unversioned":t.id===e.landingPage?.id&&(e.landingPage=void 0);break;case"section":e.children=e.children.filter(r=>r.id!==t.id);break;case"sidebarGroup":e.children=e.children.filter(r=>r.id!==t.id);break;case"tab":return"should-delete-parent";case"sidebarRoot":e.children=e.children.filter(r=>r.id!==t.id);break;case"tabbed":e.children=e.children.filter(r=>r.id!==t.id);break;case"version":t.id===e.landingPage?.id&&(e.landingPage=void 0);break;case"versioned":e.children=e.children.filter(r=>r.id!==t.id);break;case"varianted":e.children=e.children.filter(r=>r.id!==t.id);break;case"variant":e.children=e.children.filter(r=>r.id!==t.id);break;default:throw new J1s.UnreachableCaseError(e)}return Ct.isPage(e)?"noop":Ct.getChildren(e).length>0?"deleted":"should-delete-parent"}var BdE=class Vnp{static from(t){return new Vnp(t)}tree;constructor(t){this.tree=gAe(t)}keep(t){if(this.tree==null)return this;let[r]=MdE(this.tree,{predicate:t,getChildren:Ct.getChildren,getPointer:i=>i.id,deleter:DdE});return this.tree=r,this}remove(t){return this.keep((r,i)=>!t(r,i))}hide(t){return this.tree==null?this:(Ct.traverseBF(this.tree,(r,i)=>{Ct.hasMetadata(r)&&(r.hidden=t(r,i))}),this)}authed(t){if(this.tree==null)return this;let r=new Set;Ct.traverseBF(this.tree,(i,n)=>{if(Ct.hasMetadata(i)&&(i.authed=t(i,n)?!0:void 0,!i.authed))for(let a of n)r.add(a)});for(let i of r)Ct.hasMetadata(i)&&!Ct.isPage(i)&&(i.authed=void 0);return this}get(){if(this.tree!=null)return dNs(this.tree),this.tree}};var vdo=require("fs/promises");var _up=ue(require("path"),1);var xnp=require("fs/promises");var Wnp=100;async function IdE({files:e,absolutePathToFernFolder:t}){let r=await Promise.all(e.map(async i=>{let n=await(0,xnp.readFile)(i,"utf-8");return[j7(t,i),n]}));return Object.fromEntries(r)}async function Gnp({files:e,absolutePathToFernFolder:t}){let r={};for(let i=0;i<e.length;i+=Wnp){let n=e.slice(i,i+Wnp),a=await IdE({files:n,absolutePathToFernFolder:t});Object.assign(r,a)}return r}function tdo({landingPage:e,navigation:t}){return XOe([e?.absolutePath,...CdE(t)])}function CdE(e){switch(e.type){case"tabbed":return e.items.flatMap(t=>t.child.type==="layout"?t.child.layout.flatMap(r=>edo({item:r})):t.child.type==="variants"?t.child.variants.flatMap(r=>r.layout.flatMap(i=>edo({item:i}))):t.child.type==="changelog"?t.child.changelog:[]);case"untabbed":return e.items.flatMap(t=>edo({item:t}));case"versioned":return e.versions.flatMap(t=>tdo({landingPage:t.landingPage,navigation:t.navigation}));case"productgroup":return e.products.flatMap(t=>t.type==="external"?[]:tdo({landingPage:t.landingPage,navigation:t.navigation}));default:Ot(e)}}function edo({item:e}){switch(e.type){case"apiSection":return XOe([e.overviewAbsolutePath,...e.navigation.flatMap(t=>Hnp({item:t}))]);case"link":return[];case"page":return[e.absolutePath];case"section":return XOe([e.overviewAbsolutePath,...e.contents.flatMap(t=>edo({item:t}))]);case"changelog":return e.changelog;default:Ot(e)}}function Hnp({item:e}){return e.type==="page"?[e.absolutePath]:e.type==="package"||e.type==="section"?XOe([e.overviewAbsolutePath,...e.contents.flatMap(t=>Hnp({item:t}))]):[]}var DNs=require("fs/promises"),dup=ue(Q_e(),1);function pdo({name:e}){return e.replace(/\.(md|mdx)$/i,"").toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}function _do({name:e}){return e.replace(/\.(md|mdx)$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}async function xhE({absolutePath:e,readFileFn:t=(r,i)=>(0,DNs.readFile)(r,i)}){try{let r=await t(e,"utf-8"),{data:i}=(0,dup.default)(r);if(i.position==null)return;let n=typeof i.position=="string"?parseFloat(i.position):i.position;return typeof n=="number"&&Number.isFinite(n)?n:void 0}catch{return}}async function BNs({directoryPath:e,getDir:t=rD,readFileFn:r=(i,n)=>(0,DNs.readFile)(i,n)}){let i=await t(e),n=i.filter(u=>u.type==="file"&&(u.name.endsWith(".md")||u.name.endsWith(".mdx"))),a=i.filter(u=>u.type==="directory"),o=await Promise.all(n.map(u=>xhE({absolutePath:u.absolutePath,readFileFn:r}))),c=n.map(u=>({type:"page",title:_do({name:u.name}),absolutePath:u.absolutePath,slug:pdo({name:u.name}),icon:void 0,hidden:void 0,noindex:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0})),f=await Promise.all(a.map(async u=>{let l=await BNs({directoryPath:u.absolutePath,getDir:t,readFileFn:r});return{type:"section",title:_do({name:u.name}),slug:pdo({name:u.name}),icon:void 0,contents:l,collapsed:void 0,hidden:void 0,skipUrlSlug:!1,overviewAbsolutePath:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0,availability:void 0}})),s=[...c.map((u,l)=>({item:u,title:u.type==="page"?u.title:"",position:o[l]})),...f.map(u=>({item:u,title:u.type==="section"?u.title:"",position:void 0}))];return s.sort((u,l)=>{let p=typeof u.position=="number",_=typeof l.position=="number";if(p&&!_)return-1;if(!p&&_)return 1;if(typeof u.position=="number"&&typeof l.position=="number"){let h=u.position-l.position;return h!==0?h:u.title.localeCompare(l.title,void 0,{sensitivity:"base"})}return u.title.localeCompare(l.title,void 0,{sensitivity:"base"})}),s.map(u=>u.item)}function GhE(e){return!e||e.startsWith("<")?!1:e.startsWith(".")||e.includes("/")||e.includes("\\")||e.includes(":")}function NE(e,t){if(e)return GhE(e)?nB(e,t):e}async function RNs({rawDocsConfiguration:e,absolutePathToFernFolder:t,absoluteFilepathToDocsConfig:r,context:i}){let{instances:n,title:a,tabs:o,products:c,versions:f,navigation:s,navbarLinks:u,footerLinks:l,defaultLanguage:p,metadata:_,redirects:h,logo:y,favicon:b,backgroundImage:v,colors:O,typography:A,layout:g,integrations:m,css:j,js:M,aiChat:E,aiSearch:D,pageActions:B,experimental:F}=e,N=xya(e.landingPage,r),R=nyE({tabs:o,products:c,versions:f,navigation:s,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}),z=R.then(Je=>Gnp({files:tdo({navigation:Je,landingPage:N}),absolutePathToFernFolder:t})),U=HhE(y,r),W=nB(b,r),K=KhE(v,r),fe=A!=null?ayE({rawTypography:A,absoluteFilepathToDocsConfig:r}):void 0,pe=JhE(j,r),L=XhE(M,r),G=jyE(_,r),[Re,le,De,Ke,se,ne]=await Promise.all([R,z,fe,pe,L,G]);return{title:a,instances:n,roles:e.roles,pages:le,landingPage:N,navigation:Re,navbarLinks:myE(u,r),footerLinks:PyE(l),defaultLanguage:p,languages:e.languages,announcement:e.announcement,metadata:ne,redirects:h?.map(Je=>({...Je,permanent:Je?.permanent})),logo:U,favicon:W,backgroundImage:K,colors:ONd(O,i),typography:De,layout:iyE(g),settings:ryE(e.settings),theme:tyE(e.theme),analyticsConfig:{...e.analytics,intercom:e.analytics?.intercom?{...e.analytics.intercom,appId:e.analytics.intercom.appId,apiBase:e.analytics.intercom.apiBase}:void 0,fullstory:e.analytics?.fullstory,posthog:e.analytics?.posthog?{...e.analytics.posthog,apiKey:e.analytics.posthog.apiKey,endpoint:e.analytics.posthog.endpoint}:void 0,segment:e.analytics?.segment,gtm:e.analytics?.gtm,ga4:e.analytics?.ga4,amplitude:void 0,mixpanel:void 0,hotjar:void 0,koala:void 0,logrocket:void 0,pirsch:void 0,plausible:void 0,fathom:void 0,clearbit:void 0,heap:void 0},integrations:{...m,intercom:m?.intercom?m.intercom:void 0},css:Ke,js:se,aiChatConfig:D??E,pageActions:ZhE(B,r),experimental:F}}function HhE(e,t){return e!=null?{dark:nB(e.dark,t),light:nB(e.light,t),height:e.height,href:e.href!=null?_i.Url(e.href):void 0,rightText:e.rightText}:void 0}function KhE(e,t){if(e!=null)if(typeof e=="string"){let r=nB(e,t);return{dark:r,light:r}}else{let r=nB(e.dark,t),i=nB(e.light,t);return{dark:r,light:i}}}async function JhE(e,t){if(e==null)return;let r=typeof e=="string"?[e]:e;return{inline:await Promise.all(r.map(async i=>(await(0,vdo.readFile)(nB(i,t))).toString()))}}function $hE(e){return Object.hasOwn(e,"url")}function YhE(e){return Object.hasOwn(e,"path")}async function XhE(e,t){let r=[],i=[];if(e==null)return{files:[]};let n=Array.isArray(e)?e:[e];for(let a of n)typeof a=="string"?i.push({absolutePath:nB(a,t)}):$hE(a)?r.push({strategy:a.strategy,url:_i.Url(a.url)}):YhE(a)&&i.push({absolutePath:nB(a.path,t),strategy:a.strategy});return{remote:r,files:i}}function ZhE(e,t){return e==null?void 0:{default:e.default!=null?khE(e.default):void 0,options:{askAi:e.options?.askAi??!0,copyPage:e.options?.copyPage??!0,viewAsMarkdown:e.options?.viewAsMarkdown??!0,openAi:e.options?.chatgpt??!0,claude:e.options?.claude??!0,cursor:e.options?.cursor??!0,vscode:e.options?.vscode??!1,custom:(e.options?.custom??[]).map(i=>eyE(i,t))}}}function khE(e){switch(e){case"copy-page":return _i.docs.v1.commons.PageActionOption.CopyPage;case"view-as-markdown":return _i.docs.v1.commons.PageActionOption.ViewAsMarkdown;case"ask-ai":return _i.docs.v1.commons.PageActionOption.AskAi;case"chatgpt":return _i.docs.v1.commons.PageActionOption.OpenAi;case"claude":return _i.docs.v1.commons.PageActionOption.Claude;case"cursor":return _i.docs.v1.commons.PageActionOption.Cursor;case"vscode":return _i.docs.v1.commons.PageActionOption.Vscode;default:Ot(e)}}function eyE(e,t){return{title:e.title,subtitle:e.subtitle,url:e.url,icon:NE(e.icon,t),default:e.default}}function tyE(e){if(e!=null)return{sidebar:e.sidebar??"default",tabs:e.tabs??"default",body:e.body??"default",pageActions:e.pageActions??"default",footerNav:e.footerNav??"default"}}function ryE(e){if(e!=null)return{darkModeCode:e.darkModeCode??!1,defaultSearchFilters:e.defaultSearchFilters??!1,language:e.language??"en",disableSearch:e.disableSearch??!1,hide404Page:e.hide404Page??!1,httpSnippets:e.httpSnippets??!0,searchText:e.searchText??void 0,useJavascriptAsTypescript:e.useJavascriptAsTypescript??!1,disableExplorerProxy:e.disableExplorerProxy??!1,disableAnalytics:e.disableAnalytics??!1}}function iyE(e){if(e!=null)return{pageWidth:e.pageWidth?.trim().toLowerCase()==="full"?{type:"full"}:hdo(e.pageWidth),contentWidth:hdo(e.contentWidth),sidebarWidth:hdo(e.sidebarWidth),headerHeight:hdo(e.headerHeight),searchbarPlacement:e.searchbarPlacement==="header"?_i.docs.v1.commons.SearchbarPlacement.Header:e.searchbarPlacement==="header-tabs"?_i.docs.v1.commons.SearchbarPlacement.HeaderTabs:_i.docs.v1.commons.SearchbarPlacement.Sidebar,tabsPlacement:e.tabsPlacement==="header"?_i.docs.v1.commons.TabsPlacement.Header:_i.docs.v1.commons.TabsPlacement.Sidebar,contentAlignment:e.contentAlignment==="left"?_i.docs.v1.commons.ContentAlignment.Left:_i.docs.v1.commons.ContentAlignment.Center,headerPosition:e.headerPosition==="static"?_i.docs.v1.commons.HeaderPosition.Absolute:_i.docs.v1.commons.HeaderPosition.Fixed,disableHeader:e.disableHeader??!1,hideNavLinks:e.hideNavLinks??!1,hideFeedback:e.hideFeedback??!1}}function hdo(e){if(e==null)return;let t=e.trim().toLowerCase(),r=t.match(/^(\d+)px$/);if(r!=null&&r[1]!=null)return{type:"px",value:parseFloat(r[1])};let i=t.match(/^(\d+)rem$/);if(i!=null&&i[1]!=null)return{type:"rem",value:parseFloat(i[1])}}async function pup({versions:e,absolutePathToFernFolder:t,context:r}){let i=[];for(let n of e){let a=wu(t,n.path),o=wi.load((await(0,vdo.readFile)(a)).toString()),c=[],f=kOe(o,[],c);c.length>0&&r.logger.warn(`Version file ${n.path} contained null/undefined sections that were ignored: ${c.map(l=>l.join(".")).join(", ")}`);let s=P7.RawSchemas.Serializer.VersionFileConfig.parseOrThrow(f),u=await TNs({tabs:s.tabs,rawNavigationConfig:s.navigation,absolutePathToFernFolder:t,absolutePathToConfig:a,context:r});i.push({landingPage:xya(s.landingPage,a),version:n.displayName,navigation:u,availability:n.availability,slug:n.slug,hidden:n.hidden,viewers:t3(n.viewers),orphaned:n.orphaned,featureFlags:e3(n.featureFlag),announcement:n.announcement})}return{type:"versioned",versions:i}}async function nyE({tabs:e,products:t,versions:r,navigation:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:o}){if(i!=null)return await TNs({tabs:e,rawNavigationConfig:i,absolutePathToFernFolder:n,absolutePathToConfig:a,context:o});if(t!=null){let c=[];for(let f of t){let s=f.image!=null?wu(n,f.image):void 0;if("path"in f){let u,l=wu(n,f.path),p=wi.load((await(0,vdo.readFile)(l)).toString()),_=[],h=kOe(p,[],_);_.length>0&&o.logger.warn(`Product file ${f.path} contained null/undefined sections that were ignored: ${_.map(b=>b.join(".")).join(", ")}`);let y=P7.RawSchemas.Serializer.ProductFileConfig.parseOrThrow(h);f.versions!=null&&f.versions.length>0?u=await pup({versions:f.versions,absolutePathToFernFolder:n,context:o}):u=await TNs({tabs:y.tabs,rawNavigationConfig:y.navigation,absolutePathToFernFolder:n,absolutePathToConfig:l,context:o}),c.push({type:"internal",landingPage:xya(y.landingPage,l),product:f.displayName,navigation:u,slug:f.slug,subtitle:f.subtitle,icon:NE(f.icon,a)||"fa-solid fa-code",image:s,viewers:t3(f.viewers),orphaned:f.orphaned,featureFlags:e3(f.featureFlag),announcement:f.announcement})}else if("href"in f&&f.href!=null)c.push({type:"external",product:f.displayName,href:f.href,target:f.target,subtitle:f.subtitle,icon:NE(f.icon,a)||"fa-solid fa-code",image:s,viewers:t3(f.viewers),orphaned:f.orphaned,featureFlags:e3(f.featureFlag)});else throw new Error("Invalid product configuration: product must have either 'path' or valid 'href' property")}return{type:"productgroup",products:c}}else if(r!=null)return await pup({versions:r,absolutePathToFernFolder:n,context:o});throw new Error("Unexpected. Docs have neither navigation or versions defined.")}function e3(e){if(e!=null)return typeof e=="string"?[{flag:e,match:!0,fallbackValue:void 0}]:Array.isArray(e)?e.map(t=>({flag:t.flag,match:t.match,fallbackValue:t.fallbackValue})):[{flag:e.flag,match:e.match??!0,fallbackValue:e.fallbackValue}]}async function ayE({rawTypography:e,absoluteFilepathToDocsConfig:t}){return{headingsFont:e.headingsFont!=null?await INs({rawFontConfig:e.headingsFont,absoluteFilepathToDocsConfig:t}):void 0,bodyFont:e.bodyFont!=null?await INs({rawFontConfig:e.bodyFont,absoluteFilepathToDocsConfig:t}):void 0,codeFont:e.codeFont!=null?await INs({rawFontConfig:e.codeFont,absoluteFilepathToDocsConfig:t}):void 0}}async function INs({rawFontConfig:e,absoluteFilepathToDocsConfig:t}){return{name:e.name,variants:await oyE(e,t),display:e.display,fallback:e.fallback,fontVariationSettings:e.fontVariationSettings}}function oyE(e,t){let r=[];return e.path!=null&&r.push({path:e.path,weight:e.weight,style:e.style}),e.paths?.forEach(i=>{typeof i=="string"?r.push({path:i,weight:e.weight,style:e.style}):r.push({path:i.path,weight:i.weight??e.weight,style:i.style??e.style})}),Promise.all(r.map(async i=>({absolutePath:nB(i.path,t),weight:uyE(i.weight),style:i.style})))}function uyE(e){return e==null?void 0:typeof e=="number"?[e.toString()]:e.split(/\D+/).filter(r=>r!==""&&["100","200","300","400","500","600","700","800","900"].includes(r))}async function syE({tabs:e,item:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){let a=e[t.tab];if(a==null)throw new Error(`Tab ${t.tab} is not defined in the tabs config.`);if(AyE(t)){let o=await Promise.all(t.variants.map(async c=>{let f=await Promise.all(c.layout.map(s=>bdo({rawConfig:s,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})));return{title:c.title,subtitle:c.subtitle,icon:NE(c.icon,i),layout:f,slug:c.slug,skipUrlSlug:c.skipSlug,hidden:c.hidden,default:c.default,viewers:t3(c.viewers),orphaned:c.orphaned,featureFlags:e3(c.featureFlag)}}));return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"variants",variants:o},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)}}if(OyE(t)){let o=await Promise.all(t.layout.map(c=>bdo({rawConfig:c,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})));return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"layout",layout:o},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)}}if(a.href!=null)return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"link",href:a.href,target:a.target},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)};if(a.changelog!=null)return{title:a.displayName,icon:NE(a.icon,i),slug:a.slug,skipUrlSlug:a.skipSlug,hidden:a.hidden,child:{type:"changelog",changelog:await ZF(nB(a.changelog,i),"{md,mdx}")},viewers:t3(a.viewers),orphaned:a.orphaned,featureFlags:e3(a.featureFlag)};Ot(a)}async function TNs({tabs:e={},rawNavigationConfig:t,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n}){return gyE(t)?{type:"tabbed",items:await Promise.all(t.map(o=>syE({tabs:e,item:o,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}:{type:"untabbed",items:await Promise.all(t.map(a=>bdo({rawConfig:a,absolutePathToFernFolder:r,absolutePathToConfig:i,context:n})))}}var cyE="Changelog";async function lyE({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}){let n=nB(e.folder,r);await qi(n)||i.failAndThrow(`Folder not found: ${e.folder}`);let a=await BNs({directoryPath:n}),o=_up.default.basename(n),c=e.title??_do({name:o}),f=e.slug??pdo({name:o});return{type:"section",title:c,icon:NE(e.icon,r),contents:a,slug:f,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:void 0,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability}}async function bdo({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}){if(hup(e))return xya(e,r);if(dyE(e))return{type:"section",title:e.section,icon:NE(e.icon,r),contents:await Promise.all(e.contents.map(n=>bdo({rawConfig:n,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i}))),slug:e.slug??void 0,collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,skipUrlSlug:e.skipSlug??!1,overviewAbsolutePath:nB(e.path,r),viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability};if(pyE(e))return{type:"apiSection",openrpc:e.openrpc,title:e.api,icon:NE(e.icon,r),apiName:e.apiName??void 0,audiences:e.audiences!=null?{type:"select",audiences:Gya(e.audiences)??[]}:{type:"all"},availability:e.availability,showErrors:e.displayErrors??!0,tagDescriptionPages:e.tagDescriptionPages??!1,snippetsConfiguration:e.snippets!=null?fyE({rawConfig:e.snippets}):void 0,postman:e.postman,navigation:e.layout?.flatMap(n=>ydo(n,r))??[],overviewAbsolutePath:nB(e.summary,r),collapsed:e.collapsed??void 0,hidden:e.hidden??void 0,slug:e.slug,skipUrlSlug:e.skipSlug??!1,flattened:e.flattened??!1,alphabetized:e.alphabetized??!1,paginated:e.paginated??!1,playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)};if(yup(e))return{type:"link",text:e.link,url:e.href,icon:NE(e.icon,r),target:e.target};if(_yE(e))return{type:"changelog",changelog:await ZF(nB(e.changelog,r),"{md,mdx}"),hidden:e.hidden??!1,icon:NE(e.icon,r),title:e.title??cyE,slug:e.slug,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)};if(hyE(e))return await lyE({rawConfig:e,absolutePathToFernFolder:t,absolutePathToConfig:r,context:i});Ot(e)}function xya(e,t){if(e!=null)return{type:"page",title:e.page,absolutePath:nB(e.path,t),slug:e.slug,icon:NE(e.icon,t),hidden:e.hidden,noindex:e.noindex,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag),availability:e.availability}}function ydo(e,t){return typeof e=="string"?[{type:"item",value:e}]:hup(e)?[xya(e,t)]:yup(e)?[{type:"link",text:e.link,url:e.href,icon:NE(e.icon,t),target:e.target}]:yyE(e)?[{type:"section",title:e.section,referencedSubpackages:e.referencedPackages??[],overviewAbsolutePath:nB(e.summary,t),contents:e.contents?.flatMap(r=>ydo(r,t))??[],slug:e.slug,hidden:e.hidden,skipUrlSlug:e.skipSlug,availability:e.availability,icon:NE(e.icon,t),playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)}]:byE(e)?[{type:"endpoint",endpoint:e.endpoint,title:e.title,icon:NE(e.icon,t),slug:e.slug,hidden:e.hidden,availability:e.availability,playground:e.playground,viewers:t3(e.viewers),orphaned:e.orphaned,featureFlags:e3(e.featureFlag)}]:Object.entries(e).map(([r,i])=>vyE(i)?{type:"package",title:i.title,package:r,overviewAbsolutePath:nB(i.summary,t),contents:i.contents?.flatMap(n=>ydo(n,t))??[],slug:i.slug,hidden:i.hidden,skipUrlSlug:i.skipSlug,icon:NE(i.icon,t),playground:i.playground,availability:i.availability,viewers:t3(i.viewers),orphaned:i.orphaned,featureFlags:e3(i.featureFlag)}:{type:"package",title:void 0,package:r,overviewAbsolutePath:void 0,contents:i.flatMap(n=>ydo(n,t)),hidden:!1,slug:void 0,skipUrlSlug:!1,icon:void 0,playground:void 0,availability:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}function fyE({rawConfig:e}){return{python:e.python,typescript:e.typescript,go:e.go,java:e.java,ruby:e.ruby,csharp:e.csharp,php:e.php,swift:e.swift}}function hup(e){return $c(e)&&typeof e.page=="string"&&typeof e.path=="string"}function dyE(e){return e.section!=null}function pyE(e){return e.api!=null}function yup(e){return P7.RawSchemas,$c(e)&&typeof e.link=="string"&&typeof e.href=="string"}function _yE(e){return $c(e)&&typeof e.changelog=="string"}function hyE(e){return $c(e)&&typeof e.folder=="string"}function yyE(e){return $c(e)&&typeof e.section=="string"&&Array.isArray(e.contents)}function byE(e){return $c(e)&&typeof e.endpoint=="string"}function vyE(e){return!Array.isArray(e)}function nB(e,t){if(e!=null)return wu(Zi(t),e)}function gyE(e){return Array.isArray(e)&&e.length>0&&e[0].tab!=null}function OyE(e){return"layout"in e&&Array.isArray(e.layout)}function AyE(e){return"variants"in e&&Array.isArray(e.variants)}function myE(e,t){return e?.map(r=>{if(r.type==="github"){let n=r.value;return typeof n=="string"?{type:"github",url:_i.Url(n),viewers:void 0,target:void 0}:{type:"github",url:_i.Url(n.url),viewers:CNs(n.viewers),target:n.target}}let i=CNs(r.viewers);return r.type==="dropdown"?{type:"dropdown",text:r.text,icon:NE(r.icon,t),rightIcon:NE(r.rightIcon,t),rounded:r.rounded,viewers:i,links:r.links?.map(n=>({href:n.href,target:n.target,url:_i.Url(n.url??n.href??"/"),text:n.text,icon:NE(n.icon,t),rightIcon:NE(n.rightIcon,t),rounded:n.rounded,viewers:CNs(n.viewers)}))??[]}:{type:r.type,text:r.text,url:_i.Url(r.href??r.url??"/"),target:r.target,icon:NE(r.icon,t),rightIcon:NE(r.rightIcon,t),rounded:r.rounded,viewers:i}})}function CNs(e){if(e!=null)return Array.isArray(e)?e.map(t=>_i.RoleId(t)):[_i.RoleId(e)]}function PyE(e){if(e==null)return;let t=[];if(Object.keys(e).forEach(r=>{let i=e[r];i!=null&&t.push({type:r,value:_i.Url(i)})}),t.length!==0)return t}async function jyE(e,t){if(e!=null)return{"og:site_name":e.ogSiteName,"og:title":e.ogTitle,"og:description":e.ogDescription,"og:url":e.ogUrl,"og:image":await qNs(e.ogImage,t),"og:image:width":e.ogImageWidth,"og:image:height":e.ogImageHeight,"og:locale":e.ogLocale,"og:logo":await qNs(e.ogLogo,t),"twitter:title":e.twitterTitle,"twitter:description":e.twitterDescription,"twitter:image":await qNs(e.twitterImage,t),"twitter:handle":e.twitterHandle,"twitter:site":e.twitterSite,"twitter:url":e.twitterUrl,"twitter:card":e.twitterCard,nofollow:void 0,noindex:void 0,canonicalHost:e.canonicalHost}}async function qNs(e,t){if(e==null)return;if(e.startsWith("http"))return{type:"url",value:e};let r=nB(e,t);return await qi(r)?{type:"filepath",value:r}:{type:"url",value:e}}function t3(e){if(e!=null){if(typeof e=="string")return[_i.RoleId(e)];if(e.length!==0)return e.map(_i.RoleId)}}function Gya(e){if(e!=null){if(typeof e=="string")return[e];if(e.length!==0)return e}}var vup=require("fs/promises");var bup=qt.strictObject({organization:qt.string(),version:qt.string()});async function U_e({directory:e,context:t}){let r=It(e,Ze.of($F)),i=await(0,vup.readFile)(r),n=JSON.parse(i.toString()),a=await _uo({schema:bup,value:n,context:t,filepathBeingParsed:r});return{_absolutePath:r,rawConfig:a,organization:a.organization,version:a.version}}var P={TYPESCRIPT:"fernapi/fern-typescript",TYPESCRIPT_SDK:"fernapi/fern-typescript-sdk",TYPESCRIPT_NODE_SDK:"fernapi/fern-typescript-node-sdk",TYPESCRIPT_BROWSER_SDK:"fernapi/fern-typescript-browser-sdk",TYPESCRIPT_EXPRESS:"fernapi/fern-typescript-express",JAVA:"fernapi/fern-java",JAVA_MODEL:"fernapi/java-model",JAVA_SDK:"fernapi/fern-java-sdk",JAVA_SPRING:"fernapi/fern-java-spring",PYTHON_FASTAPI:"fernapi/fern-fastapi-server",PYTHON_PYDANTIC:"fernapi/fern-pydantic-model",PYTHON_SDK:"fernapi/fern-python-sdk",GO_MODEL:"fernapi/fern-go-model",GO_SDK:"fernapi/fern-go-sdk",GO_FIBER:"fernapi/fern-go-fiber",RUBY_MODEL:"fernapi/fern-ruby-model",RUBY_SDK:"fernapi/fern-ruby-sdk",CSHARP_MODEL:"fernapi/fern-csharp-model",CSHARP_SDK:"fernapi/fern-csharp-sdk",SWIFT_MODEL:"fernapi/fern-swift-model",SWIFT_SDK:"fernapi/fern-swift-sdk",PHP_MODEL:"fernapi/fern-php-model",PHP_SDK:"fernapi/fern-php-sdk",RUST_MODEL:"fernapi/fern-rust-model",RUST_SDK:"fernapi/fern-rust-sdk",OPENAPI:"fernapi/fern-openapi",STOPLIGHT:"fernapi/fern-stoplight",POSTMAN:"fernapi/fern-postman",OPENAPI_PYTHON_CLIENT:"fernapi/openapi-python-client"};var Hya={[P.JAVA]:{version:"2.38.1"},[P.TYPESCRIPT_EXPRESS]:{version:"0.18.4",output:{location:"local-file-system",path:"../src/fern"}},[P.JAVA_MODEL]:{version:"1.0.0"},[P.JAVA_SDK]:{version:"2.38.1",output:{location:"local-file-system",path:"../sdks/java/src/main/java/"}},[P.JAVA_SPRING]:{version:"0.9.2",output:{location:"local-file-system",path:"../src/main/java/com/fern"}},[P.TYPESCRIPT]:{version:"0.0.247"},[P.TYPESCRIPT_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.TYPESCRIPT_NODE_SDK]:{version:"2.3.2",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.TYPESCRIPT_BROWSER_SDK]:{version:"1.0.0",output:{location:"local-file-system",path:"../sdks/typescript"}},[P.PYTHON_PYDANTIC]:{version:"1.4.7"},[P.PYTHON_FASTAPI]:{version:"1.7.0",output:{location:"local-file-system",path:"../src/fern"}},[P.PYTHON_SDK]:{version:"4.23.2",output:{location:"local-file-system",path:"../sdks/python"}},[P.GO_FIBER]:{version:"0.23.5"},[P.GO_MODEL]:{version:"0.23.5"},[P.GO_SDK]:{version:"1.4.0",output:{location:"local-file-system",path:"../sdks/go"},config:{module:{path:"sdk"}}},[P.RUBY_MODEL]:{version:"0.0.8"},[P.RUBY_SDK]:{version:"0.8.2",output:{location:"local-file-system",path:"../sdks/ruby"}},[P.OPENAPI]:{version:"0.1.7",config:{format:"yaml"},output:{location:"local-file-system",path:"../openapi"}},[P.STOPLIGHT]:{version:"0.0.28",config:{format:"yaml"}},[P.POSTMAN]:{version:"0.4.0",output:{location:"local-file-system",path:"../postman"}},[P.OPENAPI_PYTHON_CLIENT]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/python"},config:{format:"yaml"}},[P.CSHARP_MODEL]:{version:"0.0.1"},[P.CSHARP_SDK]:{version:"2.0.2",output:{location:"local-file-system",path:"../sdks/csharp"}},[P.SWIFT_MODEL]:{version:"0.0.0"},[P.SWIFT_SDK]:{version:"0.0.0",output:{location:"local-file-system",path:"../sdks/swift/sdk"}},[P.PHP_MODEL]:{version:"0.0.0"},[P.PHP_SDK]:{version:"1.16.3",output:{location:"local-file-system",path:"../sdks/php/sdk"}},[P.RUST_MODEL]:{version:"0.0.1",output:{location:"local-file-system",path:"../models/rust"}},[P.RUST_SDK]:{version:"0.0.1",output:{location:"local-file-system",path:"../sdks/rust"}}};function NMi(e,t){let r=wyE(e);return r??t.failAndThrow("Unrecognized generator: "+e)}function wyE(e){if(e.startsWith("fernapi/")||(e=`fernapi/${e}`),EyE(e))return e}function EyE(e){return Object.values(P).includes(e)}var n_o=ue(Pba(),1),P_p=ue(m_e(),1);async function dNt({generatorName:e,cliVersion:t,channel:r,currentGeneratorVersion:i,includeMajor:n,context:a}){let o=P_p.default.parse(i),c=new n_o.FernRegistryClient({environment:"https://registry.buildwithfern.com"});a?.logger.debug(`Getting latest version for ${e} with CLI version ${t}, includeMajor: ${n}, prior version: ${o}`);let f={generator:tDE(e,a),releaseTypes:[r??n_o.FernRegistry.generators.ReleaseType.Ga],cliVersion:t==="0.0.0"?void 0:t};!n&&o!=null&&(f.generatorMajorVersion=o.major);let s=await c.generators.versions.getLatestGeneratorRelease(f);if(s.ok)return s.body.version}function tDE(e,t){switch(e.startsWith("fernapi/")&&(e=e.replace("fernapi/","")),e){case"fern-python-sdk":return"python-sdk";case"fern-pydantic-model":return"pydantic";case"fern-fastapi-server":return"fastapi";case"fern-typescript-browser-sdk":case"fern-typescript-node-sdk":case"fern-typescript-sdk":return"ts-sdk";case"fern-typescript-express":return"ts-express";case"fern-java-sdk":return"java-sdk";case"java-model":return"java-model";case"fern-java-spring":return"java-spring";case"fern-go-sdk":return"go-sdk";case"fern-go-model":return"go-model";case"fern-go-fiber":return"go-fiber";case"fern-csharp-sdk":return"csharp-sdk";case"fern-csharp-model":return"csharp-model";case"fern-ruby-sdk":return"ruby-sdk";case"fern-ruby-model":return"ruby-model";case"fern-postman":return"postman";case"fern-openapi":return"openapi";case"fern-php-sdk":return"php-sdk";case"fern-php-model":return"php-model";case"fern-rust-sdk":return"rust-sdk";case"fern-rust-model":return"rust-model";case"fern-swift-sdk":return"swift-sdk";case"fern-swift-model":return"swift-model";default:return t?.logger.warn(`Unrecognized generator name found, attempting to parse manually: ${e}`),e.startsWith("fern-")?e.replace("fern-",""):e}}async function j_p({generatorsConfiguration:e,groupName:t=e[hn.DEFAULT_GROUP_GENERATORS_CONFIG_KEY],context:r,update:i}){if(t==null)return r.failAndThrow("No group specified.");let n=e.groups??={},a=n[t];if(a==null){let o=n[t]??={generators:[]};await i(o,t)}else await i(a,t);return e}async function kQs({generatorName:e,generatorsConfiguration:t,groupName:r=t[HMn],context:i,cliVersion:n}){let a=NMi(e,i),o=Hya[a];return await j_p({generatorsConfiguration:t,groupName:r,context:i,update:async c=>{c.generators.some(f=>f.name===a)&&i.failAndThrow(`${e} is already installed in group ${r}.`),c.generators.push({name:a,...o,version:await dNt({cliVersion:n,generatorName:a,context:i,channel:void 0})??o.version})}})}var _Nt=require("fs/promises"),PGi=ue(require("path"),1);var hhp=require("buffer"),m_o=ue(R_p(),1),g_o=ue(zS(),1),ayp=require("child_process"),Vyp=ue(nUs(),1),kyp=require("path"),CCn=ue(nUs(),1),ybp=require("events"),wUs=Object.defineProperty,BDE=Object.getOwnPropertyDescriptor,EUs=Object.getOwnPropertyNames,IDE=Object.prototype.hasOwnProperty,Yn=(e,t)=>function(){return e&&(t=(0,e[EUs(e)[0]])(e=0)),t},CDE=(e,t)=>function(){return t||(0,e[EUs(e)[0]])((t={exports:{}}).exports,t),t.exports},dB=(e,t)=>{for(var r in t)wUs(e,r,{get:t[r],enumerable:!0})},qDE=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of EUs(t))!IDE.call(e,n)&&n!==r&&wUs(e,n,{get:()=>t[n],enumerable:!(i=BDE(t,n))||i.enumerable});return e},oD=e=>qDE(wUs({},"__esModule",{value:!0}),e);function TDE(...e){let t=new String(e);return A_o.set(t,e),t}function y_o(e){return e instanceof String&&A_o.has(e)}function z_p(e){return A_o.get(e)||[]}var A_o,Sba=Yn({"src/lib/args/pathspec.ts"(){"use strict";A_o=new WeakMap}}),tbi,fDi=Yn({"src/lib/errors/git-error.ts"(){"use strict";tbi=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Mba,TCn=Yn({"src/lib/errors/git-response-error.ts"(){"use strict";fDi(),Mba=class extends tbi{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),php,_hp=Yn({"src/lib/errors/task-configuration-error.ts"(){"use strict";fDi(),php=class extends tbi{constructor(e){super(void 0,e)}}}});function yhp(e){return typeof e!="function"?mGi:e}function bhp(e){return typeof e=="function"&&e!==mGi}function vhp(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function ghp(e,t=0){return Ohp(e)&&e.length>t?e[t]:void 0}function AGi(e,t=0){if(Ohp(e)&&e.length>t)return e[e.length-1-t]}function Ohp(e){return E_o(e)}function Dba(e="",t=!0,r=`
1104
1104
  `){return e.split(r).reduce((i,n)=>{let a=t?n.trim():n;return a&&i.push(a),i},[])}function SUs(e,t){return Dba(e,!0).map(r=>t(r))}function MUs(e){return(0,m_o.exists)(e,m_o.FOLDER)}function hA(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Ahp(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function P_o(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function _Wt(e){return Array.isArray(e)?e:[e]}function mhp(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function RCn(e){return _Wt(e).map(t=>t instanceof String?t:String(t))}function gj(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function wba(e,t){let r=[];for(let i=0,n=e.length;i<n;i++)r.push(t,e[i]);return r}function Eba(e){return(Array.isArray(e)?hhp.Buffer.concat(e):e).toString("utf-8")}function Php(e,t){let r={};return t.forEach(i=>{e[i]!==void 0&&(r[i]=e[i])}),r}function fUs(e=0){return new Promise(t=>setTimeout(t,e))}function dUs(e){if(e!==!1)return e}var qCn,mGi,Bba,j_o=Yn({"src/lib/utils/util.ts"(){"use strict";DUs(),qCn="\0",mGi=()=>{},Bba=Object.prototype.toString.call.bind(Object.prototype.toString)}});function x_e(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function pUs(e,t){let r=y_o(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function w_o(e){return!!e&&Bba(e)==="[object Object]"}function jhp(e){return typeof e=="function"}var Iba,whp,CR,b_o,E_o,DUs=Yn({"src/lib/utils/argument-filters.ts"(){"use strict";Sba(),j_o(),Iba=e=>Array.isArray(e),whp=e=>typeof e=="number",CR=e=>typeof e=="string",b_o=e=>CR(e)||Array.isArray(e)&&e.every(CR),E_o=e=>e==null||"number|boolean|function".includes(typeof e)?!1:typeof e.length=="number"}}),_Us,RDE=Yn({"src/lib/utils/exit-codes.ts"(){"use strict";_Us=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(_Us||{})}}),v_o,zDE=Yn({"src/lib/utils/git-output-streams.ts"(){"use strict";v_o=class Ehp{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new Ehp(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function NDE(){throw new Error("LineParser:useMatches not implemented")}var Ud,lDi,FDE=Yn({"src/lib/utils/line-parser.ts"(){"use strict";Ud=class{constructor(e,t){this.matches=[],this.useMatches=NDE,this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,a)=>this.addMatch(n,a,r(a)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let i=r&&e.exec(r);return i&&this.pushMatch(t,i),!!i}pushMatch(e,t){this.matches.push(...t.slice(1))}},lDi=class extends Ud{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Shp(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...Mhp},...e.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Mhp,QDE=Yn({"src/lib/utils/simple-git-options.ts"(){"use strict";Mhp={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function BUs(e,t=[]){return w_o(e)?Object.keys(e).reduce((r,i)=>{let n=e[i];if(y_o(n))r.push(n);else if(pUs(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let a of n)pUs(a,["string","number"])||r.push(i+"="+a);else r.push(i);return r},t):t}function X7(e,t=0,r=!1){let i=[];for(let n=0,a=t<0?e.length:t;n<a;n++)"string|number".includes(typeof e[n])&&i.push(String(e[n]));return BUs(IUs(e),i),r||i.push(...UDE(e)),i}function UDE(e){let t=typeof AGi(e)=="function";return RCn(x_e(AGi(e,t?1:0),Iba,[]))}function IUs(e){let t=jhp(AGi(e));return x_e(AGi(e,t?1:0),w_o)}function uD(e,t=!0){let r=yhp(AGi(e));return t||bhp(r)?r:void 0}var LDE=Yn({"src/lib/utils/task-options.ts"(){"use strict";DUs(),j_o(),Sba()}});function hUs(e,t){return e(t.stdOut,t.stdErr)}function k7(e,t,r,i=!0){return _Wt(r).forEach(n=>{for(let a=Dba(n,i),o=0,c=a.length;o<c;o++){let f=(s=0)=>{if(!(o+s>=c))return a[o+s]};t.some(({parse:s})=>s(f,e))}}),e}var VDE=Yn({"src/lib/utils/task-parser.ts"(){"use strict";j_o()}}),Dhp={};dB(Dhp,{ExitCodes:()=>_Us,GitOutputStreams:()=>v_o,LineParser:()=>Ud,NOOP:()=>mGi,NULL:()=>qCn,RemoteLineParser:()=>lDi,append:()=>hA,appendTaskOptions:()=>BUs,asArray:()=>_Wt,asCamelCase:()=>mhp,asFunction:()=>yhp,asNumber:()=>gj,asStringArray:()=>RCn,bufferToString:()=>Eba,callTaskParser:()=>hUs,createInstanceConfig:()=>Shp,delay:()=>fUs,filterArray:()=>Iba,filterFunction:()=>jhp,filterHasLength:()=>E_o,filterNumber:()=>whp,filterPlainObject:()=>w_o,filterPrimitives:()=>pUs,filterString:()=>CR,filterStringOrStringArray:()=>b_o,filterType:()=>x_e,first:()=>ghp,folderExists:()=>MUs,forEachLineWithContent:()=>SUs,getTrailingOptions:()=>X7,including:()=>Ahp,isUserFunction:()=>bhp,last:()=>AGi,objectToString:()=>Bba,orVoid:()=>dUs,parseStringResponse:()=>k7,pick:()=>Php,prefixedArray:()=>wba,remove:()=>P_o,splitOn:()=>vhp,toLinesWithContent:()=>Dba,trailingFunctionArgument:()=>uD,trailingOptionsArgument:()=>IUs});var wf=Yn({"src/lib/utils/index.ts"(){"use strict";DUs(),RDE(),zDE(),FDE(),QDE(),LDE(),VDE(),j_o()}}),Bhp={};dB(Bhp,{CheckRepoActions:()=>yUs,checkIsBareRepoTask:()=>Chp,checkIsRepoRootTask:()=>Ihp,checkIsRepoTask:()=>WDE});function WDE(e){switch(e){case"bare":return Chp();case"root":return Ihp()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:S_o,parser:CUs}}function Ihp(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:S_o,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Chp(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:S_o,parser:CUs}}function xDE(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var yUs,S_o,CUs,qhp=Yn({"src/lib/tasks/check-is-repo.ts"(){"use strict";wf(),yUs=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(yUs||{}),S_o=({exitCode:e},t,r,i)=>{if(e===128&&xDE(t))return r(Buffer.from("false"));i(t)},CUs=e=>e.trim()==="true"}});function GDE(e,t){let r=new Thp(e),i=e?zhp:Rhp;return Dba(t).forEach(n=>{let a=n.replace(i,"");r.paths.push(a),(Nhp.test(a)?r.folders:r.files).push(a)}),r}var Thp,Rhp,zhp,Nhp,HDE=Yn({"src/lib/responses/CleanSummary.ts"(){"use strict";wf(),Thp=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Rhp=/^[a-z]+\s*/i,zhp=/^[a-z]+\s+[a-z]+\s*/i,Nhp=/\/$/}}),bUs={};dB(bUs,{EMPTY_COMMANDS:()=>M_o,adhocExecTask:()=>Fhp,configurationErrorTask:()=>Z7,isBufferTask:()=>Uhp,isEmptyTask:()=>Lhp,straightThroughBufferTask:()=>Qhp,straightThroughStringTask:()=>WW});function Fhp(e){return{commands:M_o,format:"empty",parser:e}}function Z7(e){return{commands:M_o,format:"empty",parser(){throw typeof e=="string"?new php(e):e}}}function WW(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Qhp(e){return{commands:e,format:"buffer",parser(t){return t}}}function Uhp(e){return e.format==="buffer"}function Lhp(e){return e.format==="empty"||!e.commands.length}var M_o,fB=Yn({"src/lib/tasks/task.ts"(){"use strict";_hp(),M_o=[]}}),Vhp={};dB(Vhp,{CONFIG_ERROR_INTERACTIVE_MODE:()=>qUs,CONFIG_ERROR_MODE_REQUIRED:()=>TUs,CONFIG_ERROR_UNKNOWN_OPTION:()=>RUs,CleanOptions:()=>d_o,cleanTask:()=>Whp,cleanWithOptionsTask:()=>KDE,isCleanOptionsArray:()=>JDE});function KDE(e,t){let{cleanMode:r,options:i,valid:n}=$DE(e);return r?n.options?(i.push(...t),i.some(ZDE)?Z7(qUs):Whp(r,i)):Z7(RUs+JSON.stringify(e)):Z7(TUs)}function Whp(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(i){return GDE(e==="n",i)}}}function JDE(e){return Array.isArray(e)&&e.every(t=>zUs.has(t))}function $DE(e){let t,r=[],i={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(n=>{YDE(n)?(t=n,i.cleanMode=!0):i.options=i.options&&XDE(r[r.length]=`-${n}`)}),{cleanMode:t,options:r,valid:i}}function YDE(e){return e==="f"||e==="n"}function XDE(e){return/^-[a-z]$/i.test(e)&&zUs.has(e.charAt(1))}function ZDE(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var qUs,TUs,RUs,d_o,zUs,xhp=Yn({"src/lib/tasks/clean.ts"(){"use strict";HDE(),wf(),fB(),qUs="Git clean interactive mode is not supported",TUs='Git clean mode parameter ("n" or "f") is required',RUs="Git clean unknown option found in: ",d_o=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(d_o||{}),zUs=new Set(["i",...RCn(Object.values(d_o))])}});function kDE(e){let t=new Hhp;for(let r of Ghp(e))t.addValue(r.file,String(r.key),r.value);return t}function eBE(e,t){let r=null,i=[],n=new Map;for(let a of Ghp(e,t))a.key===t&&(i.push(r=a.value),n.has(a.file)||n.set(a.file,[]),n.get(a.file).push(r));return{key:t,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function tBE(e){return e.replace(/^(file):/,"")}function*Ghp(e,t=null){let r=e.split("\0");for(let i=0,n=r.length-1;i<n;){let a=tBE(r[i++]),o=r[i++],c=t;if(o.includes(`
1105
1105
  `)){let f=vhp(o,`
1106
1106
  `);c=f[0],o=f[1]}yield{file:a,key:c,value:o}}}var Hhp,rBE=Yn({"src/lib/responses/ConfigList.ts"(){"use strict";wf(),Hhp=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=AGi(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let i=this.addFile(e);Object.hasOwn(i,t)?Array.isArray(i[t])?i[t].push(r):i[t]=[i[t],r]:i[t]=r,this._all=void 0}}}});function aUs(e,t){return typeof e=="string"&&Object.hasOwn(vUs,e)?e:t}function iBE(e,t,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(e,t),{commands:n,format:"utf-8",parser(a){return a}}}function nBE(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(i){return eBE(i,e)}}}function aBE(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return kDE(r)}}}function oBE(){return{addConfig(e,t,...r){return this._runTask(iBE(e,t,r[0]===!0,aUs(r[1],"local")),uD(arguments))},getConfig(e,t){return this._runTask(nBE(e,aUs(t,void 0)),uD(arguments))},listConfig(...e){return this._runTask(aBE(aUs(e[0],void 0)),uD(arguments))}}}var vUs,Khp=Yn({"src/lib/tasks/config.ts"(){"use strict";rBE(),wf(),vUs=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(vUs||{})}});function uBE(e){return Jhp.has(e)}var oUs,Jhp,$hp=Yn({"src/lib/tasks/diff-name-status.ts"(){"use strict";oUs=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(oUs||{}),Jhp=new Set(Object.values(oUs))}});function sBE(...e){return new Xhp().param(...e)}function cBE(e){let t=new Set,r={};return SUs(e,i=>{let[n,a,o]=i.split(qCn);t.add(n),(r[n]=r[n]||[]).push({line:gj(a),path:n,preview:o})}),{paths:t,results:r}}function lBE(){return{grep(e){let t=uD(arguments),r=X7(arguments);for(let n of Yhp)if(r.includes(n))return this._runTask(Z7(`git.grep: use of "${n}" is not supported.`),t);typeof e=="string"&&(e=sBE().param(e));let i=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:i,format:"utf-8",parser(n){return cBE(n)}},t)}}}var Yhp,jba,N_p,Xhp,Zhp=Yn({"src/lib/tasks/grep.ts"(){"use strict";wf(),fB(),Yhp=["-h"],jba=Symbol("grepQuery"),Xhp=class{constructor(){this[N_p]=[]}*[(N_p=jba,Symbol.iterator)](){for(let e of this[jba])yield e}and(...e){return e.length&&this[jba].push("--and","(",...wba(e,"-e"),")"),this}param(...e){return this[jba].push(...wba(e,"-e")),this}}}}),khp={};dB(khp,{ResetMode:()=>p_o,getResetMode:()=>dBE,resetTask:()=>fBE});function fBE(e,t){let r=["reset"];return eyp(e)&&r.push(`--${e}`),r.push(...t),WW(r)}function dBE(e){if(eyp(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function eyp(e){return typeof e=="string"&&typ.includes(e)}var p_o,typ,ryp=Yn({"src/lib/tasks/reset.ts"(){"use strict";wf(),fB(),p_o=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(p_o||{}),typ=RCn(Object.values(p_o))}});function pBE(){return(0,g_o.default)("simple-git")}function F_p(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(i,...n)=>{e(i,...n),r(i,...n)}:e:(i,...n)=>{e(`%s ${i}`,t,...n),r&&r(i,...n)}}function _BE(e,t,{namespace:r}){if(typeof e=="string")return e;let i=t&&t.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function NUs(e,t,r,i=pBE()){let n=e&&`[${e}]`||"",a=[],o=typeof t=="string"?i.extend(t):t,c=_BE(x_e(t,CR),o,i);return s(r);function f(u,l){return hA(a,NUs(e,c.replace(/^[^:]+/,u),l,i))}function s(u){let l=u&&`[${u}]`||"",p=o&&F_p(o,l)||mGi,_=F_p(i,`${n} ${l}`,p);return Object.assign(o?p:_,{label:e,sibling:f,info:_,step:s})}}var iyp=Yn({"src/lib/git-logger.ts"(){"use strict";wf(),g_o.default.formatters.L=e=>String(E_o(e)?e.length:"-"),g_o.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):Bba(e)}}),nyp,hBE=Yn({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";fDi(),iyp(),nyp=class gUs{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=gUs.getName(t.commands[0]),i=NUs(this.logLabel,r);return{task:t,logger:i,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:i}]of Array.from(this._queue.entries()))r===t.task?(i.info("Failed %o",t),i("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):i.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new tbi(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++gUs.counter}`}static{this.counter=0}}}});function OGi(e,t){return{method:ghp(e.commands)||"",commands:t}}function yBE(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Q_p(e,t,r,i){return n=>{r("%s received %L bytes",t,n),i("%B",n),e.push(n)}}var OUs,bBE=Yn({"src/lib/runners/git-executor-chain.ts"(){"use strict";fDi(),fB(),wf(),hBE(),OUs=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new nyp}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:i}=this._queue.attempt(e);return await(Lhp(e)?this.attemptEmptyTask(e,i):this.attemptRemoteTask(e,i))}catch(i){throw this.onFatalException(e,i)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof tbi?Object.assign(t,{task:e}):new tbi(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",OGi(e,e.commands)),i=this._plugins.exec("spawn.args",[...e.commands],OGi(e,e.commands)),n=await this.gitResponse(e,r,i,this.outputHandler,t.step("SPAWN")),a=await this.handleTaskData(e,i,n,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Uhp(e)?hUs(e.parser,a):hUs(e.parser,a.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,i){let{exitCode:n,rejection:a,stdOut:o,stdErr:c}=r;return new Promise((f,s)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:u}=this._plugins.exec("task.error",{error:a},{...OGi(e,t),...r});if(u&&e.onError)return i.info("exitCode=%s handling with custom error handler"),e.onError(r,u,l=>{i.info("custom error handler treated as success"),i("custom error returned a %s",Bba(l)),f(new v_o(Array.isArray(l)?Buffer.concat(l):l,Buffer.concat(c)))},s);if(u)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,c.length,a),s(u);i.info("retrieving task output complete"),f(new v_o(Buffer.concat(o),Buffer.concat(c)))})}async gitResponse(e,t,r,i,n){let a=n.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},OGi(e,e.commands));return new Promise(c=>{let f=[],s=[];n.info("%s %o",t,r),n("%O",o);let u=this._beforeSpawn(e,r);if(u)return c({stdOut:f,stdErr:s,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...OGi(e,r),kill(p){u=p||u}});let l=(0,ayp.spawn)(t,r,o);l.stdout.on("data",Q_p(f,"stdOut",n,a.step("stdOut"))),l.stderr.on("data",Q_p(s,"stdErr",n,a.step("stdErr"))),l.on("error",yBE(s,n)),i&&(n("Passing child process stdOut/stdErr to custom outputHandler"),i(t,l.stdout,l.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...OGi(e,r),spawned:l,close(p,_){c({stdOut:f,stdErr:s,exitCode:p,rejection:u||_})},kill(p){l.killed||(u=p,l.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...OGi(e,t),kill(i){r=i||r}}),r}}}}),oyp={};dB(oyp,{GitExecutor:()=>uyp});var uyp,vBE=Yn({"src/lib/runners/git-executor.ts"(){"use strict";bBE(),uyp=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new OUs(this,this._scheduler,this._plugins)}chain(){return new OUs(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function gBE(e,t,r=mGi){let i=a=>{r(null,a)},n=a=>{a?.task===e&&r(a instanceof Mba?OBE(a):a,void 0)};t.then(i,n)}function OBE(e){let t=i=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),t=mGi};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(i,n){return n in e||(i[n]={enumerable:!1,configurable:!1,get(){return t(n),e.git[n]}}),i}}var ABE=Yn({"src/lib/task-callback.ts"(){"use strict";TCn(),wf()}});function U_p(e,t){return Fhp(r=>{if(!MUs(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var mBE=Yn({"src/lib/tasks/change-working-directory.ts"(){"use strict";wf(),fB()}});function uUs(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=P_o(t,"-B")),WW(t)}function PBE(){return{checkout(){return this._runTask(uUs(X7(arguments,1)),uD(arguments))},checkoutBranch(e,t){return this._runTask(uUs(["-b",e,t,...X7(arguments)]),uD(arguments))},checkoutLocalBranch(e){return this._runTask(uUs(["-b",e,...X7(arguments)]),uD(arguments))}}}var jBE=Yn({"src/lib/tasks/checkout.ts"(){"use strict";wf(),fB()}});function wBE(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function EBE(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return k7(wBE(),[syp],e)}})}}}var syp,SBE=Yn({"src/lib/tasks/count-objects.ts"(){"use strict";wf(),syp=new Ud(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let i=mhp(t);Object.hasOwn(e,i)&&(e[i]=gj(r))})}});function MBE(e){return k7({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},cyp,e)}var cyp,DBE=Yn({"src/lib/parsers/parse-commit.ts"(){"use strict";wf(),cyp=[new Ud(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,i])=>{e.branch=t,e.commit=i,e.root=!!r}),new Ud(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),i=r.pop();!i||!i.includes("@")||(e.author={email:i.substr(0,i.length-1),name:r.join("<").trim()})}),new Ud(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,i])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(i,10)||0}),new Ud(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,i])=>{e.summary.changes=parseInt(t,10)||0;let n=parseInt(r,10)||0;i==="-"?e.summary.deletions=n:i==="+"&&(e.summary.insertions=n)})]}});function BBE(e,t,r){return{commands:["-c","core.abbrev=40","commit",...wba(e,"-m"),...t,...r],format:"utf-8",parser:MBE}}function IBE(){return{commit(t,...r){let i=uD(arguments),n=e(t)||BBE(_Wt(t),_Wt(x_e(r[0],b_o,[])),[...RCn(x_e(r[1],Iba,[])),...X7(arguments,0,!0)]);return this._runTask(n,i)}};function e(t){return!b_o(t)&&Z7("git.commit: requires the commit message to be supplied as a string/string[]")}}var CBE=Yn({"src/lib/tasks/commit.ts"(){"use strict";DBE(),wf(),fB()}});function qBE(){return{firstCommit(){return this._runTask(WW(["rev-list","--max-parents=0","HEAD"],!0),uD(arguments))}}}var TBE=Yn({"src/lib/tasks/first-commit.ts"(){"use strict";wf(),fB()}});function RBE(e,t){let r=["hash-object",e];return t&&r.push("-w"),WW(r,!0)}var zBE=Yn({"src/lib/tasks/hash-object.ts"(){"use strict";fB()}});function NBE(e,t,r){let i=String(r).trim(),n;if(n=lyp.exec(i))return new __o(e,t,!1,n[1]);if(n=fyp.exec(i))return new __o(e,t,!0,n[1]);let a="",o=i.split(" ");for(;o.length;)if(o.shift()==="in"){a=o.join(" ");break}return new __o(e,t,/^re/i.test(i),a)}var __o,lyp,fyp,FBE=Yn({"src/lib/responses/InitSummary.ts"(){"use strict";__o=class{constructor(e,t,r,i){this.bare=e,this.path=t,this.existing=r,this.gitDir=i}},lyp=/^Init.+ repository in (.+)$/,fyp=/^Rein.+ in (.+)$/}});function QBE(e){return e.includes(FUs)}function UBE(e=!1,t,r){let i=["init",...r];return e&&!QBE(i)&&i.splice(1,0,FUs),{commands:i,format:"utf-8",parser(n){return NBE(i.includes("--bare"),t,n)}}}var FUs,LBE=Yn({"src/lib/tasks/init.ts"(){"use strict";FBE(),FUs="--bare"}});function QUs(e){for(let t=0;t<e.length;t++){let r=UUs.exec(e[t]);if(r)return`--${r[1]}`}return""}function VBE(e){return UUs.test(e)}var UUs,Cba=Yn({"src/lib/args/log-format.ts"(){"use strict";UUs=/^--(stat|numstat|name-only|name-status)(=|$)/}}),dyp,WBE=Yn({"src/lib/responses/DiffSummary.ts"(){"use strict";dyp=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function pyp(e=""){let t=_yp[e];return r=>k7(new dyp,t,r,!1)}var sUs,L_p,V_p,W_p,_yp,hyp=Yn({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Cba(),WBE(),$hp(),wf(),sUs=[new Ud(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,i=""])=>{e.files.push({file:t.trim(),changes:gj(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new Ud(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,i])=>{e.files.push({file:t.trim(),before:gj(r),after:gj(i),binary:!0})}),new Ud(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);e.changed=gj(t),e.insertions=gj(i?.[1]),e.deletions=gj(n?.[1])})],L_p=[new Ud(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,i])=>{let n=gj(t),a=gj(r);e.changed++,e.insertions+=n,e.deletions+=a,e.files.push({file:i,changes:n+a,insertions:n,deletions:a,binary:!1})}),new Ud(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],V_p=[new Ud(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],W_p=[new Ud(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,i,n,a])=>{e.changed++,e.files.push({file:a??i,changes:0,insertions:0,deletions:0,binary:!1,status:dUs(uBE(t)&&t),from:dUs(!!a&&i!==a&&i),similarity:gj(r)})})],_yp={"":sUs,"--stat":sUs,"--numstat":L_p,"--name-status":W_p,"--name-only":V_p}}});function xBE(e,t){return t.reduce((r,i,n)=>(r[i]=e[n]||"",r),Object.create({diff:null}))}function yyp(e=WUs,t=byp,r=""){let i=pyp(r);return function(n){let a=Dba(n.trim(),!1,LUs).map(function(o){let c=o.split(VUs),f=xBE(c[0].split(e),t);return c.length>1&&c[1].trim()&&(f.diff=i(c[1])),f});return{all:a,latest:a.length&&a[0]||null,total:a.length}}}var LUs,VUs,WUs,byp,vyp=Yn({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";wf(),hyp(),Cba(),LUs="\xF2\xF2\xF2\xF2\xF2\xF2 ",VUs=" \xF2\xF2",WUs=" \xF2 ",byp=["hash","date","message","refs","author_name","author_email"]}}),gyp={};dB(gyp,{diffSummaryTask:()=>GBE,validateLogFormatConfig:()=>D_o});function GBE(e){let t=QUs(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),D_o(r)||{commands:r,format:"utf-8",parser:pyp(t)}}function D_o(e){let t=e.filter(VBE);if(t.length>1)return Z7(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return Z7(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var xUs=Yn({"src/lib/tasks/diff.ts"(){"use strict";Cba(),hyp(),fB()}});function HBE(e,t){let r=[],i=[];return Object.keys(e).forEach(n=>{r.push(n),i.push(String(e[n]))}),[r,i.join(t)]}function KBE(e){return Object.keys(e).reduce((t,r)=>(r in AUs||(t[r]=e[r]),t),{})}function Oyp(e={},t=[]){let r=x_e(e.splitter,CR,WUs),i=w_o(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[n,a]=HBE(i,r),o=[],c=[`--pretty=format:${LUs}${a}${VUs}`,...t],f=e.n||e["max-count"]||e.maxCount;if(f&&c.push(`--max-count=${f}`),e.from||e.to){let s=e.symmetric!==!1?"...":"..";o.push(`${e.from||""}${s}${e.to||""}`)}return CR(e.file)&&c.push("--follow",TDE(e.file)),BUs(KBE(e),c),{fields:n,splitter:r,commands:[...c,...o]}}function JBE(e,t,r){let i=yyp(e,t,QUs(r));return{commands:["log",...r],format:"utf-8",parser:i}}function $BE(){return{log(...r){let i=uD(arguments),n=Oyp(IUs(arguments),RCn(x_e(arguments[0],Iba,[]))),a=t(...r)||D_o(n.commands)||e(n);return this._runTask(a,i)}};function e(r){return JBE(r.splitter,r.fields,r.commands)}function t(r,i){return CR(r)&&CR(i)&&Z7("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var AUs,Ayp=Yn({"src/lib/tasks/log.ts"(){"use strict";Cba(),Sba(),vyp(),wf(),fB(),xUs(),AUs=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(AUs||{})}}),h_o,myp,YBE=Yn({"src/lib/responses/MergeSummary.ts"(){"use strict";h_o=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},myp=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),mUs,Pyp,XBE=Yn({"src/lib/responses/PullSummary.ts"(){"use strict";mUs=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Pyp=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function cUs(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function x_p(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:gj(t&&t[1]||"0"),delta:gj(r&&r[1]||"0")}}var jyp,ZBE=Yn({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";wf(),jyp=[new lDi(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let i=t.toLowerCase(),n=cUs(e.remoteMessages);Object.assign(n,{[i]:gj(r)})}),new lDi(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let i=t.toLowerCase(),n=cUs(e.remoteMessages);Object.assign(n,{[i]:gj(r)})}),new lDi(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,i])=>{let n=cUs(e.remoteMessages);n.total=x_p(t),n.reused=x_p(r),n.packReused=gj(i)})]}});function wyp(e,t){return k7({remoteMessages:new Syp},Eyp,t)}var Eyp,Syp,Myp=Yn({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";wf(),ZBE(),Eyp=[new lDi(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...jyp,new lDi([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new lDi([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,i])=>{e.remoteMessages.vulnerabilities={count:gj(t),summary:r,url:i}})],Syp=class{constructor(){this.all=[]}}}});function kBE(e,t){let r=k7(new Pyp,Dyp,[e,t]);return r.message&&r}var G_p,H_p,K_p,J_p,Dyp,$_p,GUs,Byp=Yn({"src/lib/parsers/parse-pull.ts"(){"use strict";XBE(),wf(),Myp(),G_p=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,H_p=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,K_p=/^(create|delete) mode \d+ (.+)/,J_p=[new Ud(G_p,(e,[t,r,i])=>{e.files.push(t),r&&(e.insertions[t]=r.length),i&&(e.deletions[t]=i.length)}),new Ud(H_p,(e,[t,,r,,i])=>r!==void 0||i!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+i||0,!0):!1),new Ud(K_p,(e,[t,r])=>{hA(e.files,r),hA(t==="create"?e.created:e.deleted,r)})],Dyp=[new Ud(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new Ud(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new Ud(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,i,n])=>{e.branch.local=i,e.hash.local=t,e.branch.remote=n,e.hash.remote=r})],$_p=(e,t)=>k7(new mUs,J_p,[e,t]),GUs=(e,t)=>Object.assign(new mUs,$_p(e,t),wyp(e,t))}}),Y_p,Iyp,X_p,eIE=Yn({"src/lib/parsers/parse-merge.ts"(){"use strict";YBE(),wf(),Byp(),Y_p=[new Ud(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new Ud(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new h_o(t,r))}),new Ud(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,i])=>{e.conflicts.push(new h_o(t,r,{deleteRef:i}))}),new Ud(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new h_o(t,null))}),new Ud(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Iyp=(e,t)=>Object.assign(X_p(e,t),GUs(e,t)),X_p=e=>k7(new myp,Y_p,e)}});function Z_p(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let i=Iyp(t,r);if(i.failed)throw new Mba(i);return i}}:Z7("Git.merge requires at least one option")}var tIE=Yn({"src/lib/tasks/merge.ts"(){"use strict";TCn(),eIE(),fB()}});function rIE(e,t,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(e),a=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!a,alreadyUpdated:a,local:e,remote:t}}var k_p,Cyp,ehp,iIE=Yn({"src/lib/parsers/parse-push.ts"(){"use strict";wf(),Myp(),k_p=[new Ud(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new Ud(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new Ud(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,i])=>{e.pushed.push(rIE(t,r,i))}),new Ud(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,i])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:i}}),new Ud(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,i,n])=>{e.update={head:{local:t,remote:r},hash:{from:i,to:n}}})],Cyp=(e,t)=>{let r=ehp(e,t),i=wyp(e,t);return{...r,...i}},ehp=(e,t)=>k7({pushed:[]},k_p,[e,t])}}),qyp={};dB(qyp,{pushTagsTask:()=>nIE,pushTask:()=>HUs});function nIE(e={},t){return hA(t,"--tags"),HUs(e,t)}function HUs(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),P_o(r,"-v"),hA(r,"--verbose"),hA(r,"--porcelain"),{commands:r,format:"utf-8",parser:Cyp}}var Typ=Yn({"src/lib/tasks/push.ts"(){"use strict";iIE(),wf()}});function aIE(){return{showBuffer(){let e=["show",...X7(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Qhp(e),uD(arguments))},show(){let e=["show",...X7(arguments,1)];return this._runTask(WW(e),uD(arguments))}}}var oIE=Yn({"src/lib/tasks/show.ts"(){"use strict";wf(),fB()}}),thp,Ryp,uIE=Yn({"src/lib/responses/FileStatusSummary.ts"(){"use strict";thp=/^(.+)\0(.+)$/,Ryp=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let i=thp.exec(e)||[null,e,e];this.from=i[2]||"",this.path=i[1]||""}}}}});function rhp(e){let[t,r]=e.split(qCn);return{from:r||t,to:t}}function W_e(e,t,r){return[`${e}${t}`,r]}function lUs(e,...t){return t.map(r=>W_e(e,r,(i,n)=>hA(i.conflicted,n)))}function sIE(e,t){let r=t.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return i(" ",r.charAt(0),r.substr(2));default:return}function i(n,a,o){let c=`${n}${a}`,f=zyp.get(c);f&&f(e,o),c!=="##"&&c!=="!!"&&e.files.push(new Ryp(o,n,a))}}var ihp,zyp,Nyp,cIE=Yn({"src/lib/responses/StatusSummary.ts"(){"use strict";wf(),uIE(),ihp=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},zyp=new Map([W_e(" ","A",(e,t)=>hA(e.created,t)),W_e(" ","D",(e,t)=>hA(e.deleted,t)),W_e(" ","M",(e,t)=>hA(e.modified,t)),W_e("A"," ",(e,t)=>hA(e.created,t)&&hA(e.staged,t)),W_e("A","M",(e,t)=>hA(e.created,t)&&hA(e.staged,t)&&hA(e.modified,t)),W_e("D"," ",(e,t)=>hA(e.deleted,t)&&hA(e.staged,t)),W_e("M"," ",(e,t)=>hA(e.modified,t)&&hA(e.staged,t)),W_e("M","M",(e,t)=>hA(e.modified,t)&&hA(e.staged,t)),W_e("R"," ",(e,t)=>{hA(e.renamed,rhp(t))}),W_e("R","M",(e,t)=>{let r=rhp(t);hA(e.renamed,r),hA(e.modified,r.to)}),W_e("!","!",(e,t)=>{hA(e.ignored=e.ignored||[],t)}),W_e("?","?",(e,t)=>hA(e.not_added,t)),...lUs("A","A","U"),...lUs("D","D","U"),...lUs("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,o=/\son\s(\S+?)(?=\.{3}|$)/,c=r.exec(t);e.ahead=c&&+c[1]||0,c=i.exec(t),e.behind=c&&+c[1]||0,c=n.exec(t),e.current=x_e(c?.[1],CR,null),c=a.exec(t),e.tracking=x_e(c?.[1],CR,null),c=o.exec(t),c&&(e.current=x_e(c?.[1],CR,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Nyp=function(e){let t=e.split(qCn),r=new ihp;for(let i=0,n=t.length;i<n;){let a=t[i++].trim();a&&(a.charAt(0)==="R"&&(a+=qCn+(t[i++]||"")),sIE(r,a))}return r}}});function lIE(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Fyp.includes(r))],parser(r){return Nyp(r)}}}var Fyp,fIE=Yn({"src/lib/tasks/status.ts"(){"use strict";cIE(),Fyp=["--null","-z"]}});function O_o(e=0,t=0,r=0,i="",n=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function dIE(){return O_o(0,0,0,"",!1)}function pIE(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:_IE,onError(e,t,r,i){if(e.exitCode===-2)return r(Buffer.from(KUs));i(t)}})}}}function _IE(e){return e===KUs?dIE():k7(O_o(0,0,0,e),Qyp,e)}var KUs,Qyp,hIE=Yn({"src/lib/tasks/version.ts"(){"use strict";wf(),KUs="installed=false",Qyp=[new Ud(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,i,n=""])=>{Object.assign(e,O_o(gj(t),gj(r),gj(i),n))}),new Ud(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,i,n=""])=>{Object.assign(e,O_o(gj(t),gj(r),i,n))})]}}),Uyp={};dB(Uyp,{SimpleGitApi:()=>PUs});var PUs,yIE=Yn({"src/lib/simple-git-api.ts"(){"use strict";ABE(),mBE(),jBE(),SBE(),CBE(),Khp(),TBE(),Zhp(),zBE(),LBE(),Ayp(),tIE(),Typ(),oIE(),fIE(),fB(),hIE(),wf(),PUs=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),i=r.push(e);return t&&gBE(e,i,t),Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(e){return this._runTask(WW(["add",..._Wt(e)]),uD(arguments))}cwd(e){let t=uD(arguments);return typeof e=="string"?this._runTask(U_p(e,this._executor),t):typeof e?.path=="string"?this._runTask(U_p(e.path,e.root&&this._executor||void 0),t):this._runTask(Z7("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(RBE(e,t===!0),uD(arguments))}init(e){return this._runTask(UBE(e===!0,this._executor.cwd,X7(arguments)),uD(arguments))}merge(){return this._runTask(Z_p(X7(arguments)),uD(arguments))}mergeFromTo(e,t){return CR(e)&&CR(t)?this._runTask(Z_p([e,t,...X7(arguments)]),uD(arguments,!1)):this._runTask(Z7("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=HUs({remote:x_e(arguments[0],CR),branch:x_e(arguments[1],CR)},X7(arguments));return this._runTask(e,uD(arguments))}stash(){return this._runTask(WW(["stash",...X7(arguments)]),uD(arguments))}status(){return this._runTask(lIE(X7(arguments)),uD(arguments))}},Object.assign(PUs.prototype,PBE(),IBE(),oBE(),EBE(),qBE(),lBE(),$BE(),aIE(),pIE())}}),Lyp={};dB(Lyp,{Scheduler:()=>Wyp});var nhp,Wyp,bIE=Yn({"src/lib/runners/scheduler.ts"(){"use strict";wf(),iyp(),nhp=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Vyp.createDeferred)();return{promise:t,done:r,id:e}}})(),Wyp=class{constructor(e=2){this.concurrency=e,this.logger=NUs("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=hA(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),P_o(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=hA(this.pending,nhp());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),xyp={};dB(xyp,{applyPatchTask:()=>vIE});function vIE(e,t){return WW(["apply",...t,...e])}var gIE=Yn({"src/lib/tasks/apply-patch.ts"(){"use strict";fB()}});function OIE(e,t){return{branch:e,hash:t,success:!0}}function AIE(e){return{branch:e,hash:null,success:!1}}var Gyp,mIE=Yn({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Gyp=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Hyp(e,t){return t===1&&jUs.test(e)}var ahp,jUs,ohp,B_o,PIE=Yn({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";mIE(),wf(),ahp=/(\S+)\s+\(\S+\s([^)]+)\)/,jUs=/^error[^']+'([^']+)'/m,ohp=[new Ud(ahp,(e,[t,r])=>{let i=OIE(t,r);e.all.push(i),e.branches[t]=i}),new Ud(jUs,(e,[t])=>{let r=AIE(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],B_o=(e,t)=>k7(new Gyp,ohp,[e,t])}}),Kyp,jIE=Yn({"src/lib/responses/BranchSummary.ts"(){"use strict";Kyp=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,i,n){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:i,label:n}}}}});function uhp(e){return e?e.charAt(0):""}function Jyp(e,t=!1){return k7(new Kyp,t?[Yyp]:$yp,e)}var $yp,Yyp,wIE=Yn({"src/lib/parsers/parse-branch.ts"(){"use strict";jIE(),wf(),$yp=[new Ud(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,i,n])=>{e.push(uhp(t),!0,r,i,n)}),new Ud(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,i,n])=>{e.push(uhp(t),!1,r,i,n)})],Yyp=new Ud(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),Xyp={};dB(Xyp,{branchLocalTask:()=>SIE,branchTask:()=>EIE,containsDeleteBranchCommand:()=>Zyp,deleteBranchTask:()=>DIE,deleteBranchesTask:()=>MIE});function Zyp(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function EIE(e){let t=Zyp(e),r=e.includes("--show-current"),i=["branch",...e];return i.length===1&&i.push("-a"),i.includes("-v")||i.splice(1,0,"-v"),{format:"utf-8",commands:i,parser(n,a){return t?B_o(n,a).all[0]:Jyp(n,r)}}}function SIE(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Jyp(e)}}}function MIE(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,i){return B_o(r,i)},onError({exitCode:r,stdOut:i},n,a,o){if(!Hyp(String(n),r))return o(n);a(i)}}}function DIE(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(i,n){return B_o(i,n).branches[e]},onError({exitCode:i,stdErr:n,stdOut:a},o,c,f){if(!Hyp(String(o),i))return f(o);throw new Mba(r.parser(Eba(a),Eba(n)),String(o))}};return r}var BIE=Yn({"src/lib/tasks/branch.ts"(){"use strict";TCn(),PIE(),wIE(),wf()}});function IIE(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&(0,kyp.normalize)(t)}var ebp,CIE=Yn({"src/lib/responses/CheckIgnore.ts"(){"use strict";ebp=e=>e.split(/\n/g).map(IIE).filter(Boolean)}}),tbp={};dB(tbp,{checkIgnoreTask:()=>qIE});function qIE(e){return{commands:["check-ignore",...e],format:"utf-8",parser:ebp}}var TIE=Yn({"src/lib/tasks/check-ignore.ts"(){"use strict";CIE()}}),rbp={};dB(rbp,{cloneMirrorTask:()=>zIE,cloneTask:()=>ibp});function RIE(e){return/^--upload-pack(=|$)/.test(e)}function ibp(e,t,r){let i=["clone",...r];return CR(e)&&i.push(e),CR(t)&&i.push(t),i.find(RIE)?Z7("git.fetch: potential exploit argument blocked."):WW(i)}function zIE(e,t,r){return hA(r,"--mirror"),ibp(e,t,r)}var NIE=Yn({"src/lib/tasks/clone.ts"(){"use strict";fB(),wf()}});function FIE(e,t){return k7({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},nbp,[e,t])}var nbp,QIE=Yn({"src/lib/parsers/parse-fetch.ts"(){"use strict";wf(),nbp=[new Ud(/From (.+)$/,(e,[t])=>{e.remote=t}),new Ud(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new Ud(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new Ud(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new Ud(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,i,n])=>{e.updated.push({name:i,tracking:n,to:r,from:t})})]}}),abp={};dB(abp,{fetchTask:()=>LIE});function UIE(e){return/^--upload-pack(=|$)/.test(e)}function LIE(e,t,r){let i=["fetch",...r];return e&&t&&i.push(e,t),i.find(UIE)?Z7("git.fetch: potential exploit argument blocked."):{commands:i,format:"utf-8",parser:FIE}}var VIE=Yn({"src/lib/tasks/fetch.ts"(){"use strict";QIE(),fB()}});function WIE(e){return k7({moves:[]},obp,e)}var obp,xIE=Yn({"src/lib/parsers/parse-move.ts"(){"use strict";wf(),obp=[new Ud(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),ubp={};dB(ubp,{moveTask:()=>GIE});function GIE(e,t){return{commands:["mv","-v",..._Wt(e),t],format:"utf-8",parser:WIE}}var HIE=Yn({"src/lib/tasks/move.ts"(){"use strict";xIE(),wf()}}),sbp={};dB(sbp,{pullTask:()=>KIE});function KIE(e,t,r){let i=["pull",...r];return e&&t&&i.splice(1,0,e,t),{commands:i,format:"utf-8",parser(n,a){return GUs(n,a)},onError(n,a,o,c){let f=kBE(Eba(n.stdOut),Eba(n.stdErr));if(f)return c(new Mba(f));c(a)}}}var JIE=Yn({"src/lib/tasks/pull.ts"(){"use strict";TCn(),Byp(),wf()}});function $IE(e){let t={};return cbp(e,([r])=>t[r]={name:r}),Object.values(t)}function YIE(e){let t={};return cbp(e,([r,i,n])=>{Object.hasOwn(t,r)||(t[r]={name:r,refs:{fetch:"",push:""}}),n&&i&&(t[r].refs[n.replace(/[^a-z]/g,"")]=i)}),Object.values(t)}function cbp(e,t){SUs(e,r=>t(r.split(/\s+/)))}var XIE=Yn({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";wf()}}),lbp={};dB(lbp,{addRemoteTask:()=>ZIE,getRemotesTask:()=>kIE,listRemotesTask:()=>eCE,remoteTask:()=>tCE,removeRemoteTask:()=>rCE});function ZIE(e,t,r){return WW(["remote","add",...r,e,t])}function kIE(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?YIE:$IE}}function eCE(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),WW(t)}function tCE(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),WW(t)}function rCE(e){return WW(["remote","remove",e])}var iCE=Yn({"src/lib/tasks/remote.ts"(){"use strict";XIE(),fB()}}),fbp={};dB(fbp,{stashListTask:()=>nCE});function nCE(e={},t){let r=Oyp(e),i=["stash","list",...r.commands,...t],n=yyp(r.splitter,r.fields,QUs(i));return D_o(i)||{commands:i,format:"utf-8",parser:n}}var aCE=Yn({"src/lib/tasks/stash-list.ts"(){"use strict";Cba(),vyp(),xUs(),Ayp()}}),dbp={};dB(dbp,{addSubModuleTask:()=>oCE,initSubModuleTask:()=>uCE,subModuleTask:()=>I_o,updateSubModuleTask:()=>sCE});function oCE(e,t){return I_o(["add",e,t])}function uCE(e){return I_o(["init",...e])}function I_o(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),WW(t)}function sCE(e){return I_o(["update",...e])}var cCE=Yn({"src/lib/tasks/sub-module.ts"(){"use strict";fB()}});function lCE(e,t){let r=Number.isNaN(e),i=Number.isNaN(t);return r!==i?r?1:-1:r?pbp(e,t):0}function pbp(e,t){return e===t?0:e>t?1:-1}function fCE(e){return e.trim()}function f_o(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var shp,_bp,dCE=Yn({"src/lib/responses/TagList.ts"(){"use strict";shp=class{constructor(e,t){this.all=e,this.latest=t}},_bp=function(e,t=!1){let r=e.split(`
@@ -1147,7 +1147,7 @@ ${_Up.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&n9s(th
1147
1147
  `+N7i.default.red(">> ")+t),this.screen.render(r,i)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?N7i.default.cyan(PUp(t,this.opt.mask)):N7i.default.italic(N7i.default.dim("[hidden]")):this.opt.mask?PUp(t,this.opt.mask):N7i.default.italic(N7i.default.dim("[input is hidden] "))}getSpinningValue(t){return this.getMaskedValue(t)}filterInput(t){return t||(this.opt.default==null?"":this.opt.default)}onEnd(t){this.status="answered",this.answer=t.value,this.render(),this.screen.done(),this.done(t.value)}onError(t){this.render(t.isValid)}onKeypress(){this.opt.default&&=void 0,this.render()}};var t0o=ue(y1(),1);var P4p=ue(Q9s(),1),kmo=require("child_process"),aTn=require("fs"),Zmo=ue(require("path"),1),j4p=ue(require("os"),1),w4p=require("crypto"),PGs=ue(A4p(),1);var $mo=class extends Error{originalError;constructor(t){super(`Failed to create temporary file. ${t.message}`),this.originalError=t}};var Jga=class extends Error{originalError;constructor(t){super(`Failed to launch editor. ${t.message}`),this.originalError=t}};var Ymo=class extends Error{originalError;constructor(t){super(`Failed to read temporary file. ${t.message}`),this.originalError=t}};var Xmo=class extends Error{originalError;constructor(t){super(`Failed to remove temporary file. ${t.message}`),this.originalError=t}};function e0o(e="",t,r){let i=new jGs(e,r);i.runAsync((n,a)=>{if(n)setImmediate(t,n,void 0);else try{i.cleanup(),setImmediate(t,void 0,a)}catch(o){setImmediate(t,o,void 0)}})}function m4p(e){return e?e.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function $vS(e){let t=[],r="";for(let i=0;i<e.length;i++){let n=e.charAt(i);i>0&&n===" "&&e[i-1]!=="\\"&&r.length>0?(t.push(r),r=""):r=`${r}${n}`}return r.length>0&&t.push(r),t}var jGs=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(t="",r){this.text=t,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(t){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(t,void 0,this.text)}catch(r){setImmediate(t,r,void 0)}})}catch(r){setImmediate(t,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let t=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=$vS(t).map(n=>n.replace("\\ "," ")),i=r.shift();this.editor={args:r,bin:i}}createTemporaryFile(){try{let t=this.fileOptions.dir??j4p.default.tmpdir(),r=(0,w4p.randomUUID)(),i=m4p(this.fileOptions.prefix),n=m4p(this.fileOptions.postfix),a=`${i}${r}${n}`,o=Zmo.default.resolve(t,a),c=Zmo.default.resolve(t)+Zmo.default.sep;if(!o.startsWith(c))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let f={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(f.mode=this.fileOptions.mode),(0,aTn.writeFileSync)(this.tempFile,this.text,f)}catch(t){throw new $mo(t)}}readTemporaryFile(){try{let t=(0,aTn.readFileSync)(this.tempFile);if(t.length===0)this.text="";else{let r=(0,P4p.detect)(t)??"utf8";PGs.default.encodingExists(r)||(r="utf8"),this.text=PGs.default.decode(t,r)}}catch(t){throw new Ymo(t)}}removeTemporaryFile(){try{(0,aTn.unlinkSync)(this.tempFile)}catch(t){throw new Xmo(t)}}launchEditor(){try{let t=(0,kmo.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=t.status??0}catch(t){throw new Jga(t)}}launchEditorAsync(t){try{(0,kmo.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",i=>{this.lastExitStatus=i,setImmediate(t)})}catch(r){throw new Jga(r)}}};var E4p=ue(Z_e(),1);var $ga=class extends b1{_run(t){this.done=t,this.editorResult=new E4p.Subject;let r=CQ(this.rl);this.lineSubscription=r.line.subscribe(this.startExternalEditor.bind(this));let i=this.opt.waitUserInput===void 0?!0:this.opt.waitUserInput,n=this.handleSubmitEvents(this.editorResult);return n.success.forEach(this.onEnd.bind(this)),n.error.forEach(this.onError.bind(this)),this.currentText=this.opt.default,this.opt.default=null,i?this.render():this.startExternalEditor(),this}render(t){let r="",i=this.getQuestion();i+=this.status==="answered"?t0o.default.dim("Received"):t0o.default.dim("Press <enter> to launch your preferred editor."),t&&(r=t0o.default.red(">> ")+t),this.screen.render(i,r)}startExternalEditor(){this.rl.pause(),e0o(this.currentText,this.endExternalEditor.bind(this),{postfix:this.opt.postfix??".txt"})}endExternalEditor(t,r){this.rl.resume(),t?this.editorResult.error(t):this.editorResult.next(r)}onEnd(t){this.editorResult.unsubscribe(),this.lineSubscription.unsubscribe(),this.answer=t.value,this.status="answered",this.render(),this.screen.done(),this.done(this.answer)}onError(t){this.render(t.isValid)}};var I4p=require("stream");var D4p=ue(require("readline"),1),B4p=ue(M4p(),1),L7i=class{constructor(t){this.rl||=D4p.default.createInterface(XvS(t)),this.rl.resume(),this.onForceClose=this.onForceClose.bind(this),process.on("exit",this.onForceClose),this.rl.on("SIGINT",this.onForceClose)}onForceClose(){this.close(),process.kill(process.pid,"SIGINT"),console.log("")}close(){this.rl.removeListener("SIGINT",this.onForceClose),process.removeListener("exit",this.onForceClose),this.rl.output.unmute(),this.activePrompt&&typeof this.activePrompt.close=="function"&&this.activePrompt.close(),this.rl.output.end(),this.rl.pause(),this.rl.close()}};function XvS(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let t=e.input||process.stdin;if(!e.skipTTYChecks&&!t.isTTY){let n=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw n.isTtyError=!0,n}let r=new B4p.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var Yga=class extends L7i{constructor(t={}){super(t),this.log=new I4p.Writable({write:(r,i,n)=>{this.writeLog(r),n()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return qga(this.rl,this.bottomBar.split(`
1148
1148
  `).length),this}updateBottomBar(t){return qga(this.rl,1),this.rl.output.unmute(),this.clean(),this.bottomBar=t,this.render(),this.rl.output.mute(),this}writeLog(t){return this.rl.output.unmute(),this.clean(),this.rl.output.write(this.enforceLF(t.toString())),this.render(),this.rl.output.mute(),this}enforceLF(t){return/[\n\r]$/.test(t)?t:t+`
1149
1149
  `}write(t){let r=t.split(/\n/);this.height=r.length,this.rl.setPrompt(r.at(-1)),this.rl.output.rows===0&&this.rl.output.columns===0&&Pmo(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var pO=ue(Z_e(),1),T4p=ue(ega(),1);var r0o=ue(Z_e(),1),C4p=ue(ega(),1),i0o=function(e,t,r){return typeof e[t]!="function"?(0,r0o.of)(e):(0,r0o.from)((0,C4p.default)(e[t])(r).then(i=>(e[t]=i,e)))};var q4p={set:(e,t="",r)=>{let i=e;t.split(".").forEach((n,a,o)=>{n==="__proto__"||n==="constructor"||(a===o.length-1?i[n]=r:(!(n in i)||typeof i[n]!="object")&&(i[n]={}),i=i[n])})},get:(e,t="",r)=>{let i=a=>String.prototype.split.call(t,a).filter(Boolean).reduce((o,c)=>o!=null?o[c]:o,e),n=i(/[,[\]]+?/)||i(/[,.[\]]+?/);return n===void 0||n===e?r:n}},oTn=class extends L7i{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=typeof r=="object"?{...r}:{};let i;return Array.isArray(t)?i=(0,pO.from)(t):(0,pO.isObservable)(t)?i=t:Object.values(t).every(n=>typeof n=="object"&&!Array.isArray(n)&&n!=null)?i=(0,pO.from)(Object.entries(t).map(([n,a])=>({name:n,...a}))):i=(0,pO.from)([t]),this.process=i.pipe((0,pO.concatMap)(this.processQuestion.bind(this)),(0,pO.publish)()),this.process.connect(),this.process.pipe((0,pO.reduce)((n,a)=>(q4p.set(n,a.name,a.answer),n),this.answers)).toPromise(Promise).then(this.onCompletion.bind(this),this.onError.bind(this))}onCompletion(){return this.close(),this.answers}onError(t){return this.close(),Promise.reject(t)}processQuestion(t){return t={...t},(0,pO.defer)(()=>(0,pO.of)(t).pipe((0,pO.concatMap)(this.setDefaultType.bind(this)),(0,pO.concatMap)(this.filterIfRunnable.bind(this)),(0,pO.concatMap)(()=>i0o(t,"message",this.answers)),(0,pO.concatMap)(()=>i0o(t,"default",this.answers)),(0,pO.concatMap)(()=>i0o(t,"choices",this.answers)),(0,pO.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,pO.defer)(()=>(0,pO.from)(this.activePrompt.run().then(i=>({name:t.name,answer:i}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,pO.defer)(()=>(0,pO.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&q4p.get(this.answers,t.name)!==void 0)return pO.EMPTY;if(t.when===!1)return pO.EMPTY;if(typeof t.when!="function")return(0,pO.of)(t);let{answers:r}=this;return(0,pO.defer)(()=>(0,pO.from)((0,T4p.default)(t.when)(r).then(i=>{if(i)return t})).pipe((0,pO.filter)(i=>i!=null)))}};function R4p(e){let t=function(r,i){let n;try{n=new oTn(t.prompts,e)}catch(o){return Promise.reject(o)}let a=n.run(r,i);return a.ui=n,a};return t.prompts={},t.registerPrompt=function(r,i){return t.prompts[r]=i,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",Rga),this.registerPrompt("input",z7i),this.registerPrompt("number",zga),this.registerPrompt("confirm",Nga),this.registerPrompt("rawlist",Fga),this.registerPrompt("expand",Qga),this.registerPrompt("checkbox",Uga),this.registerPrompt("password",Lga),this.registerPrompt("editor",$ga)},t.restoreDefaultPrompts(),t}var EGs=R4p();function kvS(e,t){EGs.registerPrompt(e,t)}function egS(){EGs.restoreDefaultPrompts()}var tgS={prompt:EGs,ui:{BottomBar:Yga,Prompt:oTn},createPromptModule:R4p,registerPrompt:kvS,restoreDefaultPrompts:egS,Separator:jH},n0o=tgS;var gTn=require("path"),_3p=require("fs"),h3p=require("readline"),QLp="posthog-node";function MAS(e,{organization:t,projectId:r,prefix:i,severityAllowList:n=["error"]}={}){return a=>{if(!(n==="*"||n.includes(a.level)))return a;a.tags||(a.tags={});let c=a.tags[j0o.POSTHOG_ID_TAG];if(c===void 0)return a;let f=e.options.host??"https://us.i.posthog.com",s=new URL(`/project/${e.apiKey}/person/${c}`,f).toString();a.tags["PostHog Person URL"]=s;let u=a.exception?.values||[],l=u.map(_=>({..._,stacktrace:_.stacktrace?{..._.stacktrace,type:"raw",frames:(_.stacktrace.frames||[]).map(h=>({...h,platform:"node:javascript"}))}:void 0})),p={$exception_message:u[0]?.value||a.message,$exception_type:u[0]?.type,$exception_personURL:s,$exception_level:a.level,$exception_list:l,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:u[0]?.value||a.message,$sentry_exception_type:u[0]?.type,$sentry_tags:a.tags};return t&&r&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),e.capture({event:"$exception",distinctId:c,properties:p}),a}}var j0o=class{constructor(t,r,i,n){this.name=QLp,this.name=QLp,this.setupOnce=function(a,o){let c=o()?.getClient()?.getDsn()?.projectId;a(MAS(t,{organization:r,projectId:c,prefix:i,severityAllowList:n}))}}};j0o.POSTHOG_ID_TAG="posthog_distinct_id";var g0o="0123456789abcdef",w0o=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new e(t)}static fromFieldsV7(t,r,i,n){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||t<0||r<0||i<0||n<0||t>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");let a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|r>>>8,a[7]=r,a[8]=128|i>>>24,a[9]=i>>>16,a[10]=i>>>8,a[11]=i,a[12]=n>>>24,a[13]=n>>>16,a[14]=n>>>8,a[15]=n,new e(a)}static parse(t){let r;switch(t.length){case 32:r=/^[0-9a-f]{32}$/i.exec(t)?.[0];break;case 36:r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break;case 38:r=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t)?.slice(1,6).join("");break;case 45:r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t)?.slice(1,6).join("");break}if(r){let i=new Uint8Array(16);for(let n=0;n<16;n+=4){let a=parseInt(r.substring(2*n,2*n+8),16);i[n+0]=a>>>24,i[n+1]=a>>>16,i[n+2]=a>>>8,i[n+3]=a}return new e(i)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=g0o.charAt(this.bytes[r]>>>4),t+=g0o.charAt(this.bytes[r]&15),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=g0o.charAt(this.bytes[r]>>>4),t+=g0o.charAt(this.bytes[r]&15);return t}toJSON(){return this.toString()}getVariant(){let t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(r=>r===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(r=>r===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let r=0;r<16;r++){let i=this.bytes[r]-t.bytes[r];if(i!==0)return Math.sign(i)}return 0}},l7s=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??DAS()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,r){let i=this.generateOrAbortCore(t,r);return i===void 0&&(this.timestamp=0,i=this.generateOrAbortCore(t,r)),i}generateOrAbortCore(t,r){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(r<0||r>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else if(t+r>=this.timestamp)this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter());else return;return w0o.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,w0o.ofInner(t)}},DAS=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),ULp,f7s=()=>BAS().toString(),BAS=()=>(ULp||(ULp=new l7s)).generate();function IAS(e,t){let r=!1;return Object.assign(i=>{let a=global.process.listeners("uncaughtException").filter(o=>o.name!=="domainUncaughtExceptionClear"&&o._posthogErrorHandler!==!0).length===0;e(i,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t())},{_posthogErrorHandler:!0})}function CAS(e,t){global.process.on("uncaughtException",IAS(e,t))}function qAS(e){global.process.on("unhandledRejection",t=>{e(t,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var O0o,LLp,A0o;function TAS(e){let t=globalThis._posthogChunkIds;if(!t)return console.error("No chunk id map found"),{};let r=Object.keys(t);return A0o&&r.length===LLp||(LLp=r.length,A0o=r.reduce((i,n)=>{O0o||(O0o={});let a=O0o[n];if(a)i[a[0]]=a[1];else{let o=e(n);for(let c=o.length-1;c>=0;c--){let s=o[c]?.filename,u=t[n];if(s&&u){i[s]=u,O0o[n]=[s,u];break}}}return i},{})),A0o}function RAS(e){return typeof Event<"u"&&y3p(e,Event)}function zAS(e){return b3p(e,"Object")}function g7s(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return y3p(e,Error)}}function y3p(e,t){try{return e instanceof t}catch{return!1}}function NAS(e){return b3p(e,"ErrorEvent")}function b3p(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}async function FAS(e,t,r,i){let a=i&&i.mechanism||{handled:!0,type:"generic"},o=v3p(a,r,i);return{$exception_list:await Promise.all(o.map(async s=>{let u=await GAS(e,t,s);return u.value=u.value||"",u.type=u.type||"Error",u.mechanism=a,u}))}}function v3p(e,t,r){let i=QAS(e,t,r);return i.cause?[i,...v3p(e,i.cause,r)]:[i]}function QAS(e,t,r){if(g7s(t))return t;if(e.synthetic=!0,zAS(t)){let n=UAS(t);if(n)return n;let a=LAS(t),o=r?.syntheticException||new Error(a);return o.message=a,o}let i=r?.syntheticException||new Error(t);return i.message=`${t}`,i}function UAS(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(g7s(r))return r}}function LAS(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message '${e.message}'`),i}else if("message"in e&&typeof e.message=="string")return e.message;let t=WAS(e);if(NAS(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=VAS(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function VAS(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function WAS(e,t=40){let r=Object.keys(xAS(e));r.sort();let i=r[0];if(!i)return"[object has no keys]";if(i.length>=t)return VLp(i,t);for(let n=r.length;n>0;n--){let a=r.slice(0,n).join(", ");if(!(a.length>t))return n===r.length?a:VLp(a,t)}return""}function VLp(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function xAS(e){return g7s(e)?{message:e.message,name:e.name,stack:e.stack,...WLp(e)}:RAS(e)?{type:e.type,target:xLp(e.target),currentTarget:xLp(e.currentTarget),...WLp(e)}:e}function WLp(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function xLp(e){try{return Object.prototype.toString.call(e)}catch{return"<unknown>"}}async function GAS(e,t,r){let i={type:r.name||r.constructor.name,value:r.message},n=HAS(e,r);for(let a of t)n=await a(n);return n.length&&(i.stacktrace={frames:n,type:"raw"}),i}function HAS(e,t){return KAS(e(t.stack||"",1),e)}function KAS(e,t){let r=TAS(t);return e.forEach(i=>{i.filename&&(i.chunk_id=r[i.filename])}),e}var JAS=2e3,yTn=class e{static async captureException(t,r,i,n,a){let o={...a};n||(o.$process_person_profile=!1);let c=await FAS(this.stackParser,this.frameModifiers,r,i);t.capture({event:"$exception",distinctId:n||f7s(),properties:{...c,...o}})}constructor(t,r){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this.startAutocaptureIfEnabled()}startAutocaptureIfEnabled(){this.isEnabled()&&(CAS(this.onException.bind(this),this.onFatalError.bind(this)),qAS(this.onException.bind(this)))}onException(t,r){e.captureException(this.client,t,r)}async onFatalError(){await this.client.shutdown(JAS)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}};function $AS(e=process.argv[1]?(0,gTn.dirname)(process.argv[1]):process.cwd(),t=gTn.sep==="\\"){let r=t?GLp(e):e;return i=>{if(!i)return;let n=t?GLp(i):i,{dir:a,base:o,ext:c}=gTn.posix.parse(n);(c===".js"||c===".mjs"||c===".cjs")&&(o=o.slice(0,c.length*-1));let f=decodeURIComponent(o);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${f}`;if(a.startsWith(r)){let u=a.slice(r.length+1).replace(/\//g,".");return u?`${u}:${f}`:f}return f}}function GLp(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var E0o=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}},P0o=new E0o(25),g3p=new E0o(20),O7s=7,YAS=1e3,XAS=1e4;async function ZAS(e){let t={};for(let n=e.length-1;n>=0;n--){let a=e[n],o=a?.filename;if(!a||typeof o!="string"||typeof a.lineno!="number"||rmS(o)||imS(a))continue;t[o]||(t[o]=[]),t[o].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let i=[];for(let n of r){if(g3p.get(n))continue;let a=t[n];if(!a)continue;a.sort((f,s)=>f-s);let o=amS(a);if(o.every(f=>nmS(n,f)))continue;let c=omS(P0o,n,{});i.push(kAS(n,o,c))}return await Promise.all(i).catch(()=>{}),e&&e.length>0&&emS(e,P0o),P0o.reduce(),e}function kAS(e,t,r){return new Promise(i=>{let n=(0,_3p.createReadStream)(e),a=(0,h3p.createInterface)({input:n});function o(){n.destroy(),i()}let c=0,f=0,s=t[f];if(s===void 0){o();return}let u=s[0],l=s[1];function p(){g3p.set(e,1),a.close(),a.removeAllListeners(),o()}n.on("error",p),a.on("error",p),a.on("close",o),a.on("line",_=>{if(c++,!(c<u)&&(r[c]=umS(_,0),c>=l)){if(f===t.length-1){a.close(),a.removeAllListeners();return}f++;let h=t[f];if(h===void 0){a.close(),a.removeAllListeners();return}u=h[0],l=h[1]}})})}function emS(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let i=t.get(r.filename);if(i===void 0)continue;tmS(r.lineno,r,i)}}function tmS(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let n=O3p(e);n<e;n++){let a=r[n];if(a===void 0){HLp(t);return}t.pre_context.push(a)}if(r[e]===void 0){HLp(t);return}t.context_line=r[e];let i=A3p(e);t.post_context=[];for(let n=e+1;n<=i;n++){let a=r[n];if(a===void 0)break;t.post_context.push(a)}}function HLp(e){delete e.pre_context,delete e.context_line,delete e.post_context}function rmS(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function imS(e){return e.lineno!==void 0&&e.lineno>XAS||e.colno!==void 0&&e.colno>YAS}function nmS(e,t){let r=P0o.get(e);if(r===void 0)return!1;for(let i=t[0];i<=t[1];i++)if(r[i]===void 0)return!1;return!0}function amS(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let i=KLp(r),n=[];for(;;){if(t===e.length-1){n.push(i);break}let a=e[t+1];if(typeof a!="number")break;a<=i[1]?i[1]=a+O7s:(n.push(i),i=KLp(a)),t++}return n}function KLp(e){return[O3p(e),A3p(e)]}function O3p(e){return Math.max(1,e-O7s)}function A3p(e){return e+O7s}function omS(e,t,r){let i=e.get(t);return i===void 0?(e.set(t,r),r):i}function umS(e,t){let r=e,i=r.length;if(i<=150)return r;t>i&&(t=i);let n=Math.max(t-60,0);n<5&&(n=0);let a=Math.min(n+140,i);return a>i-5&&(a=i),a===i&&(n=Math.max(a-140,0)),r=r.slice(n,a),n>0&&(r=`...${r}`),a<i&&(r+="..."),r}var smS="4.18.0",DH;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.DecideEndpointWasHit="decide_endpoint_was_hit",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config"})(DH||(DH={}));var JLp;(function(e){e.Left="left",e.Right="right",e.Center="center"})(JLp||(JLp={}));var $Lp;(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})($Lp||($Lp={}));var YLp;(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})(YLp||(YLp={}));var XLp;(function(e){e.Html="html",e.Text="text"})(XLp||(XLp={}));var ZLp;(function(e){e.Number="number",e.Emoji="emoji"})(ZLp||(ZLp={}));var kLp;(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(kLp||(kLp={}));var e3p;(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(e3p||(e3p={}));var t3p;(function(e){e.Regex="regex",e.NotRegex="not_regex",e.Exact="exact",e.IsNot="is_not",e.Icontains="icontains",e.NotIcontains="not_icontains"})(t3p||(t3p={}));var r3p;(function(e){e.Contains="contains",e.Exact="exact",e.Regex="regex"})(r3p||(r3p={}));var cmS=e=>{if("flags"in e){let t=fmS(e.flags),r=dmS(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}else{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([n,a])=>[n,m3p(a)])),i=Object.fromEntries(Object.entries(t).map(([n,a])=>[n,lmS(n,a,r[n])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:i}}};function lmS(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var fmS=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,A7s(r)]).filter(([,t])=>t!==void 0)),dmS=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let i=t[r];return i.enabled&&i.metadata&&i.metadata.payload!==void 0}).map(r=>{let i=t[r].metadata?.payload;return[r,i?m3p(i):void 0]}))},A7s=e=>e===void 0?void 0:e.variant??e.enabled,m3p=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},pmS=1,_mS=new Set(["61be3dd8","96f6df5f","8cfdba9b","bf027177","e59430a8","7fa5500b","569798e9","04809ff7","0ebc61a5","32de7f98","3beeb69a","12d34ad9","733853ec","0645bb64","5dcbee21","b1f95fa3","2189e408","82b460c2","3a8cc979","29ef8843","2cdbf767","38084b54","50f9f8de","41d0df91","5c236689","c11aedd3","ada46672","f4331ee1","42fed62a","c957462c","d62f705a","e0162666","01b3e5cf","441cef7f","bb9cafee","8f348eb0","b2553f3a","97469d7d","39f21a76","03706dcc","27d50569","307584a7","6433e92e","150c7fbb","49f57f22","3772f65b","01eb8256","3c9e9234","f853c7f7","c0ac4b67","cd609d40","10ca9b1a","8a87f11b","8e8e5216","1f6b63b3","db7943dd","79b7164c","07f78e33","2d21b6fd","952db5ee","a7d3b43f","1924dd9c","84e1b8f6","dff631b6","c5aa8a79","fa133a95","498a4508","24748755","98f3d658","21bbda67","7dbfed69","be3ec24c","fc80b8e2","75cc0998"]),hmS="utf8";function ymS(e,t){if(!e||typeof e!="string"||bmS(e))throw new Error(t)}function bmS(e){return e.trim().length===0}function vmS(e){return e?.replace(/\/+$/,"")}async function gmS(e,t){let r=null;for(let i=0;i<t.retryCount+1;i++){i>0&&await new Promise(n=>setTimeout(n,t.retryDelay));try{return await e()}catch(n){if(r=n,!t.retryCheck(n))throw n}}throw r}function i3p(){return new Date().getTime()}function s7s(){return new Date().toISOString()}function S0o(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}function OmS(){return typeof fetch<"u"?fetch:typeof globalThis.fetch<"u"?globalThis.fetch:void 0}function AmS(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return(t>>>0).toString(16).padStart(8,"0")}function mmS(e,t=0,r){let i=AmS(e);return r?.has(i)?!1:parseInt(i,16)/4294967295<t}function n3p(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var oOa=String.fromCharCode,a3p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m0o={};function PmS(e,t){if(!m0o[e]){m0o[e]={};for(let r=0;r<e.length;r++)m0o[e][e.charAt(r)]=r}return m0o[e][t]}var _Tn={compressToBase64:function(e){if(e==null)return"";let t=_Tn._compress(e,6,function(r){return a3p.charAt(r)});switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return e==null?"":e==""?null:_Tn._decompress(e.length,32,function(t){return PmS(a3p,e.charAt(t))})},compress:function(e){return _Tn._compress(e,16,function(t){return oOa(t)})},_compress:function(e,t,r){if(e==null)return"";let i={},n={},a=[],o,c,f="",s="",u="",l=2,p=3,_=2,h=0,y=0,b;for(b=0;b<e.length;b+=1)if(f=e.charAt(b),Object.prototype.hasOwnProperty.call(i,f)||(i[f]=p++,n[f]=!0),s=u+f,Object.prototype.hasOwnProperty.call(i,s))u=s;else{if(Object.prototype.hasOwnProperty.call(n,u)){if(u.charCodeAt(0)<256){for(o=0;o<_;o++)h=h<<1,y==t-1?(y=0,a.push(r(h)),h=0):y++;for(c=u.charCodeAt(0),o=0;o<8;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1}else{for(c=1,o=0;o<_;o++)h=h<<1|c,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1}l--,l==0&&(l=Math.pow(2,_),_++),delete n[u]}else for(c=i[u],o=0;o<_;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1;l--,l==0&&(l=Math.pow(2,_),_++),i[s]=p++,u=String(f)}if(u!==""){if(Object.prototype.hasOwnProperty.call(n,u)){if(u.charCodeAt(0)<256){for(o=0;o<_;o++)h=h<<1,y==t-1?(y=0,a.push(r(h)),h=0):y++;for(c=u.charCodeAt(0),o=0;o<8;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1}else{for(c=1,o=0;o<_;o++)h=h<<1|c,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1}l--,l==0&&(l=Math.pow(2,_),_++),delete n[u]}else for(c=i[u],o=0;o<_;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1;l--,l==0&&(l=Math.pow(2,_),_++)}for(c=2,o=0;o<_;o++)h=h<<1|c&1,y==t-1?(y=0,a.push(r(h)),h=0):y++,c=c>>1;for(;;)if(h=h<<1,y==t-1){a.push(r(h));break}else y++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:_Tn._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(e,t,r){let i=[],n=[],a={val:r(0),position:t,index:1},o=4,c=4,f=3,s="",u,l,p,_,h,y,b;for(u=0;u<3;u+=1)i[u]=u;for(p=0,h=Math.pow(2,2),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;switch(p){case 0:for(p=0,h=Math.pow(2,8),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;b=oOa(p);break;case 1:for(p=0,h=Math.pow(2,16),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;b=oOa(p);break;case 2:return""}for(i[3]=b,l=b,n.push(b);;){if(a.index>e)return"";for(p=0,h=Math.pow(2,f),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;switch(b=p){case 0:for(p=0,h=Math.pow(2,8),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;i[c++]=oOa(p),b=c-1,o--;break;case 1:for(p=0,h=Math.pow(2,16),y=1;y!=h;)_=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),p|=(_>0?1:0)*y,y<<=1;i[c++]=oOa(p),b=c-1,o--;break;case 2:return n.join("")}if(o==0&&(o=Math.pow(2,f),f++),i[b])s=i[b];else if(b===c)s=l+l.charAt(0);else return null;n.push(s),i[c++]=l+s.charAt(0),o--,l=s,o==0&&(o=Math.pow(2,f),f++)}}},d7s=class{constructor(){this.events={},this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),()=>{this.events[t]=this.events[t].filter(i=>i!==r)}}emit(t,r){for(let i of this.events[t]||[])i(r);for(let i of this.events["*"]||[])i(t,r)}},bTn=class extends Error{constructor(t,r){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}},uOa=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function o3p(e){if(e instanceof bTn){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function c7s(e){return typeof e=="object"&&(e instanceof bTn||e instanceof uOa)}function u3p(e){return typeof e=="object"&&e instanceof bTn&&e.status===413}var p7s;(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(p7s||(p7s={}));var _7s=class{constructor(t,r){this.flushPromise=null,this.shutdownPromise=null,this.pendingPromises={},this._events=new d7s,this._isInitialized=!1,ymS(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=vmS(r?.host||"https://us.i.posthog.com"),this.flushAt=r?.flushAt?Math.max(r?.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r?.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r?.maxQueueSize??1e3),this.flushInterval=r?.flushInterval??1e4,this.captureMode=r?.captureMode||"json",this.preloadFeatureFlags=r?.preloadFeatureFlags??!0,this.defaultOptIn=r?.defaultOptIn??!0,this.disableSurveys=r?.disableSurveys??!1,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:c7s},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=r?.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r?.disableGeoip??!0,this.disabled=r?.disabled??!1,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(DH.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(DH.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(DH.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(i,n)=>console.log("PostHog Debug",i,n));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=f7s();return this.pendingPromises[r]=t,t.catch(()=>{}).finally(()=>{delete this.pendingPromises[r]}),t}identifyStateless(t,r,i){this.wrap(()=>{let n={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",n,i)})}async identifyStatelessImmediate(t,r,i){let n={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",n,i)}captureStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:i});this.enqueue("capture",a,n)})}async captureStatelessImmediate(t,r,i,n){let a=this.buildPayload({distinct_id:t,event:r,properties:i});await this.sendImmediate("capture",a,n)}aliasStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...i||{},distinct_id:r,alias:t}});this.enqueue("alias",a,n)})}async aliasStatelessImmediate(t,r,i,n){let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...i||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",a,n)}groupIdentifyStateless(t,r,i,n,a,o){this.wrap(()=>{let c=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:i||{},...o||{}}});this.enqueue("capture",c,n)})}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,i={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,i,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(n=>n.json()).catch(n=>{this.logMsgIfDebug(()=>console.error("Remote config could not be loaded",n)),this._events.emit("error",n)})}async getDecide(t,r={},i={},n={},a={}){await this._initPromise;let c=mmS(this.apiKey,pmS,_mS)?`${this.host}/flags/?v=2`:`${this.host}/decide/?v=4`,f={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify({token:this.apiKey,distinct_id:t,groups:r,person_properties:i,group_properties:n,...a})};return this.logMsgIfDebug(()=>console.log("PostHog Debug","Decide URL",c)),this.fetchWithRetry(c,f,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(s=>s.json()).then(s=>cmS(s)).catch(s=>{this._events.emit("error",s)})}async getFeatureFlagStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailStateless(t,r,i,n,a,o);if(c===void 0)return{response:void 0,requestId:void 0};let f=A7s(c.response);return f===void 0&&(f=!1),{response:f,requestId:c.requestId}}async getFeatureFlagDetailStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(r,i,n,a,o,[t]);return c===void 0?void 0:{response:c.flags[t],requestId:c.requestId}}async getFeatureFlagPayloadStateless(t,r,i={},n={},a={},o){await this._initPromise;let c=await this.getFeatureFlagPayloadsStateless(r,i,n,a,o,[t]);if(!c)return;let f=c[t];return f===void 0?null:f}async getFeatureFlagPayloadsStateless(t,r={},i={},n={},a,o){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,o)).payloads}async getFeatureFlagsStateless(t,r={},i={},n={},a,o){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a,o)}async getFeatureFlagsAndPayloadsStateless(t,r={},i={},n={},a,o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(t,r,i,n,a,o);return c?{flags:c.featureFlags,payloads:c.featureFlagPayloads,requestId:c.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},i={},n={},a,o){await this._initPromise;let c={};(a??this.disableGeoip)&&(c.geoip_disable=!0),o&&(c.flag_keys_to_evaluate=o);let f=await this.getDecide(t,r,i,n,c);if(f!==void 0)return f.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),f.quotaLimited?.includes(p7s.FeatureFlags)?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:f?.requestId}):f}async getSurveysStateless(){if(await this._initPromise,this.disableSurveys===!0)return this.logMsgIfDebug(()=>console.log("PostHog Debug","Loading surveys is disabled.")),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},n=(await this.fetchWithRetry(t,r).then(a=>{if(a.status!==200||!a.json){let o=`Surveys API could not be loaded: ${a.status}`,c=new Error(o);this.logMsgIfDebug(()=>console.error(c)),this._events.emit("error",new Error(o));return}return a.json()}).catch(a=>{this.logMsgIfDebug(()=>console.error("Surveys API could not be loaded",a)),this._events.emit("error",a)}))?.surveys;return n&&this.logMsgIfDebug(()=>console.log("PostHog Debug","Surveys fetched from API: ",JSON.stringify(n))),n??[]}get props(){return this._props||(this._props=this.getPersistedProperty(DH.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(DH.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(DH.Props,this.props)})}enqueue(t,r,i){this.wrap(()=>{if(this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let n=this.prepareMessage(t,r,i),a=this.getPersistedProperty(DH.Queue)||[];a.length>=this.maxQueueSize&&(a.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),a.push({message:n}),this.setPersistedProperty(DH.Queue,a),this._events.emit(t,n),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=S0o(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,i){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized||await this._initPromise,this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let n={api_key:this.apiKey,batch:[this.prepareMessage(t,r,i)],sent_at:s7s()};this.historicalMigration&&(n.historical_migration=!0);let a=JSON.stringify(n),o=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${i3p()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,c=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(_Tn.compressToBase64(a))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:a};try{await this.fetchWithRetry(o,c)}catch(f){this._events.emit("error",f)}}prepareMessage(t,r,i){let n={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:i?.timestamp?i?.timestamp:s7s(),uuid:i?.uuid?i.uuid:f7s()};return(i?.disableGeoip??this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async t=>{await o3p(t)})}async flush(){let t=n3p([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),n3p([t]).then(()=>{this.flushPromise===t&&(this.flushPromise=null)}),t}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getPersistedProperty(DH.Queue)||[];if(!t.length)return;let r=[],i=t.length;for(;t.length>0&&r.length<i;){let n=t.slice(0,this.maxBatchSize),a=n.map(p=>p.message),o=()=>{let _=(this.getPersistedProperty(DH.Queue)||[]).slice(n.length);this.setPersistedProperty(DH.Queue,_),t=_},c={api_key:this.apiKey,batch:a,sent_at:s7s()};this.historicalMigration&&(c.historical_migration=!0);let f=JSON.stringify(c),s=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${i3p()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,u=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(_Tn.compressToBase64(f))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:f},l={retryCheck:p=>u3p(p)?!1:c7s(p)};try{await this.fetchWithRetry(s,u,l)}catch(p){if(u3p(p)&&a.length>1){this.maxBatchSize=Math.max(1,Math.floor(a.length/2)),this.logMsgIfDebug(()=>console.warn(`Received 413 when sending batch of size ${a.length}, reducing batch size to ${this.maxBatchSize}`));continue}throw p instanceof uOa||o(),this._events.emit("error",p),p}o(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,i,n){var a;(a=AbortSignal).timeout??(a.timeout=function(s){let u=new AbortController;return setTimeout(()=>u.abort(),s),u.signal});let o=r.body?r.body:"",c=-1;try{c=Buffer.byteLength(o,hmS)}catch{c=new TextEncoder().encode(o).length}return await gmS(async()=>{let f=null;try{f=await this.fetch(t,{signal:AbortSignal.timeout(n??this.requestTimeout),...r})}catch(u){throw new uOa(u)}if(!(r.mode==="no-cors")&&(f.status<200||f.status>=400))throw new bTn(f,c);return f},{...this._retryOptions,...i})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let i=async()=>{try{for(await Promise.all(Object.values(this.pendingPromises));!((this.getPersistedProperty(DH.Queue)||[]).length===0||(await this.flush(),r)););}catch(n){if(!c7s(n))throw n;await o3p(n)}};return Promise.race([new Promise((n,a)=>{S0o(()=>{this.logMsgIfDebug(()=>console.error("Timed out while shutting down PostHog")),r=!0,a("Timeout while shutting down PostHog. Some events may not have been sent.")},t)}),i()])}async shutdown(t=3e4){return this.shutdownPromise?this.logMsgIfDebug(()=>console.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup")):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}},h7s=OmS();if(!h7s){let e=FLp();h7s=async(t,r)=>{let i=await e.request({url:t,headers:r.headers,method:r.method.toLowerCase(),data:r.body,signal:r.signal,validateStatus:()=>!0});return{status:i.status,text:async()=>i.data,json:async()=>i.data}}}var P3p=h7s,M0o=class{constructor(t){this.factory=t}async getValue(){return this.value!==void 0?this.value:(this.initializationPromise===void 0&&(this.initializationPromise=(async()=>{try{let t=await this.factory();return this.value=t,t}finally{this.initializationPromise=void 0}})()),this.initializationPromise)}isInitialized(){return this.value!==void 0}async waitForInitialization(){this.isInitialized()||await this.getValue()}},j3p=new M0o(async()=>{try{return await import("crypto")}catch{return}});async function jmS(){return await j3p.getValue()}var wmS=new M0o(async()=>{if(typeof globalThis.crypto?.subtle<"u")return globalThis.crypto.subtle;try{let e=await j3p.getValue();if(e?.webcrypto?.subtle)return e.webcrypto.subtle}catch{}});async function EmS(){return await wmS.getValue()}async function SmS(e){let t=await jmS();if(t)return t.createHash("sha1").update(e).digest("hex");let r=await EmS();if(r){let i=await r.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(i)).map(a=>a.toString(16).padStart(2,"0")).join("")}throw new Error("No crypto implementation available. Tried Node Crypto API and Web SubtleCrypto API")}var MmS=60*1e3,DmS=1152921504606847e3,BmS=["is_not"],hTn=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},v1=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},y7s=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:o,...c}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=n,this.projectApiKey=i,this.host=a,this.poller=void 0,this.fetch=c.fetch||P3p,this.onError=c.onError,this.customHeaders=o,this.onLoad=c.onLoad,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let o,c;if(!this.loadedSuccessfullyOnce)return o;for(let f of this.featureFlags)if(t===f.key){c=f;break}if(c!==void 0)try{o=await this.computeFlagLocally(c,r,i,n,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${o}`))}catch(f){f instanceof v1?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${f}`)):f instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${f}`))}return o}async computeFeatureFlagPayloadLocally(t,r){await this.loadFeatureFlags();let i;if(this.loadedSuccessfullyOnce){if(typeof r=="boolean"?i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]:typeof r=="string"&&(i=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]),i==null)return null;try{return JSON.parse(i)}catch{return i}}}async getAllFlagsAndPayloads(t,r={},i={},n={}){await this.loadFeatureFlags();let a={},o={},c=this.featureFlags.length==0;return await Promise.all(this.featureFlags.map(async f=>{try{let s=await this.computeFlagLocally(f,t,r,i,n);a[f.key]=s;let u=await this.computeFeatureFlagPayloadLocally(f.key,s);u&&(o[f.key]=u)}catch(s){s instanceof v1||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${f.key}: ${s}`)),c=!0}})),{response:a,payloads:o,fallbackToDecide:c}}async computeFlagLocally(t,r,i={},n={},a={}){if(t.ensure_experience_continuity)throw new v1("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let f=this.groupTypeMapping[String(c)];if(!f)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new v1("Flag has unknown group type index");if(!(f in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;let s=a[f];return await this.matchFeatureFlagProperties(t,i[f],s)}else return await this.matchFeatureFlagProperties(t,r,n)}async matchFeatureFlagProperties(t,r,i){let n=t.filters||{},a=n.groups||[],o=!1,c,f=[...a].sort((s,u)=>{let l=!!s.variant,p=!!u.variant;return l&&p?0:l?-1:p?1:0});for(let s of f)try{if(await this.isConditionMatch(t,r,s,i)){let u=s.variant,l=n.multivariate?.variants||[];u&&l.some(p=>p.key===u)?c=u:c=await this.getMatchingVariant(t,r)||!0;break}}catch(u){if(u instanceof v1)o=!0;else throw u}if(c!==void 0)return c;if(o)throw new v1("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,i,n){let a=i.rollout_percentage,o=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((i.properties||[]).length>0){for(let c of i.properties){let f=c.type,s=!1;if(f==="cohort"?s=E3p(c,n,this.cohorts,this.debugMode):s=w3p(c,n,o),!s)return!1}if(a==null)return!0}return!(a!=null&&await s3p(t.key,r)>a/100)}async getMatchingVariant(t,r){let i=await s3p(t.key,r,"variant"),n=this.variantLookupTable(t).find(a=>i>=a.valueMin&&i<a.valueMax);if(n)return n.key}variantLookupTable(t){let r=[],i=0,n=0;return((t.filters||{}).multivariate?.variants||[]).forEach(c=>{n=i+c.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:c.key}),i=n}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(MmS,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.getPollingInterval());try{let t=await this._requestFeatureFlagDefinitions();if(!t)return;switch(t.status){case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new hTn(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new hTn(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new hTn(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let r=await t.json()??{};if(!("flags"in r)){this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`));return}this.featureFlags=r.flags??[],this.featureFlagsByKey=this.featureFlags.reduce((i,n)=>(i[n.key]=n,i),{}),this.groupTypeMapping=r.group_type_mapping||{},this.cohorts=r.cohorts||{},this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof hTn&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET"){return{method:t,headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions(),i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=S0o(()=>{n.abort()},this.timeout),r.signal=n.signal}try{return await this.fetch(t,r)}finally{clearTimeout(i)}}stopPoller(){clearTimeout(this.poller)}_requestRemoteConfigPayload(t){let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config/`,i=this.getPersonalApiKeyRequestOptions(),n=null;if(this.timeout&&typeof this.timeout=="number"){let a=new AbortController;n=S0o(()=>{a.abort()},this.timeout),i.signal=a.signal}try{return this.fetch(r,i)}finally{clearTimeout(n)}}};async function s3p(e,t,r=""){let i=await SmS(`${e}.${t}${r}`);return parseInt(i.slice(0,15),16)/DmS}function w3p(e,t,r){let i=e.key,n=e.value,a=e.operator||"exact";if(i in t){if(a==="is_not_set")throw new v1("Operator is_not_set is not supported")}else throw new v1(`Property ${i} not found in propertyValues`);let o=t[i];if(o==null&&!BmS.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,u){return Array.isArray(s)?s.map(l=>String(l).toLowerCase()).includes(String(u).toLowerCase()):String(s).toLowerCase()===String(u).toLowerCase()}function f(s,u,l){if(l==="gt")return s>u;if(l==="gte")return s>=u;if(l==="lt")return s<u;if(l==="lte")return s<=u;throw new Error(`Invalid operator: ${l}`)}switch(a){case"exact":return c(n,o);case"is_not":return!c(n,o);case"is_set":return i in t;case"icontains":return String(o).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(o).toLowerCase().includes(String(n).toLowerCase());case"regex":return c3p(String(n))&&String(o).match(String(n))!==null;case"not_regex":return c3p(String(n))&&String(o).match(String(n))===null;case"gt":case"gte":case"lt":case"lte":{let s=typeof n=="number"?n:null;if(typeof n=="string")try{s=parseFloat(n)}catch{}return s!=null&&o!=null?typeof o=="string"?f(o,String(n),a):f(o,s,a):f(String(o),String(n),a)}case"is_date_after":case"is_date_before":{let s=ImS(String(n));if(s==null&&(s=l3p(n)),s==null)throw new v1(`Invalid date: ${n}`);let u=l3p(o);return["is_date_before"].includes(a)?u<s:u>s}default:throw new v1(`Unknown operator: ${a}`)}}function E3p(e,t,r,i=!1){let n=String(e.value);if(!(n in r))throw new v1("can't match cohort without a given cohort property value");let a=r[n];return S3p(a,t,r,i)}function S3p(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let o=!1;if("values"in a[0]){for(let c of a)try{let f=S3p(c,t,r,i);if(n==="AND"){if(!f)return!1}else if(f)return!0}catch(f){if(f instanceof v1)i&&console.debug(`Failed to compute property ${c} locally: ${f}`),o=!0;else throw f}if(o)throw new v1("Can't match cohort without a given cohort property value");return n==="AND"}else{for(let c of a)try{let f;c.type==="cohort"?f=E3p(c,t,r,i):f=w3p(c,t);let s=c.negation||!1;if(n==="AND"){if(!f&&!s||f&&s)return!1}else if(f&&!s||!f&&s)return!0}catch(f){if(f instanceof v1)i&&console.debug(`Failed to compute property ${c} locally: ${f}`),o=!0;else throw f}if(o)throw new v1("can't match cohort without a given cohort property value");return n==="AND"}}function c3p(e){try{return new RegExp(e),!0}catch{return!1}}function l3p(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new v1(`${e} is in an invalid date format`)}else throw new v1(`The date provided ${e} must be a string, number, or date object`)}function ImS(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),i=new Date(new Date().toISOString());if(r){if(!r.groups)return null;let n=parseInt(r.groups.number);if(n>=1e4)return null;let a=r.groups.interval;if(a=="h")i.setUTCHours(i.getUTCHours()-n);else if(a=="d")i.setUTCDate(i.getUTCDate()-n);else if(a=="w")i.setUTCDate(i.getUTCDate()-n*7);else if(a=="m")i.setUTCMonth(i.getUTCMonth()-n);else if(a=="y")i.setUTCFullYear(i.getUTCFullYear()-n);else return null;return i}else return null}var b7s=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},CmS=100,f3p=30*1e3,qmS=50*1e3,v7s=class extends _7s{constructor(t,r={}){if(super(t,r),this._memoryStorage=new b7s,this.options=r,this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,CmS):f3p,r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');this.featureFlagsPoller=new y7s({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},onLoad:i=>{this._events.emit("localEvaluationFlagsLoaded",i)},customHeaders:this.getCustomHeaders()})}this.errorTracking=new yTn(this,r),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||qmS}getPersistedProperty(t){return this._memoryStorage.getProperty(t)}setPersistedProperty(t,r){return this._memoryStorage.setProperty(t,r)}fetch(t,r){return this.options.fetch?this.options.fetch(t,r):P3p(t,r)}getLibraryVersion(){return smS}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:f,uuid:s}=t,u=_=>{super.captureStateless(r,i,_,{timestamp:c,disableGeoip:f,uuid:s})},l=async(_,h,y)=>(await super.getFeatureFlagsStateless(_,h,void 0,void 0,y)).flags,p=Promise.resolve().then(async()=>{if(o)return await l(r,a,f);if(i==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let _={};for(let[h,y]of Object.entries(a||{}))_[h]=String(y);return await this.getAllFlags(r,{groups:_,disableGeoip:f,onlyEvaluateLocally:!0})}return{}}).then(_=>{let h={};if(_)for(let[b,v]of Object.entries(_))h[`$feature/${b}`]=v;let y=Object.keys(_||{}).filter(b=>_?.[b]!==!1).sort();return y.length>0&&(h.$active_feature_flags=y),h}).catch(()=>({})).then(_=>{u({..._,...n,$groups:a})});this.addPendingPromise(p)}async captureImmediate(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:i,properties:n,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:f,uuid:s}=t,u=_=>super.captureStatelessImmediate(r,i,_,{timestamp:c,disableGeoip:f,uuid:s}),l=async(_,h,y)=>(await super.getFeatureFlagsStateless(_,h,void 0,void 0,y)).flags;await Promise.resolve().then(async()=>{if(o)return await l(r,a,f);if(i==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let _={};for(let[h,y]of Object.entries(a||{}))_[h]=String(y);return await this.getAllFlags(r,{groups:_,disableGeoip:f,onlyEvaluateLocally:!0})}return{}}).then(_=>{let h={};if(_)for(let[b,v]of Object.entries(_))h[`$feature/${b}`]=v;let y=Object.keys(_||{}).filter(b=>_?.[b]!==!1).sort();return y.length>0&&(h.$active_feature_flags=y),h}).catch(()=>({})).then(_=>{u({..._,...n,$groups:a})})}identify({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;super.identifyStateless(t,{$set:a,$set_once:n},{disableGeoip:i})}async identifyImmediate({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;await super.identifyStatelessImmediate(t,{$set:a,$set_once:n},{disableGeoip:i})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=f3p){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let i=setTimeout(()=>{n(),r(!1)},t),n=this._events.on("localEvaluationFlagsLoaded",a=>{clearTimeout(i),n(),r(a>0)})})}async getFeatureFlag(t,r,i){let{groups:n,disableGeoip:a}=i||{},{onlyEvaluateLocally:o,sendFeatureFlagEvents:c,personProperties:f,groupProperties:s}=i||{},u=this.addLocalPersonAndGroupProperties(r,n,f,s);f=u.allPersonProperties,s=u.allGroupProperties,o==null&&(o=!1),c==null&&(c=!0);let l=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,f,s),p=l!==void 0,_,h;if(!p&&!o){let b=await super.getFeatureFlagDetailStateless(t,r,n,f,s,a);if(b===void 0)return;h=b.response,l=A7s(h),_=b?.requestId}let y=`${t}_${l}`;return c&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(y))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(y):this.distinctIdHasSentFlagCalls[r]=[y],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:l,$feature_flag_id:h?.metadata?.id,$feature_flag_version:h?.metadata?.version,$feature_flag_reason:h?.reason?.description??h?.reason?.code,locally_evaluated:p,[`$feature/${t}`]:l,$feature_flag_request_id:_},groups:n,disableGeoip:a})),l}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:o}=n||{},{onlyEvaluateLocally:c,sendFeatureFlagEvents:f,personProperties:s,groupProperties:u}=n||{},l=this.addLocalPersonAndGroupProperties(r,a,s,u);s=l.allPersonProperties,u=l.allGroupProperties;let p;return this.featureFlagsPoller!==void 0&&(i||(i=await this.getFeatureFlag(t,r,{...n,onlyEvaluateLocally:!0,sendFeatureFlagEvents:!1})),i&&(p=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,i))),c==null&&(c=!1),f==null&&(f=!0),c==null&&(c=!1),!(p!==void 0)&&!c&&(p=await super.getFeatureFlagPayloadStateless(t,r,a,s,u,o)),p}async getRemoteConfigPayload(t){return(await this.featureFlagsPoller?._requestRemoteConfigPayload(t))?.json()}async isFeatureEnabled(t,r,i){let n=await this.getFeatureFlag(t,r,i);if(n!==void 0)return!!n||!1}async getAllFlags(t,r){return(await this.getAllFlagsAndPayloads(t,r)).featureFlags||{}}async getAllFlagsAndPayloads(t,r){let{groups:i,disableGeoip:n}=r||{},{onlyEvaluateLocally:a,personProperties:o,groupProperties:c}=r||{},f=this.addLocalPersonAndGroupProperties(t,i,o,c);o=f.allPersonProperties,c=f.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,o,c),u={},l={},p=!0;if(s&&(u=s.response,l=s.payloads,p=s.fallbackToDecide),p&&!a){let _=await super.getFeatureFlagsAndPayloadsStateless(t,i,o,c,n);u={...u,..._.flags||{}},l={...l,..._.payloads||{}}}return{featureFlags:u,featureFlagPayloads:l}}groupIdentify({groupType:t,groupKey:r,properties:i,distinctId:n,disableGeoip:a}){super.groupIdentifyStateless(t,r,i,{disableGeoip:a},n)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(),super._shutdown(t)}addLocalPersonAndGroupProperties(t,r,i,n){let a={distinct_id:t,...i||{}},o={};if(r)for(let c of Object.keys(r))o[c]={$group_key:r[c],...n?.[c]||{}};return{allPersonProperties:a,allGroupProperties:o}}captureException(t,r,i){let n=new Error("PostHog syntheticException");yTn.captureException(this,t,{syntheticException:n},r,i)}},d3p=/\(error: (.*)\)/,M3p=50,D3p="?";function TmS(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return i=>{let n=i.match(r);if(n){let a,o,c,f,s;if(n[1]){c=n[1];let p=c.lastIndexOf(".");if(c[p-1]==="."&&p--,p>0){a=c.slice(0,p),o=c.slice(p+1);let _=a.indexOf(".Module");_>0&&(c=c.slice(_+1),a=a.slice(0,_))}f=void 0}o&&(f=a,s=o),o==="<anonymous>"&&(s=void 0,c=void 0),c===void 0&&(s=s||D3p,c=f?`${f}.${s}`:s);let u=n[2]?.startsWith("file://")?n[2].slice(7):n[2],l=n[5]==="native";return u?.match(/\/[A-Z]:/)&&(u=u.slice(1)),!u&&n[5]&&!l&&(u=n[5]),{filename:u?decodeURI(u):void 0,module:e?e(u):void 0,function:c,lineno:p3p(n[3]),colno:p3p(n[4]),in_app:RmS(u||"",l),platform:"node:javascript"}}if(i.match(t))return{filename:i,platform:"node:javascript"}}}function RmS(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function p3p(e){return parseInt(e||"",10)||void 0}function zmS(e){return[90,TmS(e)]}function NmS(e){let r=[zmS(e)].sort((i,n)=>i[0]-n[0]).map(i=>i[1]);return(i,n=0)=>{let a=[],o=i.split(`
1150
- `);for(let c=n;c<o.length;c++){let f=o[c];if(f.length>1024)continue;let s=d3p.test(f)?f.replace(d3p,"$1"):f;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=M3p)break}}return FmS(a)}}function FmS(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,M3p).map(r=>({...r,filename:r.filename||QmS(t).filename,function:r.function||D3p}))}function QmS(e){return e[e.length-1]||{}}yTn.stackParser=NmS($AS());yTn.frameModifiers=[ZAS];var vTn=class extends v7s{getLibraryId(){return"posthog-node"}};var D0o=class{posthog;constructor({posthogApiKey:t}){this.posthog=new vTn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"3.22.3",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var sOa=class{async sendEvent(){}async identify(){}async flush(){}};var OTn=require("fs/promises"),q3p=require("os"),T3p=require("path");var B3p=ue(require("crypto")),I0o=new Uint8Array(256),B0o=I0o.length;function m7s(){return B0o>I0o.length-16&&(B3p.default.randomFillSync(I0o),B0o=0),I0o.slice(B0o,B0o+=16)}var TQ=[];for(let e=0;e<256;++e)TQ.push((e+256).toString(16).slice(1));function I3p(e,t=0){return TQ[e[t+0]]+TQ[e[t+1]]+TQ[e[t+2]]+TQ[e[t+3]]+"-"+TQ[e[t+4]]+TQ[e[t+5]]+"-"+TQ[e[t+6]]+TQ[e[t+7]]+"-"+TQ[e[t+8]]+TQ[e[t+9]]+"-"+TQ[e[t+10]]+TQ[e[t+11]]+TQ[e[t+12]]+TQ[e[t+13]]+TQ[e[t+14]]+TQ[e[t+15]]}var C3p=ue(require("crypto")),P7s={randomUUID:C3p.default.randomUUID};function UmS(e,t,r){if(P7s.randomUUID&&!t&&!e)return P7s.randomUUID();e=e||{};let i=e.random||(e.rng||m7s)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return I3p(i)}var ehe=UmS;var LmS="id",VmS=".fern",cOa=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new vTn(r),this.userId=t==null?void 0:x8s(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"3.22.3",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=It(Rr.of((0,q3p.homedir)()),Ze.of(VmS),Ze.of(LmS));await qi(t)||(await(0,OTn.mkdir)((0,T3p.dirname)(t),{recursive:!0}),await(0,OTn.writeFile)(t,ehe())),this.persistedDistinctId=(await(0,OTn.readFile)(t)).toString()}return this.persistedDistinctId}};var j7s;async function ATn(){return j7s==null&&(j7s=await WmS()),j7s}async function WmS(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new sOa;let r=await Jyo();return r!=null?new cOa({token:r,posthogApiKey:e}):await jqn()!=null?new D0o({posthogApiKey:e}):new cOa({token:void 0,posthogApiKey:e})}catch{return new sOa}}function lOa(e,t){return function(){return e.apply(t,arguments)}}var{toString:xmS}=Object.prototype,{getPrototypeOf:E7s}=Object,{iterator:q0o,toStringTag:z3p}=Symbol,T0o=(e=>t=>{let r=xmS.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),NNt=e=>(e=e.toLowerCase(),t=>T0o(t)===e),R0o=e=>t=>typeof t===e,{isArray:PTn}=Array,mTn=R0o("undefined");function fOa(e){return e!==null&&!mTn(e)&&e.constructor!==null&&!mTn(e.constructor)&&BH(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var N3p=NNt("ArrayBuffer");function GmS(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&N3p(e.buffer),t}var HmS=R0o("string"),BH=R0o("function"),F3p=R0o("number"),dOa=e=>e!==null&&typeof e=="object",KmS=e=>e===!0||e===!1,C0o=e=>{if(T0o(e)!=="object")return!1;let t=E7s(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(z3p in e)&&!(q0o in e)},JmS=e=>{if(!dOa(e)||fOa(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$mS=NNt("Date"),YmS=NNt("File"),XmS=NNt("Blob"),ZmS=NNt("FileList"),kmS=e=>dOa(e)&&BH(e.pipe),e0S=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||BH(e.append)&&((t=T0o(e))==="formdata"||t==="object"&&BH(e.toString)&&e.toString()==="[object FormData]"))},t0S=NNt("URLSearchParams"),[r0S,i0S,n0S,a0S]=["ReadableStream","Request","Response","Headers"].map(NNt),o0S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pOa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),PTn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(fOa(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(i=0;i<o;i++)c=a[i],t.call(null,e[c],c,e)}}function Q3p(e,t){if(fOa(e))return null;t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var K7i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,U3p=e=>!mTn(e)&&e!==K7i;function w7s(){let{caseless:e,skipUndefined:t}=U3p(this)&&this||{},r={},i=(n,a)=>{let o=e&&Q3p(r,a)||a;C0o(r[o])&&C0o(n)?r[o]=w7s(r[o],n):C0o(n)?r[o]=w7s({},n):PTn(n)?r[o]=n.slice():(!t||!mTn(n))&&(r[o]=n)};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&pOa(arguments[n],i);return r}var u0S=(e,t,r,{allOwnKeys:i}={})=>(pOa(t,(n,a)=>{r&&BH(n)?e[a]=lOa(n,r):e[a]=n},{allOwnKeys:i}),e),s0S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),c0S=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},l0S=(e,t,r,i)=>{let n,a,o,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)o=n[a],(!i||i(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&E7s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},f0S=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},d0S=e=>{if(!e)return null;if(PTn(e))return e;let t=e.length;if(!F3p(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},p0S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&E7s(Uint8Array)),_0S=(e,t)=>{let i=(e&&e[q0o]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},h0S=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},y0S=NNt("HTMLFormElement"),b0S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),R3p=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),v0S=NNt("RegExp"),L3p=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};pOa(r,(n,a)=>{let o;(o=t(n,a,e))!==!1&&(i[a]=o||n)}),Object.defineProperties(e,i)},g0S=e=>{L3p(e,(t,r)=>{if(BH(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(BH(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},O0S=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return PTn(e)?i(e):i(String(e).split(t)),r},A0S=()=>{},m0S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function P0S(e){return!!(e&&BH(e.append)&&e[z3p]==="FormData"&&e[q0o])}var j0S=e=>{let t=new Array(10),r=(i,n)=>{if(dOa(i)){if(t.indexOf(i)>=0)return;if(fOa(i))return i;if(!("toJSON"in i)){t[n]=i;let a=PTn(i)?[]:{};return pOa(i,(o,c)=>{let f=r(o,n+1);!mTn(f)&&(a[c]=f)}),t[n]=void 0,a}}return i};return r(e,0)},w0S=NNt("AsyncFunction"),E0S=e=>e&&(dOa(e)||BH(e))&&BH(e.then)&&BH(e.catch),V3p=((e,t)=>e?setImmediate:t?((r,i)=>(K7i.addEventListener("message",({source:n,data:a})=>{n===K7i&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),K7i.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",BH(K7i.postMessage)),S0S=typeof queueMicrotask<"u"?queueMicrotask.bind(K7i):typeof process<"u"&&process.nextTick||V3p,M0S=e=>e!=null&&BH(e[q0o]),er={isArray:PTn,isArrayBuffer:N3p,isBuffer:fOa,isFormData:e0S,isArrayBufferView:GmS,isString:HmS,isNumber:F3p,isBoolean:KmS,isObject:dOa,isPlainObject:C0o,isEmptyObject:JmS,isReadableStream:r0S,isRequest:i0S,isResponse:n0S,isHeaders:a0S,isUndefined:mTn,isDate:$mS,isFile:YmS,isBlob:XmS,isRegExp:v0S,isFunction:BH,isStream:kmS,isURLSearchParams:t0S,isTypedArray:p0S,isFileList:ZmS,forEach:pOa,merge:w7s,extend:u0S,trim:o0S,stripBOM:s0S,inherits:c0S,toFlatObject:l0S,kindOf:T0o,kindOfTest:NNt,endsWith:f0S,toArray:d0S,forEachEntry:_0S,matchAll:h0S,isHTMLForm:y0S,hasOwnProperty:R3p,hasOwnProp:R3p,reduceDescriptors:L3p,freezeMethods:g0S,toObjectSet:O0S,toCamelCase:b0S,noop:A0S,toFiniteNumber:m0S,findKey:Q3p,global:K7i,isContextDefined:U3p,isSpecCompliantForm:P0S,toJSONObject:j0S,isAsyncFn:w0S,isThenable:E0S,setImmediate:V3p,asap:S0S,isIterable:M0S};function jTn(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}er.inherits(jTn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:er.toJSONObject(this.config),code:this.code,status:this.status}}});var W3p=jTn.prototype,x3p={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{x3p[e]={value:e}});Object.defineProperties(jTn,x3p);Object.defineProperty(W3p,"isAxiosError",{value:!0});jTn.from=(e,t,r,i,n,a)=>{let o=Object.create(W3p);er.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return jTn.call(o,c,f,r,i,n),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var ha=jTn;var G3p=ue(IGi(),1),z0o=G3p.default;function S7s(e){return er.isPlainObject(e)||er.isArray(e)}function K3p(e){return er.endsWith(e,"[]")?e.slice(0,-2):e}function H3p(e,t,r){return e?e.concat(t).map(function(n,a){return n=K3p(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function D0S(e){return er.isArray(e)&&!e.some(S7s)}var B0S=er.toFlatObject(er,{},null,function(t){return/^is[A-Z]/.test(t)});function I0S(e,t,r){if(!er.isObject(e))throw new TypeError("target must be an object");t=t||new(z0o||FormData),r=er.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!er.isUndefined(b[y])});let i=r.metaTokens,n=r.visitor||u,a=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&er.isSpecCompliantForm(t);if(!er.isFunction(n))throw new TypeError("visitor must be a function");function s(h){if(h===null)return"";if(er.isDate(h))return h.toISOString();if(er.isBoolean(h))return h.toString();if(!f&&er.isBlob(h))throw new ha("Blob is not supported. Use a Buffer instead.");return er.isArrayBuffer(h)||er.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,b){let v=h;if(h&&!b&&typeof h=="object"){if(er.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(er.isArray(h)&&D0S(h)||(er.isFileList(h)||er.endsWith(y,"[]"))&&(v=er.toArray(h)))return y=K3p(y),v.forEach(function(A,g){!(er.isUndefined(A)||A===null)&&t.append(o===!0?H3p([y],g,a):o===null?y:y+"[]",s(A))}),!1}return S7s(h)?!0:(t.append(H3p(b,y,a),s(h)),!1)}let l=[],p=Object.assign(B0S,{defaultVisitor:u,convertValue:s,isVisitable:S7s});function _(h,y){if(!er.isUndefined(h)){if(l.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));l.push(h),er.forEach(h,function(v,O){(!(er.isUndefined(v)||v===null)&&n.call(t,v,er.isString(O)?O.trim():O,y,p))===!0&&_(v,y?y.concat(O):[O])}),l.pop()}}if(!er.isObject(e))throw new TypeError("data must be an object");return _(e),t}var zBi=I0S;function J3p(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function $3p(e,t){this._pairs=[],e&&zBi(e,this,t)}var Y3p=$3p.prototype;Y3p.append=function(t,r){this._pairs.push([t,r])};Y3p.toString=function(t){let r=t?function(i){return t.call(this,i,J3p)}:J3p;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var X3p=$3p;function C0S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function J7i(e,t,r){if(!t)return e;let i=r&&r.encode||C0S;er.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=er.isURLSearchParams(t)?t.toString():new X3p(t,r).toString(i),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var M7s=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){er.forEach(this.handlers,function(i){i!==null&&t(i)})}},D7s=M7s;var wTn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var t8p=ue(require("crypto"),1);var Z3p=ue(require("url"),1),k3p=Z3p.default.URLSearchParams;var B7s="abcdefghijklmnopqrstuvwxyz",e8p="0123456789",r8p={DIGIT:e8p,ALPHA:B7s,ALPHA_DIGIT:B7s+B7s.toUpperCase()+e8p},q0S=(e=16,t=r8p.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);t8p.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},i8p={isNode:!0,classes:{URLSearchParams:k3p,FormData:z0o,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:r8p,generateString:q0S,protocols:["http","https","file","data"]};var q7s={};Yt(q7s,{hasBrowserEnv:()=>C7s,hasStandardBrowserEnv:()=>T0S,hasStandardBrowserWebWorkerEnv:()=>R0S,navigator:()=>I7s,origin:()=>z0S});var C7s=typeof window<"u"&&typeof document<"u",I7s=typeof navigator=="object"&&navigator||void 0,T0S=C7s&&(!I7s||["ReactNative","NativeScript","NS"].indexOf(I7s.product)<0),R0S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",z0S=C7s&&window.location.href||"http://localhost";var OA={...q7s,...i8p};function T7s(e,t){return zBi(e,new OA.classes.URLSearchParams,{visitor:function(r,i,n,a){return OA.isNode&&er.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function N0S(e){return er.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function F0S(e){let t={},r=Object.keys(e),i,n=r.length,a;for(i=0;i<n;i++)a=r[i],t[a]=e[a];return t}function Q0S(e){function t(r,i,n,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),f=a>=r.length;return o=!o&&er.isArray(n)?n.length:o,f?(er.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!c):((!n[o]||!er.isObject(n[o]))&&(n[o]=[]),t(r,i,n[o],a)&&er.isArray(n[o])&&(n[o]=F0S(n[o])),!c)}if(er.isFormData(e)&&er.isFunction(e.entries)){let r={};return er.forEachEntry(e,(i,n)=>{t(N0S(i),n,r,0)}),r}return null}var N0o=Q0S;function U0S(e,t,r){if(er.isString(e))try{return(t||JSON.parse)(e),er.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var R7s={transitional:wTn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=er.isObject(t);if(a&&er.isHTMLForm(t)&&(t=new FormData(t)),er.isFormData(t))return n?JSON.stringify(N0o(t)):t;if(er.isArrayBuffer(t)||er.isBuffer(t)||er.isStream(t)||er.isFile(t)||er.isBlob(t)||er.isReadableStream(t))return t;if(er.isArrayBufferView(t))return t.buffer;if(er.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return T7s(t,this.formSerializer).toString();if((c=er.isFileList(t))||i.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return zBi(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),U0S(t)):t}],transformResponse:[function(t){let r=this.transitional||R7s.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(er.isResponse(t)||er.isReadableStream(t))return t;if(t&&er.isString(t)&&(i&&!this.responseType||n)){let o=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?ha.from(c,ha.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:OA.classes.FormData,Blob:OA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};er.forEach(["delete","get","head","post","put","patch"],e=>{R7s.headers[e]={}});var ETn=R7s;var L0S=er.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n8p=e=>{let t={},r,i,n;return e&&e.split(`
1150
+ `);for(let c=n;c<o.length;c++){let f=o[c];if(f.length>1024)continue;let s=d3p.test(f)?f.replace(d3p,"$1"):f;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=M3p)break}}return FmS(a)}}function FmS(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,M3p).map(r=>({...r,filename:r.filename||QmS(t).filename,function:r.function||D3p}))}function QmS(e){return e[e.length-1]||{}}yTn.stackParser=NmS($AS());yTn.frameModifiers=[ZAS];var vTn=class extends v7s{getLibraryId(){return"posthog-node"}};var D0o=class{posthog;constructor({posthogApiKey:t}){this.posthog=new vTn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"3.23.0",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var sOa=class{async sendEvent(){}async identify(){}async flush(){}};var OTn=require("fs/promises"),q3p=require("os"),T3p=require("path");var B3p=ue(require("crypto")),I0o=new Uint8Array(256),B0o=I0o.length;function m7s(){return B0o>I0o.length-16&&(B3p.default.randomFillSync(I0o),B0o=0),I0o.slice(B0o,B0o+=16)}var TQ=[];for(let e=0;e<256;++e)TQ.push((e+256).toString(16).slice(1));function I3p(e,t=0){return TQ[e[t+0]]+TQ[e[t+1]]+TQ[e[t+2]]+TQ[e[t+3]]+"-"+TQ[e[t+4]]+TQ[e[t+5]]+"-"+TQ[e[t+6]]+TQ[e[t+7]]+"-"+TQ[e[t+8]]+TQ[e[t+9]]+"-"+TQ[e[t+10]]+TQ[e[t+11]]+TQ[e[t+12]]+TQ[e[t+13]]+TQ[e[t+14]]+TQ[e[t+15]]}var C3p=ue(require("crypto")),P7s={randomUUID:C3p.default.randomUUID};function UmS(e,t,r){if(P7s.randomUUID&&!t&&!e)return P7s.randomUUID();e=e||{};let i=e.random||(e.rng||m7s)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return I3p(i)}var ehe=UmS;var LmS="id",VmS=".fern",cOa=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new vTn(r),this.userId=t==null?void 0:x8s(t)}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"3.23.0",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=It(Rr.of((0,q3p.homedir)()),Ze.of(VmS),Ze.of(LmS));await qi(t)||(await(0,OTn.mkdir)((0,T3p.dirname)(t),{recursive:!0}),await(0,OTn.writeFile)(t,ehe())),this.persistedDistinctId=(await(0,OTn.readFile)(t)).toString()}return this.persistedDistinctId}};var j7s;async function ATn(){return j7s==null&&(j7s=await WmS()),j7s}async function WmS(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new sOa;let r=await Jyo();return r!=null?new cOa({token:r,posthogApiKey:e}):await jqn()!=null?new D0o({posthogApiKey:e}):new cOa({token:void 0,posthogApiKey:e})}catch{return new sOa}}function lOa(e,t){return function(){return e.apply(t,arguments)}}var{toString:xmS}=Object.prototype,{getPrototypeOf:E7s}=Object,{iterator:q0o,toStringTag:z3p}=Symbol,T0o=(e=>t=>{let r=xmS.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),NNt=e=>(e=e.toLowerCase(),t=>T0o(t)===e),R0o=e=>t=>typeof t===e,{isArray:PTn}=Array,mTn=R0o("undefined");function fOa(e){return e!==null&&!mTn(e)&&e.constructor!==null&&!mTn(e.constructor)&&BH(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var N3p=NNt("ArrayBuffer");function GmS(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&N3p(e.buffer),t}var HmS=R0o("string"),BH=R0o("function"),F3p=R0o("number"),dOa=e=>e!==null&&typeof e=="object",KmS=e=>e===!0||e===!1,C0o=e=>{if(T0o(e)!=="object")return!1;let t=E7s(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(z3p in e)&&!(q0o in e)},JmS=e=>{if(!dOa(e)||fOa(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$mS=NNt("Date"),YmS=NNt("File"),XmS=NNt("Blob"),ZmS=NNt("FileList"),kmS=e=>dOa(e)&&BH(e.pipe),e0S=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||BH(e.append)&&((t=T0o(e))==="formdata"||t==="object"&&BH(e.toString)&&e.toString()==="[object FormData]"))},t0S=NNt("URLSearchParams"),[r0S,i0S,n0S,a0S]=["ReadableStream","Request","Response","Headers"].map(NNt),o0S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pOa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),PTn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(fOa(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(i=0;i<o;i++)c=a[i],t.call(null,e[c],c,e)}}function Q3p(e,t){if(fOa(e))return null;t=t.toLowerCase();let r=Object.keys(e),i=r.length,n;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}var K7i=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,U3p=e=>!mTn(e)&&e!==K7i;function w7s(){let{caseless:e,skipUndefined:t}=U3p(this)&&this||{},r={},i=(n,a)=>{let o=e&&Q3p(r,a)||a;C0o(r[o])&&C0o(n)?r[o]=w7s(r[o],n):C0o(n)?r[o]=w7s({},n):PTn(n)?r[o]=n.slice():(!t||!mTn(n))&&(r[o]=n)};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&pOa(arguments[n],i);return r}var u0S=(e,t,r,{allOwnKeys:i}={})=>(pOa(t,(n,a)=>{r&&BH(n)?e[a]=lOa(n,r):e[a]=n},{allOwnKeys:i}),e),s0S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),c0S=(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},l0S=(e,t,r,i)=>{let n,a,o,c={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)o=n[a],(!i||i(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&E7s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},f0S=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let i=e.indexOf(t,r);return i!==-1&&i===r},d0S=e=>{if(!e)return null;if(PTn(e))return e;let t=e.length;if(!F3p(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},p0S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&E7s(Uint8Array)),_0S=(e,t)=>{let i=(e&&e[q0o]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},h0S=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},y0S=NNt("HTMLFormElement"),b0S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),R3p=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),v0S=NNt("RegExp"),L3p=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};pOa(r,(n,a)=>{let o;(o=t(n,a,e))!==!1&&(i[a]=o||n)}),Object.defineProperties(e,i)},g0S=e=>{L3p(e,(t,r)=>{if(BH(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(BH(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},O0S=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return PTn(e)?i(e):i(String(e).split(t)),r},A0S=()=>{},m0S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function P0S(e){return!!(e&&BH(e.append)&&e[z3p]==="FormData"&&e[q0o])}var j0S=e=>{let t=new Array(10),r=(i,n)=>{if(dOa(i)){if(t.indexOf(i)>=0)return;if(fOa(i))return i;if(!("toJSON"in i)){t[n]=i;let a=PTn(i)?[]:{};return pOa(i,(o,c)=>{let f=r(o,n+1);!mTn(f)&&(a[c]=f)}),t[n]=void 0,a}}return i};return r(e,0)},w0S=NNt("AsyncFunction"),E0S=e=>e&&(dOa(e)||BH(e))&&BH(e.then)&&BH(e.catch),V3p=((e,t)=>e?setImmediate:t?((r,i)=>(K7i.addEventListener("message",({source:n,data:a})=>{n===K7i&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),K7i.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",BH(K7i.postMessage)),S0S=typeof queueMicrotask<"u"?queueMicrotask.bind(K7i):typeof process<"u"&&process.nextTick||V3p,M0S=e=>e!=null&&BH(e[q0o]),er={isArray:PTn,isArrayBuffer:N3p,isBuffer:fOa,isFormData:e0S,isArrayBufferView:GmS,isString:HmS,isNumber:F3p,isBoolean:KmS,isObject:dOa,isPlainObject:C0o,isEmptyObject:JmS,isReadableStream:r0S,isRequest:i0S,isResponse:n0S,isHeaders:a0S,isUndefined:mTn,isDate:$mS,isFile:YmS,isBlob:XmS,isRegExp:v0S,isFunction:BH,isStream:kmS,isURLSearchParams:t0S,isTypedArray:p0S,isFileList:ZmS,forEach:pOa,merge:w7s,extend:u0S,trim:o0S,stripBOM:s0S,inherits:c0S,toFlatObject:l0S,kindOf:T0o,kindOfTest:NNt,endsWith:f0S,toArray:d0S,forEachEntry:_0S,matchAll:h0S,isHTMLForm:y0S,hasOwnProperty:R3p,hasOwnProp:R3p,reduceDescriptors:L3p,freezeMethods:g0S,toObjectSet:O0S,toCamelCase:b0S,noop:A0S,toFiniteNumber:m0S,findKey:Q3p,global:K7i,isContextDefined:U3p,isSpecCompliantForm:P0S,toJSONObject:j0S,isAsyncFn:w0S,isThenable:E0S,setImmediate:V3p,asap:S0S,isIterable:M0S};function jTn(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}er.inherits(jTn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:er.toJSONObject(this.config),code:this.code,status:this.status}}});var W3p=jTn.prototype,x3p={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{x3p[e]={value:e}});Object.defineProperties(jTn,x3p);Object.defineProperty(W3p,"isAxiosError",{value:!0});jTn.from=(e,t,r,i,n,a)=>{let o=Object.create(W3p);er.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return jTn.call(o,c,f,r,i,n),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var ha=jTn;var G3p=ue(IGi(),1),z0o=G3p.default;function S7s(e){return er.isPlainObject(e)||er.isArray(e)}function K3p(e){return er.endsWith(e,"[]")?e.slice(0,-2):e}function H3p(e,t,r){return e?e.concat(t).map(function(n,a){return n=K3p(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function D0S(e){return er.isArray(e)&&!e.some(S7s)}var B0S=er.toFlatObject(er,{},null,function(t){return/^is[A-Z]/.test(t)});function I0S(e,t,r){if(!er.isObject(e))throw new TypeError("target must be an object");t=t||new(z0o||FormData),r=er.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!er.isUndefined(b[y])});let i=r.metaTokens,n=r.visitor||u,a=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&er.isSpecCompliantForm(t);if(!er.isFunction(n))throw new TypeError("visitor must be a function");function s(h){if(h===null)return"";if(er.isDate(h))return h.toISOString();if(er.isBoolean(h))return h.toString();if(!f&&er.isBlob(h))throw new ha("Blob is not supported. Use a Buffer instead.");return er.isArrayBuffer(h)||er.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,y,b){let v=h;if(h&&!b&&typeof h=="object"){if(er.endsWith(y,"{}"))y=i?y:y.slice(0,-2),h=JSON.stringify(h);else if(er.isArray(h)&&D0S(h)||(er.isFileList(h)||er.endsWith(y,"[]"))&&(v=er.toArray(h)))return y=K3p(y),v.forEach(function(A,g){!(er.isUndefined(A)||A===null)&&t.append(o===!0?H3p([y],g,a):o===null?y:y+"[]",s(A))}),!1}return S7s(h)?!0:(t.append(H3p(b,y,a),s(h)),!1)}let l=[],p=Object.assign(B0S,{defaultVisitor:u,convertValue:s,isVisitable:S7s});function _(h,y){if(!er.isUndefined(h)){if(l.indexOf(h)!==-1)throw Error("Circular reference detected in "+y.join("."));l.push(h),er.forEach(h,function(v,O){(!(er.isUndefined(v)||v===null)&&n.call(t,v,er.isString(O)?O.trim():O,y,p))===!0&&_(v,y?y.concat(O):[O])}),l.pop()}}if(!er.isObject(e))throw new TypeError("data must be an object");return _(e),t}var zBi=I0S;function J3p(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function $3p(e,t){this._pairs=[],e&&zBi(e,this,t)}var Y3p=$3p.prototype;Y3p.append=function(t,r){this._pairs.push([t,r])};Y3p.toString=function(t){let r=t?function(i){return t.call(this,i,J3p)}:J3p;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var X3p=$3p;function C0S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function J7i(e,t,r){if(!t)return e;let i=r&&r.encode||C0S;er.isFunction(r)&&(r={serialize:r});let n=r&&r.serialize,a;if(n?a=n(t,r):a=er.isURLSearchParams(t)?t.toString():new X3p(t,r).toString(i),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var M7s=class{constructor(){this.handlers=[]}use(t,r,i){return this.handlers.push({fulfilled:t,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){er.forEach(this.handlers,function(i){i!==null&&t(i)})}},D7s=M7s;var wTn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var t8p=ue(require("crypto"),1);var Z3p=ue(require("url"),1),k3p=Z3p.default.URLSearchParams;var B7s="abcdefghijklmnopqrstuvwxyz",e8p="0123456789",r8p={DIGIT:e8p,ALPHA:B7s,ALPHA_DIGIT:B7s+B7s.toUpperCase()+e8p},q0S=(e=16,t=r8p.ALPHA_DIGIT)=>{let r="",{length:i}=t,n=new Uint32Array(e);t8p.default.randomFillSync(n);for(let a=0;a<e;a++)r+=t[n[a]%i];return r},i8p={isNode:!0,classes:{URLSearchParams:k3p,FormData:z0o,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:r8p,generateString:q0S,protocols:["http","https","file","data"]};var q7s={};Yt(q7s,{hasBrowserEnv:()=>C7s,hasStandardBrowserEnv:()=>T0S,hasStandardBrowserWebWorkerEnv:()=>R0S,navigator:()=>I7s,origin:()=>z0S});var C7s=typeof window<"u"&&typeof document<"u",I7s=typeof navigator=="object"&&navigator||void 0,T0S=C7s&&(!I7s||["ReactNative","NativeScript","NS"].indexOf(I7s.product)<0),R0S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",z0S=C7s&&window.location.href||"http://localhost";var OA={...q7s,...i8p};function T7s(e,t){return zBi(e,new OA.classes.URLSearchParams,{visitor:function(r,i,n,a){return OA.isNode&&er.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function N0S(e){return er.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function F0S(e){let t={},r=Object.keys(e),i,n=r.length,a;for(i=0;i<n;i++)a=r[i],t[a]=e[a];return t}function Q0S(e){function t(r,i,n,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),f=a>=r.length;return o=!o&&er.isArray(n)?n.length:o,f?(er.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!c):((!n[o]||!er.isObject(n[o]))&&(n[o]=[]),t(r,i,n[o],a)&&er.isArray(n[o])&&(n[o]=F0S(n[o])),!c)}if(er.isFormData(e)&&er.isFunction(e.entries)){let r={};return er.forEachEntry(e,(i,n)=>{t(N0S(i),n,r,0)}),r}return null}var N0o=Q0S;function U0S(e,t,r){if(er.isString(e))try{return(t||JSON.parse)(e),er.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var R7s={transitional:wTn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=er.isObject(t);if(a&&er.isHTMLForm(t)&&(t=new FormData(t)),er.isFormData(t))return n?JSON.stringify(N0o(t)):t;if(er.isArrayBuffer(t)||er.isBuffer(t)||er.isStream(t)||er.isFile(t)||er.isBlob(t)||er.isReadableStream(t))return t;if(er.isArrayBufferView(t))return t.buffer;if(er.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return T7s(t,this.formSerializer).toString();if((c=er.isFileList(t))||i.indexOf("multipart/form-data")>-1){let f=this.env&&this.env.FormData;return zBi(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),U0S(t)):t}],transformResponse:[function(t){let r=this.transitional||R7s.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(er.isResponse(t)||er.isReadableStream(t))return t;if(t&&er.isString(t)&&(i&&!this.responseType||n)){let o=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?ha.from(c,ha.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:OA.classes.FormData,Blob:OA.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};er.forEach(["delete","get","head","post","put","patch"],e=>{R7s.headers[e]={}});var ETn=R7s;var L0S=er.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n8p=e=>{let t={},r,i,n;return e&&e.split(`
1151
1151
  `).forEach(function(o){n=o.indexOf(":"),r=o.substring(0,n).trim().toLowerCase(),i=o.substring(n+1).trim(),!(!r||t[r]&&L0S[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var a8p=Symbol("internals");function _Oa(e){return e&&String(e).trim().toLowerCase()}function F0o(e){return e===!1||e==null?e:er.isArray(e)?e.map(F0o):String(e)}function V0S(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}var W0S=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function z7s(e,t,r,i,n){if(er.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!er.isString(t)){if(er.isString(i))return t.indexOf(i)!==-1;if(er.isRegExp(i))return i.test(t)}}function x0S(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function G0S(e,t){let r=er.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,a,o){return this[i].call(this,t,n,a,o)},configurable:!0})})}var STn=class{constructor(t){t&&this.set(t)}set(t,r,i){let n=this;function a(c,f,s){let u=_Oa(f);if(!u)throw new Error("header name must be a non-empty string");let l=er.findKey(n,u);(!l||n[l]===void 0||s===!0||s===void 0&&n[l]!==!1)&&(n[l||f]=F0o(c))}let o=(c,f)=>er.forEach(c,(s,u)=>a(s,u,f));if(er.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(er.isString(t)&&(t=t.trim())&&!W0S(t))o(n8p(t),r);else if(er.isObject(t)&&er.isIterable(t)){let c={},f,s;for(let u of t){if(!er.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[s=u[0]]=(f=c[s])?er.isArray(f)?[...f,u[1]]:[f,u[1]]:u[1]}o(c,r)}else t!=null&&a(r,t,i);return this}get(t,r){if(t=_Oa(t),t){let i=er.findKey(this,t);if(i){let n=this[i];if(!r)return n;if(r===!0)return V0S(n);if(er.isFunction(r))return r.call(this,n,i);if(er.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=_Oa(t),t){let i=er.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||z7s(this,this[i],i,r)))}return!1}delete(t,r){let i=this,n=!1;function a(o){if(o=_Oa(o),o){let c=er.findKey(i,o);c&&(!r||z7s(i,i[c],c,r))&&(delete i[c],n=!0)}}return er.isArray(t)?t.forEach(a):a(t),n}clear(t){let r=Object.keys(this),i=r.length,n=!1;for(;i--;){let a=r[i];(!t||z7s(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){let r=this,i={};return er.forEach(this,(n,a)=>{let o=er.findKey(i,a);if(o){r[o]=F0o(n),delete r[a];return}let c=t?x0S(a):String(a).trim();c!==a&&delete r[a],r[c]=F0o(n),i[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return er.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&er.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
1152
1152
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let i=new this(t);return r.forEach(n=>i.set(n)),i}static accessor(t){let i=(this[a8p]=this[a8p]={accessors:{}}).accessors,n=this.prototype;function a(o){let c=_Oa(o);i[c]||(G0S(n,o),i[c]=!0)}return er.isArray(t)?t.forEach(a):a(t),this}};STn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);er.reduceDescriptors(STn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});er.freezeMethods(STn);var QS=STn;function hOa(e,t){let r=this||ETn,i=t||r,n=QS.from(i.headers),a=i.data;return er.forEach(e,function(c){a=c.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function yOa(e){return!!(e&&e.__CANCEL__)}function o8p(e,t,r){ha.call(this,e??"canceled",ha.ERR_CANCELED,t,r),this.name="CanceledError"}er.inherits(o8p,ha,{__CANCEL__:!0});var the=o8p;function o6t(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new ha("Request failed with status code "+r.status,[ha.ERR_BAD_REQUEST,ha.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function N7s(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function F7s(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $7i(e,t,r){let i=!N7s(t);return e&&(i||r==!1)?F7s(e,t):t}var m8p=ue(a0o(),1),P8p=ue(require("http"),1),j8p=ue(require("https"),1),w8p=ue(require("util"),1),E8p=ue(QGs(),1),Ubi=ue(require("zlib"),1);var Y7i="1.12.2";function bOa(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var H0S=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Q7s(e,t,r){let i=r&&r.Blob||OA.classes.Blob,n=bOa(e);if(t===void 0&&i&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;let a=H0S.exec(e);if(!a)throw new ha("Invalid URL",ha.ERR_INVALID_URL);let o=a[1],c=a[2],f=a[3],s=Buffer.from(decodeURIComponent(f),c?"base64":"utf8");if(t){if(!i)throw new ha("Blob is not supported",ha.ERR_NOT_SUPPORT);return new i([s],{type:o})}return s}throw new ha("Unsupported protocol "+n,ha.ERR_NOT_SUPPORT)}var Z7i=ue(require("stream"),1);var u8p=ue(require("stream"),1);var U7s=Symbol("internals"),L7s=class extends u8p.default.Transform{constructor(t){t=er.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,n)=>!er.isUndefined(n[i])),super({readableHighWaterMark:t.chunkSize});let r=this[U7s]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",i=>{i==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[U7s];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let n=this[U7s],a=n.maxRate,o=this.readableHighWaterMark,c=n.timeWindow,f=1e3/c,s=a/f,u=n.minChunkSize!==!1?Math.max(n.minChunkSize,s*.01):0,l=(_,h)=>{let y=Buffer.byteLength(_);n.bytesSeen+=y,n.bytes+=y,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(_)?process.nextTick(h):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(h)}},p=(_,h)=>{let y=Buffer.byteLength(_),b=null,v=o,O,A=0;if(a){let g=Date.now();(!n.ts||(A=g-n.ts)>=c)&&(n.ts=g,O=s-n.bytes,n.bytes=O<0?-O:0,A=0),O=s-n.bytes}if(a){if(O<=0)return setTimeout(()=>{h(null,_)},c-A);O<v&&(v=O)}v&&y>v&&y-v>u&&(b=_.subarray(v),_=_.subarray(0,v)),l(_,b?()=>{process.nextTick(h,null,b)}:h)};p(t,function _(h,y){if(h)return i(h);y?p(y,_):i(null)})}},V7s=L7s;var S8p=require("events");var c8p=ue(require("util"),1),l8p=require("stream");var{asyncIterator:s8p}=Symbol,K0S=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[s8p]?yield*e[s8p]():yield e},Q0o=K0S;var J0S=OA.ALPHABET.ALPHA_DIGIT+"-_",vOa=typeof TextEncoder=="function"?new TextEncoder:new c8p.default.TextEncoder,X7i=`\r
1153
1153
  `,$0S=vOa.encode(X7i),Y0S=2,W7s=class{constructor(t,r){let{escapeName:i}=this.constructor,n=er.isString(r),a=`Content-Disposition: form-data; name="${i(t)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${X7i}`;n?r=vOa.encode(String(r).replace(/\r?\n|\r\n?/g,X7i)):a+=`Content-Type: ${r.type||"application/octet-stream"}${X7i}`,this.headers=vOa.encode(a+X7i),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+Y0S,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;er.isTypedArray(t)?yield t:yield*Q0o(t),yield $0S}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},X0S=(e,t,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+OA.generateString(n,J0S)}=r||{};if(!er.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=vOa.encode("--"+a+X7i),c=vOa.encode("--"+a+"--"+X7i),f=c.byteLength,s=Array.from(e.entries()).map(([l,p])=>{let _=new W7s(l,p);return f+=_.size,_});f+=o.byteLength*s.length,f=er.toFiniteNumber(f);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(f)&&(u["Content-Length"]=f),t&&t(u),l8p.Readable.from((async function*(){for(let l of s)yield o,yield*l.encode();yield c})())},f8p=X0S;var d8p=ue(require("stream"),1),x7s=class extends d8p.default.Transform{__transform(t,r,i){this.push(t),i()}_transform(t,r,i){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,r)}this.__transform(t,r,i)}},p8p=x7s;var Z0S=(e,t)=>er.isAsyncFn(e)?function(...r){let i=r.pop();e.apply(this,r).then(n=>{try{t?i(null,...t(n)):i(null,n)}catch(a){i(a)}},i)}:e,_8p=Z0S;function k0S(e,t){e=e||10;let r=new Array(e),i=new Array(e),n=0,a=0,o;return t=t!==void 0?t:1e3,function(f){let s=Date.now(),u=i[a];o||(o=s),r[n]=f,i[n]=s;let l=a,p=0;for(;l!==n;)p+=r[l++],l=l%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),s-o<t)return;let _=u&&s-u;return _?Math.round(p*1e3/_):void 0}}var h8p=k0S;function ePS(e,t){let r=0,i=1e3/t,n,a,o=(s,u=Date.now())=>{r=u,n=null,a&&(clearTimeout(a),a=null),e(...s)};return[(...s)=>{let u=Date.now(),l=u-r;l>=i?o(s,u):(n=s,a||(a=setTimeout(()=>{a=null,o(n)},i-l)))},()=>n&&o(n)]}var y8p=ePS;var Qbi=(e,t,r=3)=>{let i=0,n=h8p(50,250);return y8p(a=>{let o=a.loaded,c=a.lengthComputable?a.total:void 0,f=o-i,s=n(f),u=o<=c;i=o;let l={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:s||void 0,estimated:s&&c&&u?(c-o)/s:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},r)},MTn=(e,t)=>{let r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},DTn=e=>(...t)=>er.asap(()=>e(...t));function G7s(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),i=e.slice(t+1);if(/;base64/i.test(r)){let a=i.length,o=i.length;for(let p=0;p<o;p++)if(i.charCodeAt(p)===37&&p+2<o){let _=i.charCodeAt(p+1),h=i.charCodeAt(p+2);(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(a-=2,p+=2)}let c=0,f=o-1,s=p=>p>=2&&i.charCodeAt(p-2)===37&&i.charCodeAt(p-1)===51&&(i.charCodeAt(p)===68||i.charCodeAt(p)===100);f>=0&&(i.charCodeAt(f)===61?(c++,f--):s(f)&&(c++,f-=3)),c===1&&f>=0&&(i.charCodeAt(f)===61||s(f))&&c++;let l=Math.floor(a/4)*3-(c||0);return l>0?l:0}return Buffer.byteLength(i,"utf8")}var b8p={flush:Ubi.default.constants.Z_SYNC_FLUSH,finishFlush:Ubi.default.constants.Z_SYNC_FLUSH},tPS={flush:Ubi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ubi.default.constants.BROTLI_OPERATION_FLUSH},v8p=er.isFunction(Ubi.default.createBrotliDecompress),{http:rPS,https:iPS}=E8p.default,nPS=/https:?/,g8p=OA.protocols.map(e=>e+":"),O8p=(e,[t,r])=>(e.on("end",r).on("error",r),t);function aPS(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function M8p(e,t,r){let i=t;if(!i&&i!==!1){let n=m8p.default.getProxyForUrl(r);n&&(i=new URL(n))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let a=Buffer.from(i.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+a}e.headers.host=e.hostname+(e.port?":"+e.port:"");let n=i.hostname||i.host;e.hostname=n,e.host=n,e.port=i.port,e.path=r,i.protocol&&(e.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}e.beforeRedirects.proxy=function(a){M8p(a,t,a.href)}}var oPS=typeof process<"u"&&er.kindOf(process)==="process",uPS=e=>new Promise((t,r)=>{let i,n,a=(f,s)=>{n||(n=!0,i&&i(f,s))},o=f=>{a(f),t(f)},c=f=>{a(f,!0),r(f)};e(o,c,f=>i=f).catch(c)}),sPS=({address:e,family:t})=>{if(!er.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},A8p=(e,t)=>sPS(er.isObject(e)?e:{address:e,family:t}),D8p=oPS&&function(t){return uPS(async function(i,n,a){let{data:o,lookup:c,family:f}=t,{responseType:s,responseEncoding:u}=t,l=t.method.toUpperCase(),p,_=!1,h;if(c){let K=_8p(c,fe=>er.isArray(fe)?fe:[fe]);c=(fe,pe,L)=>{K(fe,pe,(G,Re,le)=>{if(G)return L(G);let De=er.isArray(Re)?Re.map(Ke=>A8p(Ke)):[A8p(Re,le)];pe.all?L(G,De):L(G,De[0].address,De[0].family)})}}let y=new S8p.EventEmitter,b=()=>{t.cancelToken&&t.cancelToken.unsubscribe(v),t.signal&&t.signal.removeEventListener("abort",v),y.removeAllListeners()};a((K,fe)=>{p=!0,fe&&(_=!0,b())});function v(K){y.emit("abort",!K||K.type?new the(null,t,h):K)}y.once("abort",n),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(v),t.signal&&(t.signal.aborted?v():t.signal.addEventListener("abort",v)));let O=$7i(t.baseURL,t.url,t.allowAbsoluteUrls),A=new URL(O,OA.hasBrowserEnv?OA.origin:void 0),g=A.protocol||g8p[0];if(g==="data:"){if(t.maxContentLength>-1){let fe=String(t.url||O||"");if(G7s(fe)>t.maxContentLength)return n(new ha("maxContentLength size of "+t.maxContentLength+" exceeded",ha.ERR_BAD_RESPONSE,t))}let K;if(l!=="GET")return o6t(i,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{K=Q7s(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(fe){throw ha.from(fe,ha.ERR_BAD_REQUEST,t)}return s==="text"?(K=K.toString(u),(!u||u==="utf8")&&(K=er.stripBOM(K))):s==="stream"&&(K=Z7i.default.Readable.from(K)),o6t(i,n,{data:K,status:200,statusText:"OK",headers:new QS,config:t})}if(g8p.indexOf(g)===-1)return n(new ha("Unsupported protocol "+g,ha.ERR_BAD_REQUEST,t));let m=QS.from(t.headers).normalize();m.set("User-Agent","axios/"+Y7i,!1);let{onUploadProgress:j,onDownloadProgress:M}=t,E=t.maxRate,D,B;if(er.isSpecCompliantForm(o)){let K=m.getContentType(/boundary=([-_\w\d]{10,70})/i);o=f8p(o,fe=>{m.set(fe)},{tag:`axios-${Y7i}-boundary`,boundary:K&&K[1]||void 0})}else if(er.isFormData(o)&&er.isFunction(o.getHeaders)){if(m.set(o.getHeaders()),!m.hasContentLength())try{let K=await w8p.default.promisify(o.getLength).call(o);Number.isFinite(K)&&K>=0&&m.setContentLength(K)}catch{}}else if(er.isBlob(o)||er.isFile(o))o.size&&m.setContentType(o.type||"application/octet-stream"),m.setContentLength(o.size||0),o=Z7i.default.Readable.from(Q0o(o));else if(o&&!er.isStream(o)){if(!Buffer.isBuffer(o))if(er.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(er.isString(o))o=Buffer.from(o,"utf-8");else return n(new ha("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",ha.ERR_BAD_REQUEST,t));if(m.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return n(new ha("Request body larger than maxBodyLength limit",ha.ERR_BAD_REQUEST,t))}let F=er.toFiniteNumber(m.getContentLength());er.isArray(E)?(D=E[0],B=E[1]):D=B=E,o&&(j||D)&&(er.isStream(o)||(o=Z7i.default.Readable.from(o,{objectMode:!1})),o=Z7i.default.pipeline([o,new V7s({maxRate:er.toFiniteNumber(D)})],er.noop),j&&o.on("progress",O8p(o,MTn(F,Qbi(DTn(j),!1,3)))));let N;if(t.auth){let K=t.auth.username||"",fe=t.auth.password||"";N=K+":"+fe}if(!N&&A.username){let K=A.username,fe=A.password;N=K+":"+fe}N&&m.delete("authorization");let R;try{R=J7i(A.pathname+A.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(K){let fe=new Error(K.message);return fe.config=t,fe.url=t.url,fe.exists=!0,n(fe)}m.set("Accept-Encoding","gzip, compress, deflate"+(v8p?", br":""),!1);let z={path:R,method:l,headers:m.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:N,protocol:g,family:f,beforeRedirect:aPS,beforeRedirects:{}};!er.isUndefined(c)&&(z.lookup=c),t.socketPath?z.socketPath=t.socketPath:(z.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,z.port=A.port,M8p(z,t.proxy,g+"//"+A.hostname+(A.port?":"+A.port:"")+z.path));let U,W=nPS.test(z.protocol);if(z.agent=W?t.httpsAgent:t.httpAgent,t.transport?U=t.transport:t.maxRedirects===0?U=W?j8p.default:P8p.default:(t.maxRedirects&&(z.maxRedirects=t.maxRedirects),t.beforeRedirect&&(z.beforeRedirects.config=t.beforeRedirect),U=W?iPS:rPS),t.maxBodyLength>-1?z.maxBodyLength=t.maxBodyLength:z.maxBodyLength=1/0,t.insecureHTTPParser&&(z.insecureHTTPParser=t.insecureHTTPParser),h=U.request(z,function(fe){if(h.destroyed)return;let pe=[fe],L=+fe.headers["content-length"];if(M||B){let Ke=new V7s({maxRate:er.toFiniteNumber(B)});M&&Ke.on("progress",O8p(Ke,MTn(L,Qbi(DTn(M),!0,3)))),pe.push(Ke)}let G=fe,Re=fe.req||h;if(t.decompress!==!1&&fe.headers["content-encoding"])switch((l==="HEAD"||fe.statusCode===204)&&delete fe.headers["content-encoding"],(fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":pe.push(Ubi.default.createUnzip(b8p)),delete fe.headers["content-encoding"];break;case"deflate":pe.push(new p8p),pe.push(Ubi.default.createUnzip(b8p)),delete fe.headers["content-encoding"];break;case"br":v8p&&(pe.push(Ubi.default.createBrotliDecompress(tPS)),delete fe.headers["content-encoding"])}G=pe.length>1?Z7i.default.pipeline(pe,er.noop):pe[0];let le=Z7i.default.finished(G,()=>{le(),b()}),De={status:fe.statusCode,statusText:fe.statusMessage,headers:new QS(fe.headers),config:t,request:Re};if(s==="stream")De.data=G,o6t(i,n,De);else{let Ke=[],se=0;G.on("data",function(Je){Ke.push(Je),se+=Je.length,t.maxContentLength>-1&&se>t.maxContentLength&&(_=!0,G.destroy(),n(new ha("maxContentLength size of "+t.maxContentLength+" exceeded",ha.ERR_BAD_RESPONSE,t,Re)))}),G.on("aborted",function(){if(_)return;let Je=new ha("stream has been aborted",ha.ERR_BAD_RESPONSE,t,Re);G.destroy(Je),n(Je)}),G.on("error",function(Je){h.destroyed||n(ha.from(Je,null,t,Re))}),G.on("end",function(){try{let Je=Ke.length===1?Ke[0]:Buffer.concat(Ke);s!=="arraybuffer"&&(Je=Je.toString(u),(!u||u==="utf8")&&(Je=er.stripBOM(Je))),De.data=Je}catch(Je){return n(ha.from(Je,null,t,De.request,De))}o6t(i,n,De)})}y.once("abort",Ke=>{G.destroyed||(G.emit("error",Ke),G.destroy())})}),y.once("abort",K=>{n(K),h.destroy(K)}),h.on("error",function(fe){n(ha.from(fe,null,t,h))}),h.on("socket",function(fe){fe.setKeepAlive(!0,1e3*60)}),t.timeout){let K=parseInt(t.timeout,10);if(Number.isNaN(K)){n(new ha("error trying to parse `config.timeout` to int",ha.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(K,function(){if(p)return;let pe=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",L=t.transitional||wTn;t.timeoutErrorMessage&&(pe=t.timeoutErrorMessage),n(new ha(pe,L.clarifyTimeoutError?ha.ETIMEDOUT:ha.ECONNABORTED,t,h)),v()})}if(er.isStream(o)){let K=!1,fe=!1;o.on("end",()=>{K=!0}),o.once("error",pe=>{fe=!0,h.destroy(pe)}),o.on("close",()=>{!K&&!fe&&v(new the("Request stream has been aborted",t,h))}),o.pipe(h)}else h.end(o)})};var B8p=OA.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,OA.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(OA.origin),OA.navigator&&/(msie|trident)/i.test(OA.navigator.userAgent)):()=>!0;var I8p=OA.hasStandardBrowserEnv?{write(e,t,r,i,n,a){let o=[e+"="+encodeURIComponent(t)];er.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),er.isString(i)&&o.push("path="+i),er.isString(n)&&o.push("domain="+n),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var C8p=e=>e instanceof QS?{...e}:e;function FNt(e,t){t=t||{};let r={};function i(s,u,l,p){return er.isPlainObject(s)&&er.isPlainObject(u)?er.merge.call({caseless:p},s,u):er.isPlainObject(u)?er.merge({},u):er.isArray(u)?u.slice():u}function n(s,u,l,p){if(er.isUndefined(u)){if(!er.isUndefined(s))return i(void 0,s,l,p)}else return i(s,u,l,p)}function a(s,u){if(!er.isUndefined(u))return i(void 0,u)}function o(s,u){if(er.isUndefined(u)){if(!er.isUndefined(s))return i(void 0,s)}else return i(void 0,u)}function c(s,u,l){if(l in t)return i(s,u);if(l in e)return i(void 0,s)}let f={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(s,u,l)=>n(C8p(s),C8p(u),l,!0)};return er.forEach(Object.keys({...e,...t}),function(u){let l=f[u]||n,p=l(e[u],t[u],u);er.isUndefined(p)&&l!==c||(r[u]=p)}),r}var U0o=e=>{let t=FNt({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=QS.from(o),t.url=J7i($7i(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),er.isFormData(r)){if(OA.hasStandardBrowserEnv||OA.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(er.isFunction(r.getHeaders)){let f=r.getHeaders(),s=["content-type","content-length"];Object.entries(f).forEach(([u,l])=>{s.includes(u.toLowerCase())&&o.set(u,l)})}}if(OA.hasStandardBrowserEnv&&(i&&er.isFunction(i)&&(i=i(t)),i||i!==!1&&B8p(t.url))){let f=n&&a&&I8p.read(a);f&&o.set(n,f)}return t};var cPS=typeof XMLHttpRequest<"u",q8p=cPS&&function(e){return new Promise(function(r,i){let n=U0o(e),a=n.data,o=QS.from(n.headers).normalize(),{responseType:c,onUploadProgress:f,onDownloadProgress:s}=n,u,l,p,_,h;function y(){_&&_(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function v(){if(!b)return;let A=QS.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:A,config:e,request:b};o6t(function(M){r(M),y()},function(M){i(M),y()},m),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(i(new ha("Request aborted",ha.ECONNABORTED,e,b)),b=null)},b.onerror=function(g){let m=g&&g.message?g.message:"Network Error",j=new ha(m,ha.ERR_NETWORK,e,b);j.event=g||null,i(j),b=null},b.ontimeout=function(){let g=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",m=n.transitional||wTn;n.timeoutErrorMessage&&(g=n.timeoutErrorMessage),i(new ha(g,m.clarifyTimeoutError?ha.ETIMEDOUT:ha.ECONNABORTED,e,b)),b=null},a===void 0&&o.setContentType(null),"setRequestHeader"in b&&er.forEach(o.toJSON(),function(g,m){b.setRequestHeader(m,g)}),er.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),c&&c!=="json"&&(b.responseType=n.responseType),s&&([p,h]=Qbi(s,!0),b.addEventListener("progress",p)),f&&b.upload&&([l,_]=Qbi(f),b.upload.addEventListener("progress",l),b.upload.addEventListener("loadend",_)),(n.cancelToken||n.signal)&&(u=A=>{b&&(i(!A||A.type?new the(null,e,b):A),b.abort(),b=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));let O=bOa(n.url);if(O&&OA.protocols.indexOf(O)===-1){i(new ha("Unsupported protocol "+O+":",ha.ERR_BAD_REQUEST,e));return}b.send(a||null)})};var lPS=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let i=new AbortController,n,a=function(s){if(!n){n=!0,c();let u=s instanceof Error?s:this.reason;i.abort(u instanceof ha?u:new the(u instanceof Error?u.message:u))}},o=t&&setTimeout(()=>{o=null,a(new ha(`timeout ${t} of ms exceeded`,ha.ETIMEDOUT))},t),c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:f}=i;return f.unsubscribe=()=>er.asap(c),f}},T8p=lPS;var fPS=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let i=0,n;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},dPS=async function*(e,t){for await(let r of pPS(e))yield*fPS(r,t)},pPS=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:i}=await t.read();if(r)break;yield i}}finally{await t.cancel()}},H7s=(e,t,r,i)=>{let n=dPS(e,t),a=0,o,c=f=>{o||(o=!0,i&&i(f))};return new ReadableStream({async pull(f){try{let{done:s,value:u}=await n.next();if(s){c(),f.close();return}let l=u.byteLength;if(r){let p=a+=l;r(p)}f.enqueue(new Uint8Array(u))}catch(s){throw c(s),s}},cancel(f){return c(f),n.return()}},{highWaterMark:2})};var R8p=64*1024,{isFunction:L0o}=er,_PS=(({Request:e,Response:t})=>({Request:e,Response:t}))(er.global),{ReadableStream:z8p,TextEncoder:N8p}=er.global,F8p=(e,...t)=>{try{return!!e(...t)}catch{return!1}},hPS=e=>{e=er.merge.call({skipUndefined:!0},_PS,e);let{fetch:t,Request:r,Response:i}=e,n=t?L0o(t):typeof fetch=="function",a=L0o(r),o=L0o(i);if(!n)return!1;let c=n&&L0o(z8p),f=n&&(typeof N8p=="function"?(h=>y=>h.encode(y))(new N8p):async h=>new Uint8Array(await new r(h).arrayBuffer())),s=a&&c&&F8p(()=>{let h=!1,y=new r(OA.origin,{body:new z8p,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!y}),u=o&&c&&F8p(()=>er.isReadableStream(new i("").body)),l={stream:u&&(h=>h.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!l[h]&&(l[h]=(y,b)=>{let v=y&&y[h];if(v)return v.call(y);throw new ha(`Response type '${h}' is not supported`,ha.ERR_NOT_SUPPORT,b)})});let p=async h=>{if(h==null)return 0;if(er.isBlob(h))return h.size;if(er.isSpecCompliantForm(h))return(await new r(OA.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(er.isArrayBufferView(h)||er.isArrayBuffer(h))return h.byteLength;if(er.isURLSearchParams(h)&&(h=h+""),er.isString(h))return(await f(h)).byteLength},_=async(h,y)=>{let b=er.toFiniteNumber(h.getContentLength());return b??p(y)};return async h=>{let{url:y,method:b,data:v,signal:O,cancelToken:A,timeout:g,onDownloadProgress:m,onUploadProgress:j,responseType:M,headers:E,withCredentials:D="same-origin",fetchOptions:B}=U0o(h),F=t||fetch;M=M?(M+"").toLowerCase():"text";let N=T8p([O,A&&A.toAbortSignal()],g),R=null,z=N&&N.unsubscribe&&(()=>{N.unsubscribe()}),U;try{if(j&&s&&b!=="get"&&b!=="head"&&(U=await _(E,v))!==0){let G=new r(y,{method:"POST",body:v,duplex:"half"}),Re;if(er.isFormData(v)&&(Re=G.headers.get("content-type"))&&E.setContentType(Re),G.body){let[le,De]=MTn(U,Qbi(DTn(j)));v=H7s(G.body,R8p,le,De)}}er.isString(D)||(D=D?"include":"omit");let W=a&&"credentials"in r.prototype,K={...B,signal:N,method:b.toUpperCase(),headers:E.normalize().toJSON(),body:v,duplex:"half",credentials:W?D:void 0};R=a&&new r(y,K);let fe=await(a?F(R,B):F(y,K)),pe=u&&(M==="stream"||M==="response");if(u&&(m||pe&&z)){let G={};["status","statusText","headers"].forEach(Ke=>{G[Ke]=fe[Ke]});let Re=er.toFiniteNumber(fe.headers.get("content-length")),[le,De]=m&&MTn(Re,Qbi(DTn(m),!0))||[];fe=new i(H7s(fe.body,R8p,le,()=>{De&&De(),z&&z()}),G)}M=M||"text";let L=await l[er.findKey(l,M)||"text"](fe,h);return!pe&&z&&z(),await new Promise((G,Re)=>{o6t(G,Re,{data:L,headers:QS.from(fe.headers),status:fe.status,statusText:fe.statusText,config:h,request:R})})}catch(W){throw z&&z(),W&&W.name==="TypeError"&&/Load failed|fetch/i.test(W.message)?Object.assign(new ha("Network Error",ha.ERR_NETWORK,h,R),{cause:W.cause||W}):ha.from(W,W&&W.code,h,R)}}},yPS=new Map,K7s=e=>{let t=e?e.env:{},{fetch:r,Request:i,Response:n}=t,a=[i,n,r],o=a.length,c=o,f,s,u=yPS;for(;c--;)f=a[c],s=u.get(f),s===void 0&&u.set(f,s=c?new Map:hPS(t)),u=s;return s},cg5=K7s();var J7s={http:D8p,xhr:q8p,fetch:{get:K7s}};er.forEach(J7s,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var Q8p=e=>`- ${e}`,vPS=e=>er.isFunction(e)||e===null||e===!1,V0o={getAdapter:(e,t)=>{e=er.isArray(e)?e:[e];let{length:r}=e,i,n,a={};for(let o=0;o<r;o++){i=e[o];let c;if(n=i,!vPS(i)&&(n=J7s[(c=String(i)).toLowerCase()],n===void 0))throw new ha(`Unknown adapter '${c}'`);if(n&&(er.isFunction(n)||(n=n.get(t))))break;a[c||"#"+o]=n}if(!n){let o=Object.entries(a).map(([f,s])=>`adapter ${f} `+(s===!1?"is not supported by the environment":"is not available in the build")),c=r?o.length>1?`since :
@@ -1391,7 +1391,7 @@ ${g}${O}${m}${AQn}`});function BQo({message:e,error:t,logger:r,logLevel:i=$s.Err
1391
1391
  Run ${Ut.cyan("fern generator upgrade")} to upgrade your generators.`),n.length>2&&(r+=`
1392
1392
  Run ${Ut.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),QBi(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function Duc({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:i=!0}){if(!If_(e))return;let n=t??"",a=e.filter(c=>c.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let o=a.sort((c,f)=>c.generatorName.localeCompare(f.generatorName)||c.currentVersion.localeCompare(f.currentVersion));for(let c of o)n+=`
1393
1393
  ${await nZS(c.generatorName)} (${c.apiName!=null?"API: "+c.apiName+", ":""}Group: ${c.generatorGroup}) `+Ut.dim(c.currentVersion)+Ut.reset(" \u2192 ")+Ut.green(c.latestVersion);return n+=`
1394
- `,i?QBi(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function nZS(e){let r=await new Bf_.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function aZS({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(f,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let p=NMi(u.name,l),_=await dNt({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:n,includeMajor:a,context:l});_!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:_})},generatorFilter:r,groupFilter:i}),c}let o={type:"multiApi",versions:{}};return await qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,f,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][f]==null&&(o.versions[c][f]={});let l=NMi(s.name,u),p=await dNt({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:u});p!=null&&(o.versions[c][f][s.name]={previousVersion:s.version,latestVersion:p})},generatorFilter:r,groupFilter:i}),o}async function qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await $_e({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let f of c.groups)if(!(n!=null&&f.groupName!==n))for(let s of f.generators)i!=null&&s.name!==i||await r(a.workspaceName,f.groupName,s,o)}})}))}function Tf_(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${n} has an upgrade available...`);let f=kH(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(f?"Upgrade available.":"No upgrade available.")),i.push({generatorName:o,generatorGroup:n,apiName:t,isUpgradeAvailable:f,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return i}async function TQo({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let o=[];if(e!=null){let c=await aZS({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(c.type==="multiApi")for(let[f,s]of Object.entries(c.versions))o.push(...Tf_(s,f,t.logger));else o.push(...Tf_(c.versions,void 0,t.logger))}return o}var IPa=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${n} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var wQn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Buc=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&n.message==="unsupported BodyInit type")return!1;throw n}return e&&!t})(),Rf_=typeof globalThis.AbortController=="function",zf_=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nf_=typeof globalThis.ReadableStream=="function",Ff_=typeof globalThis.FormData=="function",RQo=["get","post","put","patch","head","delete"],oZS=()=>{};oZS();var Qf_={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zQo=2147483647,Uf_=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,NQo=Symbol("stop"),Lf_={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Vf_={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var uZS=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=Uf_,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof i=="string"?new TextEncoder().encode(i).length:i.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Wf_=(e,t,r)=>{let i,n=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),i){n+=i.byteLength;let c=t===0?0:n/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,n),transferredBytes:n},i)}i=a},flush(){i&&(n+=i.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},i))}}))},xf_=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(Wf_(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},Gf_=(e,t,r)=>{if(!e.body)return e;let i=uZS(r??e.body);return new Request(e,{duplex:"half",body:Wf_(e.body,i,t)})};var EQn=e=>e!==null&&typeof e=="object";var CPa=(...e)=>{for(let t of e)if((!EQn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return quc({},...e)},Iuc=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,o]of n.entries())i&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function FQo(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:quc(e[r]??[],t[r]??[])}var Cuc=(e={},t={})=>({beforeRequest:FQo(e,t,"beforeRequest"),beforeRetry:FQo(e,t,"beforeRetry"),afterResponse:FQo(e,t,"afterResponse"),beforeError:FQo(e,t,"beforeError")}),quc=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(EQn(n)){for(let[a,o]of Object.entries(n))EQn(o)&&a in t&&(o=quc(t[a],o)),t={...t,[a]:o};EQn(n.hooks)&&(i=Cuc(i,n.hooks),t.hooks=i),EQn(n.headers)&&(r=Iuc(r,n.headers),t.headers=r)}return t};var Kf_=e=>RQo.includes(e)?e.toUpperCase():e,sZS=["get","put","head","delete","options","trace"],cZS=[408,413,429,500,502,503,504],lZS=[413,429,503],Hf_={limit:2,methods:sZS,statusCodes:cZS,afterStatusCodes:lZS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Jf_=(e={})=>{if(typeof e=="number")return{...Hf_,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Hf_,...e}};async function Tuc(e,t,r,i){return new Promise((n,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new wQn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(o)})})}async function Ruc(e,{signal:t}){return new Promise((r,i)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));function n(){clearTimeout(a),i(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}var $f_=(e,t)=>{let r={};for(let i in t)!(i in Vf_)&&!(i in Lf_)&&!(i in e)&&(r[i]=t[i]);return r},Yf_=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var qPa=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>zQo)throw new RangeError(`The \`timeout\` option cannot be greater than ${zQo}`);await Promise.resolve();let c=await i._fetch();for(let f of i._options.hooks.afterResponse){let s=await f(i.request,i._options,i._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(i._decorateResponse(c),!c.ok&&i._options.throwHttpErrors){let f=new IPa(c,i.request,i._options);for(let s of i._options.hooks.beforeError)f=await s(f);throw f}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nf_)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return xf_(c.clone(),i._options.onDownloadProgress)}return c},o=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{let c=i._originalRequest,f=[];c&&!c.bodyUsed&&f.push(c.body?.cancel()),i.request.bodyUsed||f.push(i.request.body?.cancel()),await Promise.all(f)});for(let[c,f]of Object.entries(Qf_))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||f);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:Iuc(this._input.headers,r.headers),hooks:Cuc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Kf_(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Jf_(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Rf_&&zf_){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(Buc&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),Yf_(this._options.searchParams)){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(Ff_&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Buc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Gf_(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof wQn)throw t;if(t instanceof IPa){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let i=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(t.response.status)){let n=Number(i)*1e3;Number.isNaN(n)?n=Date.parse(i)-Date.now():n>=Date.parse("2024-01-01")&&(n-=Date.now());let a=this._options.retry.maxRetryAfter??n;return n<a?n:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let i=Math.min(this._calculateRetryDelay(r),zQo);if(this._retryCount<1)throw r;await Ruc(i,{signal:this._options.signal});for(let n of this._options.hooks.beforeRetry)if(await n({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===NQo)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let i=await r(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=$f_(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):Tuc(this._originalRequest,t,this.abortController,this._options)}};var zuc=e=>{let t=(r,i)=>qPa.create(r,CPa(e,i));for(let r of RQo)t[r]=(i,n)=>qPa.create(i,CPa(e,n,{method:r}));return t.create=r=>zuc(CPa(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),zuc(CPa(e,r))),t.stop=NQo,t},fZS=zuc(),Xf_=fZS;var Od_=ue(gd_(),1);function Luc(e){let t=(0,Od_.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var _p_=ue(pp_(),1),hp_=ue(m_e(),1),esc=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},tsc=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function rsc(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??Luc(n),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,_p_.default)(a.toString(),{recursive:!0}),f={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete f.accept,c&&(f.authorization=`${c.type} ${c.token}`);let s;try{s=await Xf_(o,{headers:f,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new esc(e):l}if(t.allVersions)return s;let u=new tsc(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(i&&!l)for(let[_,h]of Object.entries(s.versions))h.deprecated&&delete s.versions[_];if(!l){let _=Object.keys(s.versions);if(r=hp_.default.maxSatisfying(_,r),!r)throw u}let{time:p}=s;if(s=s.versions[r],s.time=p,!s)throw u}return s}async function QPa(e,t){let{version:r}=await rsc(e.toLowerCase(),t);return r}async function qCi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:QPa(e.packageName,{version:t?"prerelease":"latest"})}var yp_=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],YQo=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=$s.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new qQo(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(n==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"3.22.3"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${Ut.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new TE}failWithoutThrowing(t,r){this.didSucceed=!1,BQo({message:t,error:r,logger:this.logger})}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await ATn()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await Cf_({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
1394
+ `,i?QBi(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function nZS(e){let r=await new Bf_.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new Error(`Generator ${e} not found`);return r.body.displayName}async function aZS({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(f,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let p=NMi(u.name,l),_=await dNt({generatorName:p,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:n,includeMajor:a,context:l});_!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:_})},generatorFilter:r,groupFilter:i}),c}let o={type:"multiApi",versions:{}};return await qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,f,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][f]==null&&(o.versions[c][f]={});let l=NMi(s.name,u),p=await dNt({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:u});p!=null&&(o.versions[c][f][s.name]={previousVersion:s.version,latestVersion:p})},generatorFilter:r,groupFilter:i}),o}async function qf_({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await $_e({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let f of c.groups)if(!(n!=null&&f.groupName!==n))for(let s of f.generators)i!=null&&s.name!==i||await r(a.workspaceName,f.groupName,s,o)}})}))}function Tf_(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${n} has an upgrade available...`);let f=kH(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(f?"Upgrade available.":"No upgrade available.")),i.push({generatorName:o,generatorGroup:n,apiName:t,isUpgradeAvailable:f,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return i}async function TQo({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let o=[];if(e!=null){let c=await aZS({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(c.type==="multiApi")for(let[f,s]of Object.entries(c.versions))o.push(...Tf_(s,f,t.logger));else o.push(...Tf_(c.versions,void 0,t.logger))}return o}var IPa=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${n} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var wQn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Buc=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&n.message==="unsupported BodyInit type")return!1;throw n}return e&&!t})(),Rf_=typeof globalThis.AbortController=="function",zf_=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Nf_=typeof globalThis.ReadableStream=="function",Ff_=typeof globalThis.FormData=="function",RQo=["get","post","put","patch","head","delete"],oZS=()=>{};oZS();var Qf_={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},zQo=2147483647,Uf_=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,NQo=Symbol("stop"),Lf_={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Vf_={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var uZS=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,i]of e)t+=Uf_,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof i=="string"?new TextEncoder().encode(i).length:i.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Wf_=(e,t,r)=>{let i,n=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),i){n+=i.byteLength;let c=t===0?0:n/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,n),transferredBytes:n},i)}i=a},flush(){i&&(n+=i.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},i))}}))},xf_=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(Wf_(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},Gf_=(e,t,r)=>{if(!e.body)return e;let i=uZS(r??e.body);return new Request(e,{duplex:"half",body:Wf_(e.body,i,t)})};var EQn=e=>e!==null&&typeof e=="object";var CPa=(...e)=>{for(let t of e)if((!EQn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return quc({},...e)},Iuc=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,o]of n.entries())i&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function FQo(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:quc(e[r]??[],t[r]??[])}var Cuc=(e={},t={})=>({beforeRequest:FQo(e,t,"beforeRequest"),beforeRetry:FQo(e,t,"beforeRetry"),afterResponse:FQo(e,t,"afterResponse"),beforeError:FQo(e,t,"beforeError")}),quc=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(EQn(n)){for(let[a,o]of Object.entries(n))EQn(o)&&a in t&&(o=quc(t[a],o)),t={...t,[a]:o};EQn(n.hooks)&&(i=Cuc(i,n.hooks),t.hooks=i),EQn(n.headers)&&(r=Iuc(r,n.headers),t.headers=r)}return t};var Kf_=e=>RQo.includes(e)?e.toUpperCase():e,sZS=["get","put","head","delete","options","trace"],cZS=[408,413,429,500,502,503,504],lZS=[413,429,503],Hf_={limit:2,methods:sZS,statusCodes:cZS,afterStatusCodes:lZS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Jf_=(e={})=>{if(typeof e=="number")return{...Hf_,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Hf_,...e}};async function Tuc(e,t,r,i){return new Promise((n,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new wQn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(o)})})}async function Ruc(e,{signal:t}){return new Promise((r,i)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));function n(){clearTimeout(a),i(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}var $f_=(e,t)=>{let r={};for(let i in t)!(i in Vf_)&&!(i in Lf_)&&!(i in e)&&(r[i]=t[i]);return r},Yf_=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var qPa=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>zQo)throw new RangeError(`The \`timeout\` option cannot be greater than ${zQo}`);await Promise.resolve();let c=await i._fetch();for(let f of i._options.hooks.afterResponse){let s=await f(i.request,i._options,i._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(i._decorateResponse(c),!c.ok&&i._options.throwHttpErrors){let f=new IPa(c,i.request,i._options);for(let s of i._options.hooks.beforeError)f=await s(f);throw f}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nf_)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return xf_(c.clone(),i._options.onDownloadProgress)}return c},o=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n()).finally(async()=>{let c=i._originalRequest,f=[];c&&!c.bodyUsed&&f.push(c.body?.cancel()),i.request.bodyUsed||f.push(i.request.body?.cancel()),await Promise.all(f)});for(let[c,f]of Object.entries(Qf_))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||f);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:Iuc(this._input.headers,r.headers),hooks:Cuc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Kf_(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Jf_(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Rf_&&zf_){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(Buc&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),Yf_(this._options.searchParams)){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(Ff_&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Buc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Gf_(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof wQn)throw t;if(t instanceof IPa){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let i=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(t.response.status)){let n=Number(i)*1e3;Number.isNaN(n)?n=Date.parse(i)-Date.now():n>=Date.parse("2024-01-01")&&(n-=Date.now());let a=this._options.retry.maxRetryAfter??n;return n<a?n:a}if(t.response.status===413)throw t}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){let i=Math.min(this._calculateRetryDelay(r),zQo);if(this._retryCount<1)throw r;await Ruc(i,{signal:this._options.signal});for(let n of this._options.hooks.beforeRetry)if(await n({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===NQo)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let i=await r(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let t=$f_(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):Tuc(this._originalRequest,t,this.abortController,this._options)}};var zuc=e=>{let t=(r,i)=>qPa.create(r,CPa(e,i));for(let r of RQo)t[r]=(i,n)=>qPa.create(i,CPa(e,n,{method:r}));return t.create=r=>zuc(CPa(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),zuc(CPa(e,r))),t.stop=NQo,t},fZS=zuc(),Xf_=fZS;var Od_=ue(gd_(),1);function Luc(e){let t=(0,Od_.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var _p_=ue(pp_(),1),hp_=ue(m_e(),1),esc=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},tsc=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function rsc(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??Luc(n),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,_p_.default)(a.toString(),{recursive:!0}),f={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete f.accept,c&&(f.authorization=`${c.type} ${c.token}`);let s;try{s=await Xf_(o,{headers:f,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new esc(e):l}if(t.allVersions)return s;let u=new tsc(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(i&&!l)for(let[_,h]of Object.entries(s.versions))h.deprecated&&delete s.versions[_];if(!l){let _=Object.keys(s.versions);if(r=hp_.default.maxSatisfying(_,r),!r)throw u}let{time:p}=s;if(s=s.versions[r],s.time=p,!s)throw u}return s}async function QPa(e,t){let{version:r}=await rsc(e.toLowerCase(),t);return r}async function qCi({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:QPa(e.packageName,{version:t?"prerelease":"latest"})}var yp_=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],YQo=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=$s.Info;isLocal;constructor(t,r,{isLocal:i}){this.ttyAwareLogger=new qQo(t,r),this.isLocal=i??!1;let n=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(n==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:n,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"3.23.0"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${Ut.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new TE}failWithoutThrowing(t,r){this.didSucceed=!1,BQo({message:t,error:r,logger:this.logger})}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await ATn()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await Cf_({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
1395
1395
  `)||(r+=`
1396
1396
  `),this.stderr.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram({code:t}={}){process.exit(t??(this.didSucceed?0:1))}longestWorkspaceName;registerWorkspaces(t){let r=sws(t.map(i=>i.type==="docs"?"docs":i.workspaceName??"api"),i=>i.length);r!=null&&(this.longestWorkspaceName=r)}project;registerProject(t){this.project=t}runTask(t){return this.runTaskWithInit(this.constructTaskInit(),t)}addTask(){return this.addTaskWithInit(this.constructTaskInit())}async runTaskForWorkspace(t,r){await this.runTaskWithInit(this.constructTaskInitForWorkspace(t),r)}addTaskWithInit(t){let r=new wPa(t);return this.ttyAwareLogger.registerTask(r),r}USE_NODE_18_OR_ABOVE_MESSAGE="The Fern CLI requires Node 18+ or above.";async runTaskWithInit(t,r){let i=this.addTaskWithInit(t).start(),n;try{n=await r(i)}catch(a){throw a.message.includes("globalThis")?(i.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE),i.failWithoutThrowing()):i.failWithoutThrowing(void 0,a),new TE}finally{i.finish()}return n}async instrumentPostHogEvent(t){this.isLocal||(await ATn()).sendEvent(t)}logger=$8t((t,...r)=>this.log(t,...r));stderr=$8t((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=bp_(t.type==="docs"?"docs":t.workspaceName??"api"),i=1+(this.longestWorkspaceName!=null?bp_(this.longestWorkspaceName):r).length,n=r.padEnd(i),a=yp_[this.numTasks++%yp_.length],o=Ut.hex(a)(n);return{...this.constructTaskInit(),logPrefix:o}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===yj.Failure&&(this.didSucceed=!1)},instrumentPostHogEvent:async t=>{await this.instrumentPostHogEvent(t)},shouldBufferLogs:!1}}log(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}])}logStderr(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}],{stderr:!0})}logImmediately(t,{stderr:r=!1}={}){let i=t.filter(n=>aMi.indexOf(n.level)>=aMi.indexOf(this.logLevel));this.ttyAwareLogger.log(i,{includeDebugInfo:this.logLevel===$s.Debug,stderr:r})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let r=await qCi({cliEnvironment:this.environment,includePreReleases:t}),i=kH(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(i?"Upgrade available.":"No upgrade available."));let n={isUpgradeAvailable:i,latestVersion:r},a=await TQo({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:n,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){try{return await buc({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r,theme:{prefix:Ut.yellow("?"),style:{answer:n=>Ut.cyan(n),message:n=>Ut.bold(n),highlight:n=>Ut.cyan(n)}}})}catch(i){throw i?.name==="ExitPromptError"?(this.logger.info(`
1397
1397
  Cancelled by user.`),new TE):i}}async getInput(t){return await puc({message:t.message,default:t.default})}};function bp_(e){return`[${e}]:`}var hFt=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:i,absoluteFilePath:n,changelog:a}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=i,this.absoluteFilePath=n,this.changelog=a}};function XQo(e,t,r,i){if(typeof r!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((n,a)=>XQo.bind(null,e,a,n,i),r)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((n,a)=>a.hook.bind(null,n,i),r)():r(i))}function vp_(e,t,r,i){let n=i;e.registry[r]||(e.registry[r]=[]),t==="before"&&(i=(a,o)=>Promise.resolve().then(n.bind(null,o)).then(a.bind(null,o))),t==="after"&&(i=(a,o)=>{let c;return Promise.resolve().then(a.bind(null,o)).then(f=>(c=f,n(c,o))).then(()=>c)}),t==="error"&&(i=(a,o)=>Promise.resolve().then(a.bind(null,o)).catch(c=>n(c,o))),e.registry[r].push({hook:i,orig:n})}function gp_(e,t,r){if(!e.registry[t])return;let i=e.registry[t].map(n=>n.orig).indexOf(r);i!==-1&&e.registry[t].splice(i,1)}var Op_=Function.bind,Ap_=Op_.bind(Op_);function mp_(e,t,r){let i=Ap_(gp_,null).apply(null,r?[t,r]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(n=>{let a=r?[t,n,r]:[t,n];e[n]=e.api[n]=Ap_(vp_,null).apply(null,a)})}function b2S(){let e=Symbol("Singular"),t={registry:{}},r=XQo.bind(null,t,e);return mp_(r,t,e),r}function v2S(){let e={registry:{}},t=XQo.bind(null,e);return mp_(t,e),t}var Pp_={Singular:b2S,Collection:v2S};var g2S="0.0.0-development",O2S=`octokit-endpoint.js/${g2S} ${qR()}`,A2S={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":O2S},mediaType:{format:""}};function m2S(e){return e?Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{}):{}}function P2S(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}function Ep_(e,t){let r=Object.assign({},e);return Object.keys(t).forEach(i=>{P2S(t[i])?i in e?r[i]=Ep_(e[i],t[i]):Object.assign(r,{[i]:t[i]}):Object.assign(r,{[i]:t[i]})}),r}function jp_(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function nsc(e,t,r){if(typeof t=="string"){let[n,a]=t.split(" ");r=Object.assign(a?{method:n,url:a}:{url:n},r)}else r=Object.assign({},t);r.headers=m2S(r.headers),jp_(r),jp_(r.headers);let i=Ep_(e||{},r);return r.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(n=>!i.mediaType.previews.includes(n)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(n=>n.replace(/-preview/,""))),i}function j2S(e,t){let r=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+r+i.map(n=>n==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${n}=${encodeURIComponent(t[n])}`).join("&")}var w2S=/\{[^{}}]+\}/g;function E2S(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function S2S(e){let t=e.match(w2S);return t?t.map(E2S).reduce((r,i)=>r.concat(i),[]):[]}function wp_(e,t){let r={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(r[i]=e[i]);return r}function Sp_(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function TQn(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function UPa(e,t,r){return t=e==="+"||e==="#"?Sp_(t):TQn(t),r?TQn(r)+"="+t:t}function qQn(e){return e!=null}function isc(e){return e===";"||e==="&"||e==="?"}function M2S(e,t,r,i){var n=e[r],a=[];if(qQn(n)&&n!=="")if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")n=n.toString(),i&&i!=="*"&&(n=n.substring(0,parseInt(i,10))),a.push(UPa(t,n,isc(t)?r:""));else if(i==="*")Array.isArray(n)?n.filter(qQn).forEach(function(o){a.push(UPa(t,o,isc(t)?r:""))}):Object.keys(n).forEach(function(o){qQn(n[o])&&a.push(UPa(t,n[o],o))});else{let o=[];Array.isArray(n)?n.filter(qQn).forEach(function(c){o.push(UPa(t,c))}):Object.keys(n).forEach(function(c){qQn(n[c])&&(o.push(TQn(c)),o.push(UPa(t,n[c].toString())))}),isc(t)?a.push(TQn(r)+"="+o.join(",")):o.length!==0&&a.push(o.join(","))}else t===";"?qQn(n)&&a.push(TQn(r)):n===""&&(t==="&"||t==="?")?a.push(TQn(r)+"="):n===""&&a.push("");return a}function D2S(e){return{expand:B2S.bind(null,e)}}function B2S(e,t){var r=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,n,a){if(n){let c="",f=[];if(r.indexOf(n.charAt(0))!==-1&&(c=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(s){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);f.push(M2S(t,c,u[1],u[2]||u[3]))}),c&&c!=="+"){var o=",";return c==="?"?o="&":c!=="#"&&(o=c),(f.length!==0?c:"")+f.join(o)}else return f.join(",")}else return Sp_(a)}),e==="/"?e:e.replace(/\/$/,"")}function Mp_(e){let t=e.method.toUpperCase(),r=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),n,a=wp_(e,["method","baseUrl","url","headers","request","mediaType"]),o=S2S(r);r=D2S(r).expand(a),/^http/.test(r)||(r=e.baseUrl+r);let c=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),f=wp_(a,c);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];i.accept=u.concat(e.mediaType.previews).map(l=>{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${l}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?r=j2S(r,f):"data"in f?n=f.data:Object.keys(f).length&&(n=f),!i["content-type"]&&typeof n<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof n>"u"&&(n=""),Object.assign({method:t,url:r,headers:i},typeof n<"u"?{body:n}:null,e.request?{request:e.request}:null)}function I2S(e,t,r){return Mp_(nsc(e,t,r))}function Dp_(e,t){let r=nsc(e,t),i=I2S.bind(null,r);return Object.assign(i,{DEFAULTS:r,defaults:Dp_.bind(null,r),merge:nsc.bind(null,r),parse:Mp_})}var Bp_=Dp_(null,A2S);var zp_=ue(Tp_(),1);var yFt=class extends Error{name;status;request;response;constructor(t,r,i){super(t),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0),"response"in i&&(this.response=i.response);let n=Object.assign({},i.request);i.request.headers.authorization&&(n.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),n.url=n.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=n}};var C2S="10.0.6",q2S={headers:{"user-agent":`octokit-request.js/${C2S} ${qR()}`}};function T2S(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(e)}async function Rp_(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,n=T2S(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([l,p])=>[l,String(p)])),o;try{o=await t(e.url,{method:e.method,body:n,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(l){let p="Unknown Error";if(l instanceof Error){if(l.name==="AbortError")throw l.status=500,l;p=l.message,l.name==="TypeError"&&"cause"in l&&(l.cause instanceof Error?p=l.cause.message:typeof l.cause=="string"&&(p=l.cause))}let _=new yFt(p,500,{request:e});throw _.cause=l,_}let c=o.status,f=o.url,s={};for(let[l,p]of o.headers)s[l]=p;let u={url:f,status:c,headers:s,data:""};if("deprecation"in s){let l=s.link&&s.link.match(/<([^<>]+)>; rel="deprecation"/),p=l&&l.pop();r.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${s.sunset}${p?`. See ${p}`:""}`)}if(c===204||c===205)return u;if(e.method==="HEAD"){if(c<400)return u;throw new yFt(o.statusText,c,{response:u,request:e})}if(c===304)throw u.data=await asc(o),new yFt("Not modified",c,{response:u,request:e});if(c>=400)throw u.data=await asc(o),new yFt(z2S(u.data),c,{response:u,request:e});return u.data=i?await asc(o):o.body,u}async function asc(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(()=>"");let r=(0,zp_.safeParse)(t);if(R2S(r)){let i="";try{return i=await e.text(),JSON.parse(i)}catch{return i}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(()=>""):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function R2S(e){return e.type==="application/json"||e.type==="application/scim+json"}function z2S(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(r=>JSON.stringify(r)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function osc(e,t){let r=e.defaults(t);return Object.assign(function(n,a){let o=r.merge(n,a);if(!o.request||!o.request.hook)return Rp_(r.parse(o));let c=(f,s)=>Rp_(r.parse(r.merge(f,s)));return Object.assign(c,{endpoint:r,defaults:osc.bind(null,r)}),o.request.hook(c,o)},{endpoint:r,defaults:osc.bind(null,r)})}var VO=osc(Bp_,q2S);var N2S="0.0.0-development";function F2S(e){return`Request failed due to following response errors: