fern-api 0.56.0 → 0.56.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +3 -3
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1691,7 +1691,7 @@ ${c.indent}`:""}${_8f(o)}:${l.indent?" ":""}`;return u=!1,s=!0,l.objectItem=void
|
|
|
1691
1691
|
`}),r.replaceAll(/\n$/g,"")}function UOS(e){return e?Q_.green(Q3.radioOn):Q3.radioOff}var avo=vi(U1e(),1);function XYd(e,t){return e=String(e),t=typeof t=="string"?t:"*",e.length===0?"":Array.from({length:e.length+1}).join(t)}var Bna=class extends Z6{_run(t){this.done=t;let r=qU(this.rl),i=r.line.pipe((0,avo.map)(this.filterInput.bind(this))),n=this.handleSubmitEvents(i);return n.success.forEach(this.onEnd.bind(this)),n.error.forEach(this.onError.bind(this)),r.keypress.pipe((0,avo.takeUntil)(n.success)).forEach(this.onKeypress.bind(this)),this.render(),this}render(t){let r=this.getQuestion(),i="";r+=this.status==="answered"?this.getMaskedValue(this.answer):this.getMaskedValue(this.rl.line||""),t&&(i=`
|
|
1692
1692
|
`+Q_.red(">> ")+t),this.screen.render(r,i)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?Q_.cyan(XYd(t,this.opt.mask)):Q_.italic.dim("[hidden]"):this.opt.mask?XYd(t,this.opt.mask):Q_.italic.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 PZd=vi(HDs(),1),jZd=vi(U1e(),1);var Wna=class extends Z6{_run(t){this.done=t,this.editorResult=new jZd.Subject;let r=qU(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"?Q_.dim("Received"):Q_.dim("Press <enter> to launch your preferred editor."),t&&(r=Q_.red(">> ")+t),this.screen.render(i,r)}startExternalEditor(){this.rl.pause(),(0,PZd.editAsync)(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 TZd=vi(DZd(),1);var AZd=vi(require("readline"),1),qZd=vi(MZd(),1),BCi=class{constructor(t){this.rl||=AZd.default.createInterface(TmS(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 TmS(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 qZd.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var Hna=class extends BCi{constructor(t={}){super(t),this.log=(0,TZd.default)(this.writeLog.bind(this)),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return Sna(this.rl,this.bottomBar.split(`
|
|
1693
1693
|
`).length),this}updateBottomBar(t){return Sna(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+`
|
|
1694
|
-
`}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&&tvo(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var UZd=vi(xZd(),1),VZd=vi(Z1s(),1),WZd=vi(FZd(),1),qA=vi(U1e(),1),HZd=vi(xia(),1);var Svo=vi(U1e(),1),LZd=vi(xia(),1),Dvo=function(e,t,r){return typeof e[t]!="function"?(0,Svo.of)(e):(0,Svo.from)((0,LZd.default)(e[t])(r).then(i=>(e[t]=i,e)))};var $na={isPlainObject:UZd.default,set:WZd.default,get:VZd.default},zbn=class extends BCi{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=$na.isPlainObject(r)?{...r}:{},$na.isPlainObject(t)&&(t=Object.values(t).every(n=>$na.isPlainObject(n)&&n.name===void 0)?Object.entries(t).map(([n,a])=>({name:n,...a})):[t]);let i=Array.isArray(t)?(0,qA.from)(t):t;return this.process=i.pipe((0,qA.concatMap)(this.processQuestion.bind(this)),(0,qA.publish)()),this.process.connect(),this.process.pipe((0,qA.reduce)((n,a)=>($na.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,qA.defer)(()=>(0,qA.of)(t).pipe((0,qA.concatMap)(this.setDefaultType.bind(this)),(0,qA.concatMap)(this.filterIfRunnable.bind(this)),(0,qA.concatMap)(()=>Dvo(t,"message",this.answers)),(0,qA.concatMap)(()=>Dvo(t,"default",this.answers)),(0,qA.concatMap)(()=>Dvo(t,"choices",this.answers)),(0,qA.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,qA.defer)(()=>(0,qA.from)(this.activePrompt.run().then(i=>({name:t.name,answer:i}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,qA.defer)(()=>(0,qA.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&$na.get(this.answers,t.name)!==void 0)return(0,qA.empty)();if(t.when===!1)return(0,qA.empty)();if(typeof t.when!="function")return(0,qA.of)(t);let{answers:r}=this;return(0,qA.defer)(()=>(0,qA.from)((0,HZd.default)(t.when)(r).then(i=>{if(i)return t})).pipe((0,qA.filter)(i=>i!=null)))}};function $Zd(e){let t=function(r,i){let n;try{n=new zbn(t.prompts,e)}catch(u){return Promise.reject(u)}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",Ena),this.registerPrompt("input",SCi),this.registerPrompt("number",Mna),this.registerPrompt("confirm",Ana),this.registerPrompt("rawlist",qna),this.registerPrompt("expand",Tna),this.registerPrompt("checkbox",Cna),this.registerPrompt("password",Bna),this.registerPrompt("editor",Wna)},t.restoreDefaultPrompts(),t}var QDs=$Zd();function KmS(e,t){QDs.registerPrompt(e,t)}function YmS(){QDs.restoreDefaultPrompts()}var XmS={prompt:QDs,ui:{BottomBar:Hna,Prompt:zbn},createPromptModule:$Zd,registerPrompt:KmS,restoreDefaultPrompts:YmS,Separator:Tre},Evo=XmS;var tep=vi(GZd()),mwS="4.2.1",n8t;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",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"})(n8t||(n8t={}));function PwS(e,t){if(!e)throw new Error(t)}function jwS(e){return e?.replace(/\/+$/,"")}async function wwS(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 SwS(){return new Date().getTime()}function Qkd(){return new Date().toISOString()}function rep(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}var iaa=String.fromCharCode,Jkd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Lvo={};function DwS(e,t){if(!Lvo[e]){Lvo[e]={};for(let r=0;r<e.length;r++)Lvo[e][e.charAt(r)]=r}return Lvo[e][t]}var naa={compressToBase64:function(e){if(e==null)return"";let t=naa._compress(e,6,function(r){return Jkd.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:naa._decompress(e.length,32,function(t){return DwS(Jkd,e.charAt(t))})},compress:function(e){return naa._compress(e,16,function(t){return iaa(t)})},_compress:function(e,t,r){if(e==null)return"";let i={},n={},a=[],u,l,d="",s="",o="",c=2,b=3,g=2,O=0,m=0,w;for(w=0;w<e.length;w+=1)if(d=e.charAt(w),Object.prototype.hasOwnProperty.call(i,d)||(i[d]=b++,n[d]=!0),s=o+d,Object.prototype.hasOwnProperty.call(i,s))o=s;else{if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++),i[s]=b++,o=String(d)}if(o!==""){if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++)}for(l=2,u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;for(;;)if(O=O<<1,m==t-1){a.push(r(O));break}else m++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:naa._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},u=4,l=4,d=3,s="",o,c,b,g,O,m,w;for(o=0;o<3;o+=1)i[o]=o;for(b=0,O=Math.pow(2,2),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=iaa(b);break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=iaa(b);break;case 2:return""}for(i[3]=w,c=w,n.push(w);;){if(a.index>e)return"";for(b=0,O=Math.pow(2,d),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(w=b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=iaa(b),w=l-1,u--;break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=iaa(b),w=l-1,u--;break;case 2:return n.join("")}if(u==0&&(u=Math.pow(2,d),d++),i[w])s=i[w];else if(w===l)s=c+c.charAt(0);else return null;n.push(s),i[l++]=c+s.charAt(0),u--,c=s,u==0&&(u=Math.pow(2,d),d++)}}},BEs=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)}};var Uvo="0123456789abcdef",Vvo=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+=Uvo.charAt(this.bytes[r]>>>4),t+=Uvo.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+=Uvo.charAt(this.bytes[r]>>>4),t+=Uvo.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}},xEs=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??EwS()}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 Vvo.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,Vvo.ofInner(t)}},EwS=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),Kkd,Ykd=()=>MwS().toString(),MwS=()=>(Kkd||(Kkd=new xEs)).generate(),Wvo=class extends Error{constructor(t){super("HTTP error while fetching PostHog: "+t.status),this.response=t,this.name="PostHogFetchHttpError"}},aaa=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};function Xkd(e){return typeof e=="object"&&(e instanceof Wvo||e instanceof aaa)}var IEs=class{constructor(t,r){this.flushPromise=null,this.disableGeoip=!0,this.historicalMigration=!1,this.disabled=!1,this.defaultOptIn=!0,this.pendingPromises={},this._events=new BEs,this._isInitialized=!1,PwS(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=jwS(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.defaultOptIn=r?.defaultOptIn??!0,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:Xkd},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??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(n8t.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(n8t.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(n8t.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}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=Ykd();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)})}captureStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:i});this.enqueue("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)})}groupIdentifyStateless(t,r,i,n,a,u){this.wrap(()=>{let l=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:i||{},...u||{}}});this.enqueue("capture",l,n)})}async getDecide(t,r={},i={},n={},a={}){await this._initPromise;let u=`${this.host}/decide/?v=3`,l={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.fetchWithRetry(u,l,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(d=>d.json()).catch(d=>{this._events.emit("error",d)})}async getFeatureFlagStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagsStateless(r,i,n,a,u);if(!l)return;let d=l[t];return d===void 0&&(d=!1),d}async getFeatureFlagPayloadStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagPayloadsStateless(r,i,n,a,u);if(!l)return;let d=l[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},i={},n={},a){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a)).payloads}_parsePayload(t){try{return JSON.parse(t)}catch{return t}}async getFeatureFlagsStateless(t,r={},i={},n={},a){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a)).flags}async getFeatureFlagsAndPayloadsStateless(t,r={},i={},n={},a){await this._initPromise;let u={};(a??this.disableGeoip)&&(u.geoip_disable=!0);let l=await this.getDecide(t,r,i,n,u),d=l?.featureFlags,s=l?.featureFlagPayloads,o=s;return s&&(o=Object.fromEntries(Object.entries(s).map(([c,b])=>[c,this._parsePayload(b)]))),{flags:d,payloads:o}}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={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:i?.timestamp?i?.timestamp:Qkd(),uuid:i?.uuid?i.uuid:Ykd()};(i?.disableGeoip??this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId);let u=this.getPersistedProperty(n8t.Queue)||[];u.length>=this.maxQueueSize&&(u.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),u.push({message:n}),this.setPersistedProperty(n8t.Queue,u),this._events.emit(t,n),u.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=rep(()=>this.flushBackground(),this.flushInterval))})}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(()=>{})}async flush(){return this.flushPromise||(this.flushPromise=this._flush().finally(()=>{this.flushPromise=null}),this.addPendingPromise(this.flushPromise)),this.flushPromise}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(n8t.Queue)||[];if(!t.length)return[];let r=t.slice(0,this.maxBatchSize),i=r.map(s=>s.message),n=()=>{let s=this.getPersistedProperty(n8t.Queue)||[];this.setPersistedProperty(n8t.Queue,s.slice(r.length))},a={api_key:this.apiKey,batch:i,sent_at:Qkd()};this.historicalMigration&&(a.historical_migration=!0);let u=JSON.stringify(a),l=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${SwS()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,d=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(naa.compressToBase64(u))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:u};try{await this.fetchWithRetry(l,d)}catch(s){throw s instanceof aaa||n(),this._events.emit("error",s),s}return n(),this._events.emit("flush",i),i}async fetchWithRetry(t,r,i,n){var a;return(a=AbortSignal).timeout??(a.timeout=function(l){let d=new AbortController;return setTimeout(()=>d.abort(),l),d.signal}),await wwS(async()=>{let u=null;try{u=await this.fetch(t,{signal:AbortSignal.timeout(n??this.requestTimeout),...r})}catch(d){throw new aaa(d)}if(!(r.mode==="no-cors")&&(u.status<200||u.status>=400))throw new Wvo(u);return u},{...this._retryOptions,...i})}async shutdown(t=3e4){await this._initPromise,this.clearFlushTimer();try{await Promise.all(Object.values(this.pendingPromises));let r=Date.now()+t;for(;(this.getPersistedProperty(n8t.Queue)||[]).length!==0;){await this.flush();let n=Date.now();if(r<n)break}}catch(r){if(!Xkd(r))throw r;this.logMsgIfDebug(()=>console.error("Error while shutting down PostHog",r))}}},zEs=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},REs=typeof fetch<"u"?fetch:typeof global.fetch<"u"?global.fetch:void 0;if(!REs){let e=Gkd();REs=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 iep=REs,AwS=1152921504606847e3,qwS=["is_not"],Hvo=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},k6=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},NEs=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:u,...l}){this.debugMode=!1,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=l.fetch||iep,this.onError=l.onError,this.customHeaders=u,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let u,l;if(!this.loadedSuccessfullyOnce)return u;for(let d of this.featureFlags)if(t===d.key){l=d;break}if(l!==void 0)try{u=this.computeFlagLocally(l,r,i,n,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${u}`))}catch(d){d instanceof k6?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${d}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return u}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={},u={},l=this.featureFlags.length==0;return this.featureFlags.map(async d=>{try{let s=this.computeFlagLocally(d,t,r,i,n);a[d.key]=s;let o=await this.computeFeatureFlagPayloadLocally(d.key,s);o&&(u[d.key]=o)}catch(s){s instanceof k6||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${d.key}: ${s}`)),l=!0}}),{response:a,payloads:u,fallbackToDecide:l}}computeFlagLocally(t,r,i={},n={},a={}){if(t.ensure_experience_continuity)throw new k6("Flag has experience continuity enabled");if(!t.active)return!1;let l=(t.filters||{}).aggregation_group_type_index;if(l!=null){let d=this.groupTypeMapping[String(l)];if(!d)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${l} for feature flag ${t.key}`)),new k6("Flag has unknown group type index");if(!(d 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[d];return this.matchFeatureFlagProperties(t,i[d],s)}else return this.matchFeatureFlagProperties(t,r,n)}matchFeatureFlagProperties(t,r,i){let n=t.filters||{},a=n.groups||[],u=!1,l,d=[...a].sort((s,o)=>{let c=!!s.variant,b=!!o.variant;return c&&b?0:c?-1:b?1:0});for(let s of d)try{if(this.isConditionMatch(t,r,s,i)){let o=s.variant,c=n.multivariate?.variants||[];o&&c.some(b=>b.key===o)?l=o:l=this.getMatchingVariant(t,r)||!0;break}}catch(o){if(o instanceof k6)u=!0;else throw o}if(l!==void 0)return l;if(u)throw new k6("Can't determine if feature flag is enabled or not with given properties");return!1}isConditionMatch(t,r,i,n){let a=i.rollout_percentage,u=l=>{this.logMsgIfDebug(()=>console.warn(l))};if((i.properties||[]).length>0){for(let l of i.properties){let d=l.type,s=!1;if(d==="cohort"?s=aep(l,n,this.cohorts,this.debugMode):s=nep(l,n,u),!s)return!1}if(a==null)return!0}return!(a!=null&&Zkd(t.key,r)>a/100)}getMatchingVariant(t,r){let i=Zkd(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(l=>{n=i+l.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:l.key}),i=n}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.pollingInterval);try{let t=await this._requestFeatureFlagDefinitions();if(t&&t.status===401)throw new Hvo("Your personalApiKey is invalid. Are you sure you're not using your Project API key? More information: https://posthog.com/docs/api/overview");if(t&&t.status!==200)return;let r=await t.json();"flags"in r||this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`)),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}catch(t){t instanceof Hvo&&this.onError?.(t)}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r={method:"GET",headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}},i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=rep(()=>{n.abort()},this.timeout),r.signal=n.signal}try{return await this.fetch(t,r)}finally{clearTimeout(i)}}stopPoller(){clearTimeout(this.poller)}};function Zkd(e,t,r=""){let i=(0,tep.createHash)();return i.update(`${e}.${t}${r}`),parseInt(i.digest("hex").slice(0,15),16)/AwS}function nep(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 k6("Operator is_not_set is not supported")}else throw new k6(`Property ${i} not found in propertyValues`);let u=t[i];if(u==null&&!qwS.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function l(s,o){return Array.isArray(s)?s.map(c=>String(c).toLowerCase()).includes(String(o).toLowerCase()):String(s).toLowerCase()===String(o).toLowerCase()}function d(s,o,c){if(c==="gt")return s>o;if(c==="gte")return s>=o;if(c==="lt")return s<o;if(c==="lte")return s<=o;throw new Error(`Invalid operator: ${c}`)}switch(a){case"exact":return l(n,u);case"is_not":return!l(n,u);case"is_set":return i in t;case"icontains":return String(u).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(u).toLowerCase().includes(String(n).toLowerCase());case"regex":return kkd(String(n))&&String(u).match(String(n))!==null;case"not_regex":return kkd(String(n))&&String(u).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&&u!=null?typeof u=="string"?d(u,String(n),a):d(u,s,a):d(String(u),String(n),a)}case"is_date_after":case"is_date_before":{let s=TwS(String(n));if(s==null&&(s=eep(n)),s==null)throw new k6(`Invalid date: ${n}`);let o=eep(u);return["is_date_before"].includes(a)?o<s:o>s}default:throw new k6(`Unknown operator: ${a}`)}}function aep(e,t,r,i=!1){let n=String(e.value);if(!(n in r))throw new k6("can't match cohort without a given cohort property value");let a=r[n];return oep(a,t,r,i)}function oep(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let u=!1;if("values"in a[0]){for(let l of a)try{let d=oep(l,t,r,i);if(n==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof k6)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new k6("Can't match cohort without a given cohort property value");return n==="AND"}else{for(let l of a)try{let d;l.type==="cohort"?d=aep(l,t,r,i):d=nep(l,t);let s=l.negation||!1;if(n==="AND"){if(!d&&!s||d&&s)return!1}else if(d&&!s||!d&&s)return!0}catch(d){if(d instanceof k6)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new k6("can't match cohort without a given cohort property value");return n==="AND"}}function kkd(e){try{return new RegExp(e),!0}catch{return!1}}function eep(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 k6(`${e} is in an invalid date format`)}else throw new k6(`The date provided ${e} must be a string, number, or date object`)}function TwS(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 CwS=30*1e3,BwS=50*1e3,Wbn=class extends IEs{constructor(t,r={}){super(t,r),this._memoryStorage=new zEs,this.options=r,r.personalApiKey&&(this.featureFlagsPoller=new NEs({pollingInterval:typeof r.featureFlagsPollingInterval=="number"?r.featureFlagsPollingInterval:CwS,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},customHeaders:this.getCustomHeaders()})),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||BwS}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):iep(t,r)}getLibraryId(){return"posthog-node"}getLibraryVersion(){return mwS}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({distinctId:t,event:r,properties:i,groups:n,sendFeatureFlags:a,timestamp:u,disableGeoip:l,uuid:d}){let s=b=>{super.captureStateless(t,r,b,{timestamp:u,disableGeoip:l,uuid:d})},o=(b,g,O)=>super.getFeatureFlagsStateless(b,g,void 0,void 0,O),c=Promise.resolve().then(async()=>{if(a)return await o(t,n,l);if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let b={};for(let[g,O]of Object.entries(n||{}))b[g]=String(O);return await this.getAllFlags(t,{groups:b,disableGeoip:l,onlyEvaluateLocally:!0})}return{}}).then(b=>{let g={};if(b)for(let[m,w]of Object.entries(b))g[`$feature/${m}`]=w;let O=Object.keys(b||{}).filter(m=>b?.[m]!==!1);return O.length>0&&(g.$active_feature_flags=O),g}).catch(()=>({})).then(b=>{s({...b,...i,$groups:n})});this.addPendingPromise(c)}identify({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set||r;super.identifyStateless(t,{$set:n},{disableGeoip:i})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async getFeatureFlag(t,r,i){let{groups:n,disableGeoip:a}=i||{},{onlyEvaluateLocally:u,sendFeatureFlagEvents:l,personProperties:d,groupProperties:s}=i||{},o=this.addLocalPersonAndGroupProperties(r,n,d,s);d=o.allPersonProperties,s=o.allGroupProperties,u==null&&(u=!1),l==null&&(l=!0);let c=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,d,s),b=c!==void 0;!b&&!u&&(c=await super.getFeatureFlagStateless(t,r,n,d,s,a));let g=`${t}_${c}`;return l&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(g))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(g):this.distinctIdHasSentFlagCalls[r]=[g],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:c,locally_evaluated:b,[`$feature/${t}`]:c},groups:n,disableGeoip:a})),c}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:u}=n||{},{onlyEvaluateLocally:l,sendFeatureFlagEvents:d,personProperties:s,groupProperties:o}=n||{},c=this.addLocalPersonAndGroupProperties(r,a,s,o);s=c.allPersonProperties,o=c.allGroupProperties;let b;return i||(i=await this.getFeatureFlag(t,r,{...n,onlyEvaluateLocally:!0})),i&&(b=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,i)),l==null&&(l=!1),d==null&&(d=!0),l==null&&(l=!1),!(b!==void 0)&&!l&&(b=await super.getFeatureFlagPayloadStateless(t,r,a,s,o,u)),b}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:u,groupProperties:l}=r||{},d=this.addLocalPersonAndGroupProperties(t,i,u,l);u=d.allPersonProperties,l=d.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,u,l),o={},c={},b=!0;if(s&&(o=s.response,c=s.payloads,b=s.fallbackToDecide),b&&!a){let g=await super.getFeatureFlagsAndPayloadsStateless(t,i,u,l,n);o={...o,...g.flags||{}},c={...c,...g.payloads||{}}}return{featureFlags:o,featureFlagPayloads:c}}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||{}},u={};if(r)for(let l of Object.keys(r))u[l]={$group_key:r[l],...n?.[l]||{}};return{allPersonProperties:a,allGroupProperties:u}}},FEs=class e{constructor(t,r,i,n){this.posthog=t,this.posthogHost=r,this.organization=i,this.prefix=n,this.name="posthog-node",this.posthogHost=t.options.host??"https://us.i.posthog.com"}setupOnce(t,r){t(i=>{if(i.exception?.values===void 0||i.exception.values.length===0)return i;i.tags||(i.tags={});let n=r(),a=i.tags[e.POSTHOG_ID_TAG];if(a===void 0)return i;i.tags["PostHog Person URL"]=new URL(`/person/${a}`,this.posthogHost).toString();let u={$exception_message:i.exception.values[0]?.value,$exception_type:i.exception.values[0]?.type,$exception_personURL:i.tags["PostHog Person URL"],$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:i.exception.values[0]?.value,$sentry_exception_type:i.exception.values[0]?.type,$sentry_tags:i.tags},l=n.getClient()?.getDsn()?.projectId;return this.organization!==void 0&&l!==void 0&&i.event_id!==void 0&&(u.$sentry_url=`${this.prefix??"https://sentry.io/organizations"}/${this.organization}/issues/?project=${l}&query=${i.event_id}`),this.posthog.capture({event:"$exception",distinctId:a,properties:u}),i})}};FEs.POSTHOG_ID_TAG="posthog_distinct_id";var $vo=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Wbn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.56.0",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var oaa=class{async sendEvent(){}async identify(){}async flush(){}};var Hbn=require("fs/promises"),lep=require("os"),fep=require("path");var uep=vi(require("crypto")),Qvo=new Uint8Array(256),Gvo=Qvo.length;function LEs(){return Gvo>Qvo.length-16&&(uep.default.randomFillSync(Qvo),Gvo=0),Qvo.slice(Gvo,Gvo+=16)}var BU=[];for(let e=0;e<256;++e)BU.push((e+256).toString(16).slice(1));function sep(e,t=0){return BU[e[t+0]]+BU[e[t+1]]+BU[e[t+2]]+BU[e[t+3]]+"-"+BU[e[t+4]]+BU[e[t+5]]+"-"+BU[e[t+6]]+BU[e[t+7]]+"-"+BU[e[t+8]]+BU[e[t+9]]+"-"+BU[e[t+10]]+BU[e[t+11]]+BU[e[t+12]]+BU[e[t+13]]+BU[e[t+14]]+BU[e[t+15]]}var cep=vi(require("crypto")),UEs={randomUUID:cep.default.randomUUID};function xwS(e,t,r){if(UEs.randomUUID&&!t&&!e)return UEs.randomUUID();e=e||{};let i=e.random||(e.rng||LEs)();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 sep(i)}var zre=xwS;var IwS="id",zwS=".fern",uaa=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new Wbn(r),this.userId=t==null?void 0:tms(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:"0.56.0",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Xu(Wl.of((0,lep.homedir)()),Xa.of(zwS),Xa.of(IwS));await Cf(t)||(await(0,Hbn.mkdir)((0,fep.dirname)(t),{recursive:!0}),await(0,Hbn.writeFile)(t,zre())),this.persistedDistinctId=(await(0,Hbn.readFile)(t)).toString()}return this.persistedDistinctId}};var VEs;async function $bn(){return VEs==null&&(VEs=await RwS()),VEs}async function RwS(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new oaa;let r=await tfo();return r!=null?new uaa({token:r,posthogApiKey:e}):await efo()!=null?new $vo({posthogApiKey:e}):new uaa({token:void 0,posthogApiKey:e})}catch{return new oaa}}function saa(e,t){return function(){return e.apply(t,arguments)}}var{toString:NwS}=Object.prototype,{getPrototypeOf:$Es}=Object,Kvo=(e=>t=>{let r=NwS.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),a8t=e=>(e=e.toLowerCase(),t=>Kvo(t)===e),Yvo=e=>t=>typeof t===e,{isArray:Gbn}=Array,caa=Yvo("undefined");function FwS(e){return e!==null&&!caa(e)&&e.constructor!==null&&!caa(e.constructor)&&W1e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var _ep=a8t("ArrayBuffer");function LwS(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_ep(e.buffer),t}var UwS=Yvo("string"),W1e=Yvo("function"),hep=Yvo("number"),Xvo=e=>e!==null&&typeof e=="object",VwS=e=>e===!0||e===!1,Jvo=e=>{if(Kvo(e)!=="object")return!1;let t=$Es(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},WwS=a8t("Date"),HwS=a8t("File"),$wS=a8t("Blob"),GwS=a8t("FileList"),QwS=e=>Xvo(e)&&W1e(e.pipe),JwS=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||W1e(e.append)&&((t=Kvo(e))==="formdata"||t==="object"&&W1e(e.toString)&&e.toString()==="[object FormData]"))},KwS=a8t("URLSearchParams"),[YwS,XwS,ZwS,kwS]=["ReadableStream","Request","Response","Headers"].map(a8t),e1S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function laa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),Gbn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,l;for(i=0;i<u;i++)l=a[i],t.call(null,e[l],l,e)}}function yep(e,t){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 RCi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vep=e=>!caa(e)&&e!==RCi;function HEs(){let{caseless:e}=vep(this)&&this||{},t={},r=(i,n)=>{let a=e&&yep(t,n)||n;Jvo(t[a])&&Jvo(i)?t[a]=HEs(t[a],i):Jvo(i)?t[a]=HEs({},i):Gbn(i)?t[a]=i.slice():t[a]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&laa(arguments[i],r);return t}var t1S=(e,t,r,{allOwnKeys:i}={})=>(laa(t,(n,a)=>{r&&W1e(n)?e[a]=saa(n,r):e[a]=n},{allOwnKeys:i}),e),r1S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),i1S=(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)},n1S=(e,t,r,i)=>{let n,a,u,l={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)u=n[a],(!i||i(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=r!==!1&&$Es(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},a1S=(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},o1S=e=>{if(!e)return null;if(Gbn(e))return e;let t=e.length;if(!hep(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},u1S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$Es(Uint8Array)),s1S=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},c1S=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},l1S=a8t("HTMLFormElement"),f1S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),dep=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),d1S=a8t("RegExp"),bep=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};laa(r,(n,a)=>{let u;(u=t(n,a,e))!==!1&&(i[a]=u||n)}),Object.defineProperties(e,i)},p1S=e=>{bep(e,(t,r)=>{if(W1e(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(W1e(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+"'")})}})},_1S=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return Gbn(e)?i(e):i(String(e).split(t)),r},h1S=()=>{},y1S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,WEs="abcdefghijklmnopqrstuvwxyz",pep="0123456789",gep={DIGIT:pep,ALPHA:WEs,ALPHA_DIGIT:WEs+WEs.toUpperCase()+pep},v1S=(e=16,t=gep.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function b1S(e){return!!(e&&W1e(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var g1S=e=>{let t=new Array(10),r=(i,n)=>{if(Xvo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let a=Gbn(i)?[]:{};return laa(i,(u,l)=>{let d=r(u,n+1);!caa(d)&&(a[l]=d)}),t[n]=void 0,a}}return i};return r(e,0)},O1S=a8t("AsyncFunction"),m1S=e=>e&&(Xvo(e)||W1e(e))&&W1e(e.then)&&W1e(e.catch),Oep=((e,t)=>e?setImmediate:t?((r,i)=>(RCi.addEventListener("message",({source:n,data:a})=>{n===RCi&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),RCi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",W1e(RCi.postMessage)),P1S=typeof queueMicrotask<"u"?queueMicrotask.bind(RCi):typeof process<"u"&&process.nextTick||Oep,us={isArray:Gbn,isArrayBuffer:_ep,isBuffer:FwS,isFormData:JwS,isArrayBufferView:LwS,isString:UwS,isNumber:hep,isBoolean:VwS,isObject:Xvo,isPlainObject:Jvo,isReadableStream:YwS,isRequest:XwS,isResponse:ZwS,isHeaders:kwS,isUndefined:caa,isDate:WwS,isFile:HwS,isBlob:$wS,isRegExp:d1S,isFunction:W1e,isStream:QwS,isURLSearchParams:KwS,isTypedArray:u1S,isFileList:GwS,forEach:laa,merge:HEs,extend:t1S,trim:e1S,stripBOM:r1S,inherits:i1S,toFlatObject:n1S,kindOf:Kvo,kindOfTest:a8t,endsWith:a1S,toArray:o1S,forEachEntry:s1S,matchAll:c1S,isHTMLForm:l1S,hasOwnProperty:dep,hasOwnProp:dep,reduceDescriptors:bep,freezeMethods:p1S,toObjectSet:_1S,toCamelCase:f1S,noop:h1S,toFiniteNumber:y1S,findKey:yep,global:RCi,isContextDefined:vep,ALPHABET:gep,generateString:v1S,isSpecCompliantForm:b1S,toJSONObject:g1S,isAsyncFn:O1S,isThenable:m1S,setImmediate:Oep,asap:P1S};function Qbn(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)}us.inherits(Qbn,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:us.toJSONObject(this.config),code:this.code,status:this.status}}});var mep=Qbn.prototype,Pep={};["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=>{Pep[e]={value:e}});Object.defineProperties(Qbn,Pep);Object.defineProperty(mep,"isAxiosError",{value:!0});Qbn.from=(e,t,r,i,n,a)=>{let u=Object.create(mep);return us.toFlatObject(e,u,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),Qbn.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};var mp=Qbn;var jep=vi(JZn(),1),Zvo=jep.default;function GEs(e){return us.isPlainObject(e)||us.isArray(e)}function Sep(e){return us.endsWith(e,"[]")?e.slice(0,-2):e}function wep(e,t,r){return e?e.concat(t).map(function(n,a){return n=Sep(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function j1S(e){return us.isArray(e)&&!e.some(GEs)}var w1S=us.toFlatObject(us,{},null,function(t){return/^is[A-Z]/.test(t)});function S1S(e,t,r){if(!us.isObject(e))throw new TypeError("target must be an object");t=t||new(Zvo||FormData),r=us.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!us.isUndefined(w[m])});let i=r.metaTokens,n=r.visitor||o,a=r.dots,u=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&us.isSpecCompliantForm(t);if(!us.isFunction(n))throw new TypeError("visitor must be a function");function s(O){if(O===null)return"";if(us.isDate(O))return O.toISOString();if(!d&&us.isBlob(O))throw new mp("Blob is not supported. Use a Buffer instead.");return us.isArrayBuffer(O)||us.isTypedArray(O)?d&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function o(O,m,w){let E=O;if(O&&!w&&typeof O=="object"){if(us.endsWith(m,"{}"))m=i?m:m.slice(0,-2),O=JSON.stringify(O);else if(us.isArray(O)&&j1S(O)||(us.isFileList(O)||us.endsWith(m,"[]"))&&(E=us.toArray(O)))return m=Sep(m),E.forEach(function(q,D){!(us.isUndefined(q)||q===null)&&t.append(u===!0?wep([m],D,a):u===null?m:m+"[]",s(q))}),!1}return GEs(O)?!0:(t.append(wep(w,m,a),s(O)),!1)}let c=[],b=Object.assign(w1S,{defaultVisitor:o,convertValue:s,isVisitable:GEs});function g(O,m){if(!us.isUndefined(O)){if(c.indexOf(O)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(O),us.forEach(O,function(E,A){(!(us.isUndefined(E)||E===null)&&n.call(t,E,us.isString(A)?A.trim():A,m,b))===!0&&g(E,m?m.concat(A):[A])}),c.pop()}}if(!us.isObject(e))throw new TypeError("data must be an object");return g(e),t}var Esi=S1S;function Dep(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Eep(e,t){this._pairs=[],e&&Esi(e,this,t)}var Mep=Eep.prototype;Mep.append=function(t,r){this._pairs.push([t,r])};Mep.toString=function(t){let r=t?function(i){return t.call(this,i,Dep)}:Dep;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var Aep=Eep;function D1S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NCi(e,t,r){if(!t)return e;let i=r&&r.encode||D1S,n=r&&r.serialize,a;if(n?a=n(t,r):a=us.isURLSearchParams(t)?t.toString():new Aep(t,r).toString(i),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var QEs=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){us.forEach(this.handlers,function(i){i!==null&&t(i)})}},JEs=QEs;var Jbn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var qep=vi(require("url"),1),Tep=qep.default.URLSearchParams;var Cep={isNode:!0,classes:{URLSearchParams:Tep,FormData:Zvo,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var XEs={};Io(XEs,{hasBrowserEnv:()=>YEs,hasStandardBrowserEnv:()=>E1S,hasStandardBrowserWebWorkerEnv:()=>M1S,navigator:()=>KEs,origin:()=>A1S});var YEs=typeof window<"u"&&typeof document<"u",KEs=typeof navigator=="object"&&navigator||void 0,E1S=YEs&&(!KEs||["ReactNative","NativeScript","NS"].indexOf(KEs.product)<0),M1S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A1S=YEs&&window.location.href||"http://localhost";var NT={...XEs,...Cep};function ZEs(e,t){return Esi(e,new NT.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,a){return NT.isNode&&us.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function q1S(e){return us.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function T1S(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 C1S(e){function t(r,i,n,a){let u=r[a++];if(u==="__proto__")return!0;let l=Number.isFinite(+u),d=a>=r.length;return u=!u&&us.isArray(n)?n.length:u,d?(us.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!l):((!n[u]||!us.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],a)&&us.isArray(n[u])&&(n[u]=T1S(n[u])),!l)}if(us.isFormData(e)&&us.isFunction(e.entries)){let r={};return us.forEachEntry(e,(i,n)=>{t(q1S(i),n,r,0)}),r}return null}var kvo=C1S;function B1S(e,t,r){if(us.isString(e))try{return(t||JSON.parse)(e),us.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var kEs={transitional:Jbn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=us.isObject(t);if(a&&us.isHTMLForm(t)&&(t=new FormData(t)),us.isFormData(t))return n?JSON.stringify(kvo(t)):t;if(us.isArrayBuffer(t)||us.isBuffer(t)||us.isStream(t)||us.isFile(t)||us.isBlob(t)||us.isReadableStream(t))return t;if(us.isArrayBufferView(t))return t.buffer;if(us.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return ZEs(t,this.formSerializer).toString();if((l=us.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return Esi(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),B1S(t)):t}],transformResponse:[function(t){let r=this.transitional||kEs.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(us.isResponse(t)||us.isReadableStream(t))return t;if(t&&us.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(l){if(u)throw l.name==="SyntaxError"?mp.from(l,mp.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:NT.classes.FormData,Blob:NT.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};us.forEach(["delete","get","head","post","put","patch"],e=>{kEs.headers[e]={}});var Kbn=kEs;var x1S=us.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"]),Bep=e=>{let t={},r,i,n;return e&&e.split(`
|
|
1694
|
+
`}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&&tvo(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var UZd=vi(xZd(),1),VZd=vi(Z1s(),1),WZd=vi(FZd(),1),qA=vi(U1e(),1),HZd=vi(xia(),1);var Svo=vi(U1e(),1),LZd=vi(xia(),1),Dvo=function(e,t,r){return typeof e[t]!="function"?(0,Svo.of)(e):(0,Svo.from)((0,LZd.default)(e[t])(r).then(i=>(e[t]=i,e)))};var $na={isPlainObject:UZd.default,set:WZd.default,get:VZd.default},zbn=class extends BCi{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=$na.isPlainObject(r)?{...r}:{},$na.isPlainObject(t)&&(t=Object.values(t).every(n=>$na.isPlainObject(n)&&n.name===void 0)?Object.entries(t).map(([n,a])=>({name:n,...a})):[t]);let i=Array.isArray(t)?(0,qA.from)(t):t;return this.process=i.pipe((0,qA.concatMap)(this.processQuestion.bind(this)),(0,qA.publish)()),this.process.connect(),this.process.pipe((0,qA.reduce)((n,a)=>($na.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,qA.defer)(()=>(0,qA.of)(t).pipe((0,qA.concatMap)(this.setDefaultType.bind(this)),(0,qA.concatMap)(this.filterIfRunnable.bind(this)),(0,qA.concatMap)(()=>Dvo(t,"message",this.answers)),(0,qA.concatMap)(()=>Dvo(t,"default",this.answers)),(0,qA.concatMap)(()=>Dvo(t,"choices",this.answers)),(0,qA.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,qA.defer)(()=>(0,qA.from)(this.activePrompt.run().then(i=>({name:t.name,answer:i}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,qA.defer)(()=>(0,qA.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&$na.get(this.answers,t.name)!==void 0)return(0,qA.empty)();if(t.when===!1)return(0,qA.empty)();if(typeof t.when!="function")return(0,qA.of)(t);let{answers:r}=this;return(0,qA.defer)(()=>(0,qA.from)((0,HZd.default)(t.when)(r).then(i=>{if(i)return t})).pipe((0,qA.filter)(i=>i!=null)))}};function $Zd(e){let t=function(r,i){let n;try{n=new zbn(t.prompts,e)}catch(u){return Promise.reject(u)}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",Ena),this.registerPrompt("input",SCi),this.registerPrompt("number",Mna),this.registerPrompt("confirm",Ana),this.registerPrompt("rawlist",qna),this.registerPrompt("expand",Tna),this.registerPrompt("checkbox",Cna),this.registerPrompt("password",Bna),this.registerPrompt("editor",Wna)},t.restoreDefaultPrompts(),t}var QDs=$Zd();function KmS(e,t){QDs.registerPrompt(e,t)}function YmS(){QDs.restoreDefaultPrompts()}var XmS={prompt:QDs,ui:{BottomBar:Hna,Prompt:zbn},createPromptModule:$Zd,registerPrompt:KmS,restoreDefaultPrompts:YmS,Separator:Tre},Evo=XmS;var tep=vi(GZd()),mwS="4.2.1",n8t;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",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"})(n8t||(n8t={}));function PwS(e,t){if(!e)throw new Error(t)}function jwS(e){return e?.replace(/\/+$/,"")}async function wwS(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 SwS(){return new Date().getTime()}function Qkd(){return new Date().toISOString()}function rep(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}var iaa=String.fromCharCode,Jkd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Lvo={};function DwS(e,t){if(!Lvo[e]){Lvo[e]={};for(let r=0;r<e.length;r++)Lvo[e][e.charAt(r)]=r}return Lvo[e][t]}var naa={compressToBase64:function(e){if(e==null)return"";let t=naa._compress(e,6,function(r){return Jkd.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:naa._decompress(e.length,32,function(t){return DwS(Jkd,e.charAt(t))})},compress:function(e){return naa._compress(e,16,function(t){return iaa(t)})},_compress:function(e,t,r){if(e==null)return"";let i={},n={},a=[],u,l,d="",s="",o="",c=2,b=3,g=2,O=0,m=0,w;for(w=0;w<e.length;w+=1)if(d=e.charAt(w),Object.prototype.hasOwnProperty.call(i,d)||(i[d]=b++,n[d]=!0),s=o+d,Object.prototype.hasOwnProperty.call(i,s))o=s;else{if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++),i[s]=b++,o=String(d)}if(o!==""){if(Object.prototype.hasOwnProperty.call(n,o)){if(o.charCodeAt(0)<256){for(u=0;u<g;u++)O=O<<1,m==t-1?(m=0,a.push(r(O)),O=0):m++;for(l=o.charCodeAt(0),u=0;u<8;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}else{for(l=1,u=0;u<g;u++)O=O<<1|l,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=0;for(l=o.charCodeAt(0),u=0;u<16;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1}c--,c==0&&(c=Math.pow(2,g),g++),delete n[o]}else for(l=i[o],u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;c--,c==0&&(c=Math.pow(2,g),g++)}for(l=2,u=0;u<g;u++)O=O<<1|l&1,m==t-1?(m=0,a.push(r(O)),O=0):m++,l=l>>1;for(;;)if(O=O<<1,m==t-1){a.push(r(O));break}else m++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:naa._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},u=4,l=4,d=3,s="",o,c,b,g,O,m,w;for(o=0;o<3;o+=1)i[o]=o;for(b=0,O=Math.pow(2,2),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=iaa(b);break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;w=iaa(b);break;case 2:return""}for(i[3]=w,c=w,n.push(w);;){if(a.index>e)return"";for(b=0,O=Math.pow(2,d),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;switch(w=b){case 0:for(b=0,O=Math.pow(2,8),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=iaa(b),w=l-1,u--;break;case 1:for(b=0,O=Math.pow(2,16),m=1;m!=O;)g=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),b|=(g>0?1:0)*m,m<<=1;i[l++]=iaa(b),w=l-1,u--;break;case 2:return n.join("")}if(u==0&&(u=Math.pow(2,d),d++),i[w])s=i[w];else if(w===l)s=c+c.charAt(0);else return null;n.push(s),i[l++]=c+s.charAt(0),u--,c=s,u==0&&(u=Math.pow(2,d),d++)}}},BEs=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)}};var Uvo="0123456789abcdef",Vvo=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+=Uvo.charAt(this.bytes[r]>>>4),t+=Uvo.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+=Uvo.charAt(this.bytes[r]>>>4),t+=Uvo.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}},xEs=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??EwS()}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 Vvo.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,Vvo.ofInner(t)}},EwS=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),Kkd,Ykd=()=>MwS().toString(),MwS=()=>(Kkd||(Kkd=new xEs)).generate(),Wvo=class extends Error{constructor(t){super("HTTP error while fetching PostHog: "+t.status),this.response=t,this.name="PostHogFetchHttpError"}},aaa=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};function Xkd(e){return typeof e=="object"&&(e instanceof Wvo||e instanceof aaa)}var IEs=class{constructor(t,r){this.flushPromise=null,this.disableGeoip=!0,this.historicalMigration=!1,this.disabled=!1,this.defaultOptIn=!0,this.pendingPromises={},this._events=new BEs,this._isInitialized=!1,PwS(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=jwS(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.defaultOptIn=r?.defaultOptIn??!0,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:Xkd},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??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(n8t.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(n8t.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(n8t.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}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=Ykd();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)})}captureStateless(t,r,i,n){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:i});this.enqueue("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)})}groupIdentifyStateless(t,r,i,n,a,u){this.wrap(()=>{let l=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:i||{},...u||{}}});this.enqueue("capture",l,n)})}async getDecide(t,r={},i={},n={},a={}){await this._initPromise;let u=`${this.host}/decide/?v=3`,l={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.fetchWithRetry(u,l,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(d=>d.json()).catch(d=>{this._events.emit("error",d)})}async getFeatureFlagStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagsStateless(r,i,n,a,u);if(!l)return;let d=l[t];return d===void 0&&(d=!1),d}async getFeatureFlagPayloadStateless(t,r,i={},n={},a={},u){await this._initPromise;let l=await this.getFeatureFlagPayloadsStateless(r,i,n,a,u);if(!l)return;let d=l[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},i={},n={},a){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a)).payloads}_parsePayload(t){try{return JSON.parse(t)}catch{return t}}async getFeatureFlagsStateless(t,r={},i={},n={},a){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,i,n,a)).flags}async getFeatureFlagsAndPayloadsStateless(t,r={},i={},n={},a){await this._initPromise;let u={};(a??this.disableGeoip)&&(u.geoip_disable=!0);let l=await this.getDecide(t,r,i,n,u),d=l?.featureFlags,s=l?.featureFlagPayloads,o=s;return s&&(o=Object.fromEntries(Object.entries(s).map(([c,b])=>[c,this._parsePayload(b)]))),{flags:d,payloads:o}}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={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:i?.timestamp?i?.timestamp:Qkd(),uuid:i?.uuid?i.uuid:Ykd()};(i?.disableGeoip??this.disableGeoip)&&(n.properties||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId);let u=this.getPersistedProperty(n8t.Queue)||[];u.length>=this.maxQueueSize&&(u.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),u.push({message:n}),this.setPersistedProperty(n8t.Queue,u),this._events.emit(t,n),u.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=rep(()=>this.flushBackground(),this.flushInterval))})}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(()=>{})}async flush(){return this.flushPromise||(this.flushPromise=this._flush().finally(()=>{this.flushPromise=null}),this.addPendingPromise(this.flushPromise)),this.flushPromise}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(n8t.Queue)||[];if(!t.length)return[];let r=t.slice(0,this.maxBatchSize),i=r.map(s=>s.message),n=()=>{let s=this.getPersistedProperty(n8t.Queue)||[];this.setPersistedProperty(n8t.Queue,s.slice(r.length))},a={api_key:this.apiKey,batch:i,sent_at:Qkd()};this.historicalMigration&&(a.historical_migration=!0);let u=JSON.stringify(a),l=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${SwS()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,d=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(naa.compressToBase64(u))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:u};try{await this.fetchWithRetry(l,d)}catch(s){throw s instanceof aaa||n(),this._events.emit("error",s),s}return n(),this._events.emit("flush",i),i}async fetchWithRetry(t,r,i,n){var a;return(a=AbortSignal).timeout??(a.timeout=function(l){let d=new AbortController;return setTimeout(()=>d.abort(),l),d.signal}),await wwS(async()=>{let u=null;try{u=await this.fetch(t,{signal:AbortSignal.timeout(n??this.requestTimeout),...r})}catch(d){throw new aaa(d)}if(!(r.mode==="no-cors")&&(u.status<200||u.status>=400))throw new Wvo(u);return u},{...this._retryOptions,...i})}async shutdown(t=3e4){await this._initPromise,this.clearFlushTimer();try{await Promise.all(Object.values(this.pendingPromises));let r=Date.now()+t;for(;(this.getPersistedProperty(n8t.Queue)||[]).length!==0;){await this.flush();let n=Date.now();if(r<n)break}}catch(r){if(!Xkd(r))throw r;this.logMsgIfDebug(()=>console.error("Error while shutting down PostHog",r))}}},zEs=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},REs=typeof fetch<"u"?fetch:typeof global.fetch<"u"?global.fetch:void 0;if(!REs){let e=Gkd();REs=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 iep=REs,AwS=1152921504606847e3,qwS=["is_not"],Hvo=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},k6=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},NEs=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:i,timeout:n,host:a,customHeaders:u,...l}){this.debugMode=!1,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=l.fetch||iep,this.onError=l.onError,this.customHeaders=u,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,i={},n={},a={}){await this.loadFeatureFlags();let u,l;if(!this.loadedSuccessfullyOnce)return u;for(let d of this.featureFlags)if(t===d.key){l=d;break}if(l!==void 0)try{u=this.computeFlagLocally(l,r,i,n,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${u}`))}catch(d){d instanceof k6?this.logMsgIfDebug(()=>console.debug(`InconclusiveMatchError when computing flag locally: ${t}: ${d}`)):d instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${d}`))}return u}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={},u={},l=this.featureFlags.length==0;return this.featureFlags.map(async d=>{try{let s=this.computeFlagLocally(d,t,r,i,n);a[d.key]=s;let o=await this.computeFeatureFlagPayloadLocally(d.key,s);o&&(u[d.key]=o)}catch(s){s instanceof k6||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${d.key}: ${s}`)),l=!0}}),{response:a,payloads:u,fallbackToDecide:l}}computeFlagLocally(t,r,i={},n={},a={}){if(t.ensure_experience_continuity)throw new k6("Flag has experience continuity enabled");if(!t.active)return!1;let l=(t.filters||{}).aggregation_group_type_index;if(l!=null){let d=this.groupTypeMapping[String(l)];if(!d)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${l} for feature flag ${t.key}`)),new k6("Flag has unknown group type index");if(!(d 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[d];return this.matchFeatureFlagProperties(t,i[d],s)}else return this.matchFeatureFlagProperties(t,r,n)}matchFeatureFlagProperties(t,r,i){let n=t.filters||{},a=n.groups||[],u=!1,l,d=[...a].sort((s,o)=>{let c=!!s.variant,b=!!o.variant;return c&&b?0:c?-1:b?1:0});for(let s of d)try{if(this.isConditionMatch(t,r,s,i)){let o=s.variant,c=n.multivariate?.variants||[];o&&c.some(b=>b.key===o)?l=o:l=this.getMatchingVariant(t,r)||!0;break}}catch(o){if(o instanceof k6)u=!0;else throw o}if(l!==void 0)return l;if(u)throw new k6("Can't determine if feature flag is enabled or not with given properties");return!1}isConditionMatch(t,r,i,n){let a=i.rollout_percentage,u=l=>{this.logMsgIfDebug(()=>console.warn(l))};if((i.properties||[]).length>0){for(let l of i.properties){let d=l.type,s=!1;if(d==="cohort"?s=aep(l,n,this.cohorts,this.debugMode):s=nep(l,n,u),!s)return!1}if(a==null)return!0}return!(a!=null&&Zkd(t.key,r)>a/100)}getMatchingVariant(t,r){let i=Zkd(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(l=>{n=i+l.rollout_percentage/100,r.push({valueMin:i,valueMax:n,key:l.key}),i=n}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.pollingInterval);try{let t=await this._requestFeatureFlagDefinitions();if(t&&t.status===401)throw new Hvo("Your personalApiKey is invalid. Are you sure you're not using your Project API key? More information: https://posthog.com/docs/api/overview");if(t&&t.status!==200)return;let r=await t.json();"flags"in r||this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`)),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}catch(t){t instanceof Hvo&&this.onError?.(t)}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r={method:"GET",headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}},i=null;if(this.timeout&&typeof this.timeout=="number"){let n=new AbortController;i=rep(()=>{n.abort()},this.timeout),r.signal=n.signal}try{return await this.fetch(t,r)}finally{clearTimeout(i)}}stopPoller(){clearTimeout(this.poller)}};function Zkd(e,t,r=""){let i=(0,tep.createHash)();return i.update(`${e}.${t}${r}`),parseInt(i.digest("hex").slice(0,15),16)/AwS}function nep(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 k6("Operator is_not_set is not supported")}else throw new k6(`Property ${i} not found in propertyValues`);let u=t[i];if(u==null&&!qwS.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function l(s,o){return Array.isArray(s)?s.map(c=>String(c).toLowerCase()).includes(String(o).toLowerCase()):String(s).toLowerCase()===String(o).toLowerCase()}function d(s,o,c){if(c==="gt")return s>o;if(c==="gte")return s>=o;if(c==="lt")return s<o;if(c==="lte")return s<=o;throw new Error(`Invalid operator: ${c}`)}switch(a){case"exact":return l(n,u);case"is_not":return!l(n,u);case"is_set":return i in t;case"icontains":return String(u).toLowerCase().includes(String(n).toLowerCase());case"not_icontains":return!String(u).toLowerCase().includes(String(n).toLowerCase());case"regex":return kkd(String(n))&&String(u).match(String(n))!==null;case"not_regex":return kkd(String(n))&&String(u).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&&u!=null?typeof u=="string"?d(u,String(n),a):d(u,s,a):d(String(u),String(n),a)}case"is_date_after":case"is_date_before":{let s=TwS(String(n));if(s==null&&(s=eep(n)),s==null)throw new k6(`Invalid date: ${n}`);let o=eep(u);return["is_date_before"].includes(a)?o<s:o>s}default:throw new k6(`Unknown operator: ${a}`)}}function aep(e,t,r,i=!1){let n=String(e.value);if(!(n in r))throw new k6("can't match cohort without a given cohort property value");let a=r[n];return oep(a,t,r,i)}function oep(e,t,r,i=!1){if(!e)return!0;let n=e.type,a=e.values;if(!a||a.length===0)return!0;let u=!1;if("values"in a[0]){for(let l of a)try{let d=oep(l,t,r,i);if(n==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof k6)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new k6("Can't match cohort without a given cohort property value");return n==="AND"}else{for(let l of a)try{let d;l.type==="cohort"?d=aep(l,t,r,i):d=nep(l,t);let s=l.negation||!1;if(n==="AND"){if(!d&&!s||d&&s)return!1}else if(d&&!s||!d&&s)return!0}catch(d){if(d instanceof k6)i&&console.debug(`Failed to compute property ${l} locally: ${d}`),u=!0;else throw d}if(u)throw new k6("can't match cohort without a given cohort property value");return n==="AND"}}function kkd(e){try{return new RegExp(e),!0}catch{return!1}}function eep(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 k6(`${e} is in an invalid date format`)}else throw new k6(`The date provided ${e} must be a string, number, or date object`)}function TwS(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 CwS=30*1e3,BwS=50*1e3,Wbn=class extends IEs{constructor(t,r={}){super(t,r),this._memoryStorage=new zEs,this.options=r,r.personalApiKey&&(this.featureFlagsPoller=new NEs({pollingInterval:typeof r.featureFlagsPollingInterval=="number"?r.featureFlagsPollingInterval:CwS,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:i=>{this._events.emit("error",i)},customHeaders:this.getCustomHeaders()})),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||BwS}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):iep(t,r)}getLibraryId(){return"posthog-node"}getLibraryVersion(){return mwS}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({distinctId:t,event:r,properties:i,groups:n,sendFeatureFlags:a,timestamp:u,disableGeoip:l,uuid:d}){let s=b=>{super.captureStateless(t,r,b,{timestamp:u,disableGeoip:l,uuid:d})},o=(b,g,O)=>super.getFeatureFlagsStateless(b,g,void 0,void 0,O),c=Promise.resolve().then(async()=>{if(a)return await o(t,n,l);if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let b={};for(let[g,O]of Object.entries(n||{}))b[g]=String(O);return await this.getAllFlags(t,{groups:b,disableGeoip:l,onlyEvaluateLocally:!0})}return{}}).then(b=>{let g={};if(b)for(let[m,w]of Object.entries(b))g[`$feature/${m}`]=w;let O=Object.keys(b||{}).filter(m=>b?.[m]!==!1);return O.length>0&&(g.$active_feature_flags=O),g}).catch(()=>({})).then(b=>{s({...b,...i,$groups:n})});this.addPendingPromise(c)}identify({distinctId:t,properties:r,disableGeoip:i}){let n=r?.$set||r;super.identifyStateless(t,{$set:n},{disableGeoip:i})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async getFeatureFlag(t,r,i){let{groups:n,disableGeoip:a}=i||{},{onlyEvaluateLocally:u,sendFeatureFlagEvents:l,personProperties:d,groupProperties:s}=i||{},o=this.addLocalPersonAndGroupProperties(r,n,d,s);d=o.allPersonProperties,s=o.allGroupProperties,u==null&&(u=!1),l==null&&(l=!0);let c=await this.featureFlagsPoller?.getFeatureFlag(t,r,n,d,s),b=c!==void 0;!b&&!u&&(c=await super.getFeatureFlagStateless(t,r,n,d,s,a));let g=`${t}_${c}`;return l&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(g))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(g):this.distinctIdHasSentFlagCalls[r]=[g],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:c,locally_evaluated:b,[`$feature/${t}`]:c},groups:n,disableGeoip:a})),c}async getFeatureFlagPayload(t,r,i,n){let{groups:a,disableGeoip:u}=n||{},{onlyEvaluateLocally:l,sendFeatureFlagEvents:d,personProperties:s,groupProperties:o}=n||{},c=this.addLocalPersonAndGroupProperties(r,a,s,o);s=c.allPersonProperties,o=c.allGroupProperties;let b;return i||(i=await this.getFeatureFlag(t,r,{...n,onlyEvaluateLocally:!0})),i&&(b=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,i)),l==null&&(l=!1),d==null&&(d=!0),l==null&&(l=!1),!(b!==void 0)&&!l&&(b=await super.getFeatureFlagPayloadStateless(t,r,a,s,o,u)),b}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:u,groupProperties:l}=r||{},d=this.addLocalPersonAndGroupProperties(t,i,u,l);u=d.allPersonProperties,l=d.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,i,u,l),o={},c={},b=!0;if(s&&(o=s.response,c=s.payloads,b=s.fallbackToDecide),b&&!a){let g=await super.getFeatureFlagsAndPayloadsStateless(t,i,u,l,n);o={...o,...g.flags||{}},c={...c,...g.payloads||{}}}return{featureFlags:o,featureFlagPayloads:c}}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||{}},u={};if(r)for(let l of Object.keys(r))u[l]={$group_key:r[l],...n?.[l]||{}};return{allPersonProperties:a,allGroupProperties:u}}},FEs=class e{constructor(t,r,i,n){this.posthog=t,this.posthogHost=r,this.organization=i,this.prefix=n,this.name="posthog-node",this.posthogHost=t.options.host??"https://us.i.posthog.com"}setupOnce(t,r){t(i=>{if(i.exception?.values===void 0||i.exception.values.length===0)return i;i.tags||(i.tags={});let n=r(),a=i.tags[e.POSTHOG_ID_TAG];if(a===void 0)return i;i.tags["PostHog Person URL"]=new URL(`/person/${a}`,this.posthogHost).toString();let u={$exception_message:i.exception.values[0]?.value,$exception_type:i.exception.values[0]?.type,$exception_personURL:i.tags["PostHog Person URL"],$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:i.exception.values[0]?.value,$sentry_exception_type:i.exception.values[0]?.type,$sentry_tags:i.tags},l=n.getClient()?.getDsn()?.projectId;return this.organization!==void 0&&l!==void 0&&i.event_id!==void 0&&(u.$sentry_url=`${this.prefix??"https://sentry.io/organizations"}/${this.organization}/issues/?project=${l}&query=${i.event_id}`),this.posthog.capture({event:"$exception",distinctId:a,properties:u}),i})}};FEs.POSTHOG_ID_TAG="posthog_distinct_id";var $vo=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Wbn(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.56.3",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var oaa=class{async sendEvent(){}async identify(){}async flush(){}};var Hbn=require("fs/promises"),lep=require("os"),fep=require("path");var uep=vi(require("crypto")),Qvo=new Uint8Array(256),Gvo=Qvo.length;function LEs(){return Gvo>Qvo.length-16&&(uep.default.randomFillSync(Qvo),Gvo=0),Qvo.slice(Gvo,Gvo+=16)}var BU=[];for(let e=0;e<256;++e)BU.push((e+256).toString(16).slice(1));function sep(e,t=0){return BU[e[t+0]]+BU[e[t+1]]+BU[e[t+2]]+BU[e[t+3]]+"-"+BU[e[t+4]]+BU[e[t+5]]+"-"+BU[e[t+6]]+BU[e[t+7]]+"-"+BU[e[t+8]]+BU[e[t+9]]+"-"+BU[e[t+10]]+BU[e[t+11]]+BU[e[t+12]]+BU[e[t+13]]+BU[e[t+14]]+BU[e[t+15]]}var cep=vi(require("crypto")),UEs={randomUUID:cep.default.randomUUID};function xwS(e,t,r){if(UEs.randomUUID&&!t&&!e)return UEs.randomUUID();e=e||{};let i=e.random||(e.rng||LEs)();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 sep(i)}var zre=xwS;var IwS="id",zwS=".fern",uaa=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new Wbn(r),this.userId=t==null?void 0:tms(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:"0.56.3",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Xu(Wl.of((0,lep.homedir)()),Xa.of(zwS),Xa.of(IwS));await Cf(t)||(await(0,Hbn.mkdir)((0,fep.dirname)(t),{recursive:!0}),await(0,Hbn.writeFile)(t,zre())),this.persistedDistinctId=(await(0,Hbn.readFile)(t)).toString()}return this.persistedDistinctId}};var VEs;async function $bn(){return VEs==null&&(VEs=await RwS()),VEs}async function RwS(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new oaa;let r=await tfo();return r!=null?new uaa({token:r,posthogApiKey:e}):await efo()!=null?new $vo({posthogApiKey:e}):new uaa({token:void 0,posthogApiKey:e})}catch{return new oaa}}function saa(e,t){return function(){return e.apply(t,arguments)}}var{toString:NwS}=Object.prototype,{getPrototypeOf:$Es}=Object,Kvo=(e=>t=>{let r=NwS.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),a8t=e=>(e=e.toLowerCase(),t=>Kvo(t)===e),Yvo=e=>t=>typeof t===e,{isArray:Gbn}=Array,caa=Yvo("undefined");function FwS(e){return e!==null&&!caa(e)&&e.constructor!==null&&!caa(e.constructor)&&W1e(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var _ep=a8t("ArrayBuffer");function LwS(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_ep(e.buffer),t}var UwS=Yvo("string"),W1e=Yvo("function"),hep=Yvo("number"),Xvo=e=>e!==null&&typeof e=="object",VwS=e=>e===!0||e===!1,Jvo=e=>{if(Kvo(e)!=="object")return!1;let t=$Es(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},WwS=a8t("Date"),HwS=a8t("File"),$wS=a8t("Blob"),GwS=a8t("FileList"),QwS=e=>Xvo(e)&&W1e(e.pipe),JwS=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||W1e(e.append)&&((t=Kvo(e))==="formdata"||t==="object"&&W1e(e.toString)&&e.toString()==="[object FormData]"))},KwS=a8t("URLSearchParams"),[YwS,XwS,ZwS,kwS]=["ReadableStream","Request","Response","Headers"].map(a8t),e1S=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function laa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let i,n;if(typeof e!="object"&&(e=[e]),Gbn(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{let a=r?Object.getOwnPropertyNames(e):Object.keys(e),u=a.length,l;for(i=0;i<u;i++)l=a[i],t.call(null,e[l],l,e)}}function yep(e,t){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 RCi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vep=e=>!caa(e)&&e!==RCi;function HEs(){let{caseless:e}=vep(this)&&this||{},t={},r=(i,n)=>{let a=e&&yep(t,n)||n;Jvo(t[a])&&Jvo(i)?t[a]=HEs(t[a],i):Jvo(i)?t[a]=HEs({},i):Gbn(i)?t[a]=i.slice():t[a]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&laa(arguments[i],r);return t}var t1S=(e,t,r,{allOwnKeys:i}={})=>(laa(t,(n,a)=>{r&&W1e(n)?e[a]=saa(n,r):e[a]=n},{allOwnKeys:i}),e),r1S=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),i1S=(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)},n1S=(e,t,r,i)=>{let n,a,u,l={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)u=n[a],(!i||i(u,e,t))&&!l[u]&&(t[u]=e[u],l[u]=!0);e=r!==!1&&$Es(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},a1S=(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},o1S=e=>{if(!e)return null;if(Gbn(e))return e;let t=e.length;if(!hep(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},u1S=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$Es(Uint8Array)),s1S=(e,t)=>{let i=(e&&e[Symbol.iterator]).call(e),n;for(;(n=i.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},c1S=(e,t)=>{let r,i=[];for(;(r=e.exec(t))!==null;)i.push(r);return i},l1S=a8t("HTMLFormElement"),f1S=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,n){return i.toUpperCase()+n}),dep=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),d1S=a8t("RegExp"),bep=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),i={};laa(r,(n,a)=>{let u;(u=t(n,a,e))!==!1&&(i[a]=u||n)}),Object.defineProperties(e,i)},p1S=e=>{bep(e,(t,r)=>{if(W1e(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=e[r];if(W1e(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+"'")})}})},_1S=(e,t)=>{let r={},i=n=>{n.forEach(a=>{r[a]=!0})};return Gbn(e)?i(e):i(String(e).split(t)),r},h1S=()=>{},y1S=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,WEs="abcdefghijklmnopqrstuvwxyz",pep="0123456789",gep={DIGIT:pep,ALPHA:WEs,ALPHA_DIGIT:WEs+WEs.toUpperCase()+pep},v1S=(e=16,t=gep.ALPHA_DIGIT)=>{let r="",{length:i}=t;for(;e--;)r+=t[Math.random()*i|0];return r};function b1S(e){return!!(e&&W1e(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var g1S=e=>{let t=new Array(10),r=(i,n)=>{if(Xvo(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[n]=i;let a=Gbn(i)?[]:{};return laa(i,(u,l)=>{let d=r(u,n+1);!caa(d)&&(a[l]=d)}),t[n]=void 0,a}}return i};return r(e,0)},O1S=a8t("AsyncFunction"),m1S=e=>e&&(Xvo(e)||W1e(e))&&W1e(e.then)&&W1e(e.catch),Oep=((e,t)=>e?setImmediate:t?((r,i)=>(RCi.addEventListener("message",({source:n,data:a})=>{n===RCi&&a===r&&i.length&&i.shift()()},!1),n=>{i.push(n),RCi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",W1e(RCi.postMessage)),P1S=typeof queueMicrotask<"u"?queueMicrotask.bind(RCi):typeof process<"u"&&process.nextTick||Oep,us={isArray:Gbn,isArrayBuffer:_ep,isBuffer:FwS,isFormData:JwS,isArrayBufferView:LwS,isString:UwS,isNumber:hep,isBoolean:VwS,isObject:Xvo,isPlainObject:Jvo,isReadableStream:YwS,isRequest:XwS,isResponse:ZwS,isHeaders:kwS,isUndefined:caa,isDate:WwS,isFile:HwS,isBlob:$wS,isRegExp:d1S,isFunction:W1e,isStream:QwS,isURLSearchParams:KwS,isTypedArray:u1S,isFileList:GwS,forEach:laa,merge:HEs,extend:t1S,trim:e1S,stripBOM:r1S,inherits:i1S,toFlatObject:n1S,kindOf:Kvo,kindOfTest:a8t,endsWith:a1S,toArray:o1S,forEachEntry:s1S,matchAll:c1S,isHTMLForm:l1S,hasOwnProperty:dep,hasOwnProp:dep,reduceDescriptors:bep,freezeMethods:p1S,toObjectSet:_1S,toCamelCase:f1S,noop:h1S,toFiniteNumber:y1S,findKey:yep,global:RCi,isContextDefined:vep,ALPHABET:gep,generateString:v1S,isSpecCompliantForm:b1S,toJSONObject:g1S,isAsyncFn:O1S,isThenable:m1S,setImmediate:Oep,asap:P1S};function Qbn(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)}us.inherits(Qbn,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:us.toJSONObject(this.config),code:this.code,status:this.status}}});var mep=Qbn.prototype,Pep={};["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=>{Pep[e]={value:e}});Object.defineProperties(Qbn,Pep);Object.defineProperty(mep,"isAxiosError",{value:!0});Qbn.from=(e,t,r,i,n,a)=>{let u=Object.create(mep);return us.toFlatObject(e,u,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),Qbn.call(u,e.message,t,r,i,n),u.cause=e,u.name=e.name,a&&Object.assign(u,a),u};var mp=Qbn;var jep=vi(JZn(),1),Zvo=jep.default;function GEs(e){return us.isPlainObject(e)||us.isArray(e)}function Sep(e){return us.endsWith(e,"[]")?e.slice(0,-2):e}function wep(e,t,r){return e?e.concat(t).map(function(n,a){return n=Sep(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function j1S(e){return us.isArray(e)&&!e.some(GEs)}var w1S=us.toFlatObject(us,{},null,function(t){return/^is[A-Z]/.test(t)});function S1S(e,t,r){if(!us.isObject(e))throw new TypeError("target must be an object");t=t||new(Zvo||FormData),r=us.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,w){return!us.isUndefined(w[m])});let i=r.metaTokens,n=r.visitor||o,a=r.dots,u=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&us.isSpecCompliantForm(t);if(!us.isFunction(n))throw new TypeError("visitor must be a function");function s(O){if(O===null)return"";if(us.isDate(O))return O.toISOString();if(!d&&us.isBlob(O))throw new mp("Blob is not supported. Use a Buffer instead.");return us.isArrayBuffer(O)||us.isTypedArray(O)?d&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function o(O,m,w){let E=O;if(O&&!w&&typeof O=="object"){if(us.endsWith(m,"{}"))m=i?m:m.slice(0,-2),O=JSON.stringify(O);else if(us.isArray(O)&&j1S(O)||(us.isFileList(O)||us.endsWith(m,"[]"))&&(E=us.toArray(O)))return m=Sep(m),E.forEach(function(q,D){!(us.isUndefined(q)||q===null)&&t.append(u===!0?wep([m],D,a):u===null?m:m+"[]",s(q))}),!1}return GEs(O)?!0:(t.append(wep(w,m,a),s(O)),!1)}let c=[],b=Object.assign(w1S,{defaultVisitor:o,convertValue:s,isVisitable:GEs});function g(O,m){if(!us.isUndefined(O)){if(c.indexOf(O)!==-1)throw Error("Circular reference detected in "+m.join("."));c.push(O),us.forEach(O,function(E,A){(!(us.isUndefined(E)||E===null)&&n.call(t,E,us.isString(A)?A.trim():A,m,b))===!0&&g(E,m?m.concat(A):[A])}),c.pop()}}if(!us.isObject(e))throw new TypeError("data must be an object");return g(e),t}var Esi=S1S;function Dep(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Eep(e,t){this._pairs=[],e&&Esi(e,this,t)}var Mep=Eep.prototype;Mep.append=function(t,r){this._pairs.push([t,r])};Mep.toString=function(t){let r=t?function(i){return t.call(this,i,Dep)}:Dep;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var Aep=Eep;function D1S(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NCi(e,t,r){if(!t)return e;let i=r&&r.encode||D1S,n=r&&r.serialize,a;if(n?a=n(t,r):a=us.isURLSearchParams(t)?t.toString():new Aep(t,r).toString(i),a){let u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var QEs=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){us.forEach(this.handlers,function(i){i!==null&&t(i)})}},JEs=QEs;var Jbn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var qep=vi(require("url"),1),Tep=qep.default.URLSearchParams;var Cep={isNode:!0,classes:{URLSearchParams:Tep,FormData:Zvo,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};var XEs={};Io(XEs,{hasBrowserEnv:()=>YEs,hasStandardBrowserEnv:()=>E1S,hasStandardBrowserWebWorkerEnv:()=>M1S,navigator:()=>KEs,origin:()=>A1S});var YEs=typeof window<"u"&&typeof document<"u",KEs=typeof navigator=="object"&&navigator||void 0,E1S=YEs&&(!KEs||["ReactNative","NativeScript","NS"].indexOf(KEs.product)<0),M1S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",A1S=YEs&&window.location.href||"http://localhost";var NT={...XEs,...Cep};function ZEs(e,t){return Esi(e,new NT.classes.URLSearchParams,Object.assign({visitor:function(r,i,n,a){return NT.isNode&&us.isBuffer(r)?(this.append(i,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function q1S(e){return us.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function T1S(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 C1S(e){function t(r,i,n,a){let u=r[a++];if(u==="__proto__")return!0;let l=Number.isFinite(+u),d=a>=r.length;return u=!u&&us.isArray(n)?n.length:u,d?(us.hasOwnProp(n,u)?n[u]=[n[u],i]:n[u]=i,!l):((!n[u]||!us.isObject(n[u]))&&(n[u]=[]),t(r,i,n[u],a)&&us.isArray(n[u])&&(n[u]=T1S(n[u])),!l)}if(us.isFormData(e)&&us.isFunction(e.entries)){let r={};return us.forEachEntry(e,(i,n)=>{t(q1S(i),n,r,0)}),r}return null}var kvo=C1S;function B1S(e,t,r){if(us.isString(e))try{return(t||JSON.parse)(e),us.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(e)}var kEs={transitional:Jbn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let i=r.getContentType()||"",n=i.indexOf("application/json")>-1,a=us.isObject(t);if(a&&us.isHTMLForm(t)&&(t=new FormData(t)),us.isFormData(t))return n?JSON.stringify(kvo(t)):t;if(us.isArrayBuffer(t)||us.isBuffer(t)||us.isStream(t)||us.isFile(t)||us.isBlob(t)||us.isReadableStream(t))return t;if(us.isArrayBufferView(t))return t.buffer;if(us.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return ZEs(t,this.formSerializer).toString();if((l=us.isFileList(t))||i.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return Esi(l?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),B1S(t)):t}],transformResponse:[function(t){let r=this.transitional||kEs.transitional,i=r&&r.forcedJSONParsing,n=this.responseType==="json";if(us.isResponse(t)||us.isReadableStream(t))return t;if(t&&us.isString(t)&&(i&&!this.responseType||n)){let u=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(l){if(u)throw l.name==="SyntaxError"?mp.from(l,mp.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:NT.classes.FormData,Blob:NT.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};us.forEach(["delete","get","head","post","put","patch"],e=>{kEs.headers[e]={}});var Kbn=kEs;var x1S=us.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"]),Bep=e=>{let t={},r,i,n;return e&&e.split(`
|
|
1695
1695
|
`).forEach(function(u){n=u.indexOf(":"),r=u.substring(0,n).trim().toLowerCase(),i=u.substring(n+1).trim(),!(!r||t[r]&&x1S[r])&&(r==="set-cookie"?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)}),t};var xep=Symbol("internals");function faa(e){return e&&String(e).trim().toLowerCase()}function ebo(e){return e===!1||e==null?e:us.isArray(e)?e.map(ebo):String(e)}function I1S(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 z1S=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eMs(e,t,r,i,n){if(us.isFunction(i))return i.call(this,t,r);if(n&&(t=r),!!us.isString(t)){if(us.isString(i))return t.indexOf(i)!==-1;if(us.isRegExp(i))return i.test(t)}}function R1S(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,i)=>r.toUpperCase()+i)}function N1S(e,t){let r=us.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+r,{value:function(n,a,u){return this[i].call(this,t,n,a,u)},configurable:!0})})}var Ybn=class{constructor(t){t&&this.set(t)}set(t,r,i){let n=this;function a(l,d,s){let o=faa(d);if(!o)throw new Error("header name must be a non-empty string");let c=us.findKey(n,o);(!c||n[c]===void 0||s===!0||s===void 0&&n[c]!==!1)&&(n[c||d]=ebo(l))}let u=(l,d)=>us.forEach(l,(s,o)=>a(s,o,d));if(us.isPlainObject(t)||t instanceof this.constructor)u(t,r);else if(us.isString(t)&&(t=t.trim())&&!z1S(t))u(Bep(t),r);else if(us.isHeaders(t))for(let[l,d]of t.entries())a(d,l,i);else t!=null&&a(r,t,i);return this}get(t,r){if(t=faa(t),t){let i=us.findKey(this,t);if(i){let n=this[i];if(!r)return n;if(r===!0)return I1S(n);if(us.isFunction(r))return r.call(this,n,i);if(us.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=faa(t),t){let i=us.findKey(this,t);return!!(i&&this[i]!==void 0&&(!r||eMs(this,this[i],i,r)))}return!1}delete(t,r){let i=this,n=!1;function a(u){if(u=faa(u),u){let l=us.findKey(i,u);l&&(!r||eMs(i,i[l],l,r))&&(delete i[l],n=!0)}}return us.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||eMs(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){let r=this,i={};return us.forEach(this,(n,a)=>{let u=us.findKey(i,a);if(u){r[u]=ebo(n),delete r[a];return}let l=t?R1S(a):String(a).trim();l!==a&&delete r[a],r[l]=ebo(n),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return us.forEach(this,(i,n)=>{i!=null&&i!==!1&&(r[n]=t&&us.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(`
|
|
1696
1696
|
`)}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[xep]=this[xep]={accessors:{}}).accessors,n=this.prototype;function a(u){let l=faa(u);i[l]||(N1S(n,u),i[l]=!0)}return us.isArray(t)?t.forEach(a):a(t),this}};Ybn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);us.reduceDescriptors(Ybn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[r]=i}}});us.freezeMethods(Ybn);var VI=Ybn;function daa(e,t){let r=this||Kbn,i=t||r,n=VI.from(i.headers),a=i.data;return us.forEach(e,function(l){a=l.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function paa(e){return!!(e&&e.__CANCEL__)}function Iep(e,t,r){mp.call(this,e??"canceled",mp.ERR_CANCELED,t,r),this.name="CanceledError"}us.inherits(Iep,mp,{__CANCEL__:!0});var H1e=Iep;function mKt(e,t,r){let i=r.config.validateStatus;!r.status||!i||i(r.status)?e(r):t(new mp("Request failed with status code "+r.status,[mp.ERR_BAD_REQUEST,mp.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function tMs(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function rMs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function FCi(e,t){return e&&!tMs(t)?rMs(e,t):t}var Xep=vi(Qna(),1),Zep=vi(require("http"),1),kep=vi(require("https"),1),etp=vi(require("util"),1),ttp=vi(uEs(),1),k$r=vi(require("zlib"),1);var LCi="1.7.7";function _aa(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var F1S=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function iMs(e,t,r){let i=r&&r.Blob||NT.classes.Blob,n=_aa(e);if(t===void 0&&i&&(t=!0),n==="data"){e=n.length?e.slice(n.length+1):e;let a=F1S.exec(e);if(!a)throw new mp("Invalid URL",mp.ERR_INVALID_URL);let u=a[1],l=a[2],d=a[3],s=Buffer.from(decodeURIComponent(d),l?"base64":"utf8");if(t){if(!i)throw new mp("Blob is not supported",mp.ERR_NOT_SUPPORT);return new i([s],{type:u})}return s}throw new mp("Unsupported protocol "+n,mp.ERR_NOT_SUPPORT)}var UCi=vi(require("stream"),1);var zep=vi(require("stream"),1);var nMs=Symbol("internals"),aMs=class extends zep.default.Transform{constructor(t){t=us.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,n)=>!us.isUndefined(n[i])),super({readableHighWaterMark:t.chunkSize});let r=this[nMs]={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[nMs];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,i){let n=this[nMs],a=n.maxRate,u=this.readableHighWaterMark,l=n.timeWindow,d=1e3/l,s=a/d,o=n.minChunkSize!==!1?Math.max(n.minChunkSize,s*.01):0,c=(g,O)=>{let m=Buffer.byteLength(g);n.bytesSeen+=m,n.bytes+=m,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(g)?process.nextTick(O):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(O)}},b=(g,O)=>{let m=Buffer.byteLength(g),w=null,E=u,A,q=0;if(a){let D=Date.now();(!n.ts||(q=D-n.ts)>=l)&&(n.ts=D,A=s-n.bytes,n.bytes=A<0?-A:0,q=0),A=s-n.bytes}if(a){if(A<=0)return setTimeout(()=>{O(null,g)},l-q);A<E&&(E=A)}E&&m>E&&m-E>o&&(w=g.subarray(E),g=g.subarray(0,E)),c(g,w?()=>{process.nextTick(O,null,w)}:O)};b(t,function g(O,m){if(O)return i(O);m?b(m,g):i(null)})}},oMs=aMs;var rtp=require("events");var Nep=require("util"),Fep=require("stream");var{asyncIterator:Rep}=Symbol,L1S=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Rep]?yield*e[Rep]():yield e},tbo=L1S;var U1S=us.ALPHABET.ALPHA_DIGIT+"-_",haa=new Nep.TextEncoder,Msi=`\r
|
|
1697
1697
|
`,V1S=haa.encode(Msi),W1S=2,uMs=class{constructor(t,r){let{escapeName:i}=this.constructor,n=us.isString(r),a=`Content-Disposition: form-data; name="${i(t)}"${!n&&r.name?`; filename="${i(r.name)}"`:""}${Msi}`;n?r=haa.encode(String(r).replace(/\r?\n|\r\n?/g,Msi)):a+=`Content-Type: ${r.type||"application/octet-stream"}${Msi}`,this.headers=haa.encode(a+Msi),this.contentLength=n?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+W1S,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;us.isTypedArray(t)?yield t:yield*tbo(t),yield V1S}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},H1S=(e,t,r)=>{let{tag:i="form-data-boundary",size:n=25,boundary:a=i+"-"+us.generateString(n,U1S)}=r||{};if(!us.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let u=haa.encode("--"+a+Msi),l=haa.encode("--"+a+"--"+Msi+Msi),d=l.byteLength,s=Array.from(e.entries()).map(([c,b])=>{let g=new uMs(c,b);return d+=g.size,g});d+=u.byteLength*s.length,d=us.toFiniteNumber(d);let o={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(d)&&(o["Content-Length"]=d),t&&t(o),Fep.Readable.from(async function*(){for(let c of s)yield u,yield*c.encode();yield l}())},Lep=H1S;var Uep=vi(require("stream"),1),sMs=class extends Uep.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)}},Vep=sMs;var $1S=(e,t)=>us.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,Wep=$1S;function G1S(e,t){e=e||10;let r=new Array(e),i=new Array(e),n=0,a=0,u;return t=t!==void 0?t:1e3,function(d){let s=Date.now(),o=i[a];u||(u=s),r[n]=d,i[n]=s;let c=a,b=0;for(;c!==n;)b+=r[c++],c=c%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),s-u<t)return;let g=o&&s-o;return g?Math.round(b*1e3/g):void 0}}var Hep=G1S;function Q1S(e,t){let r=0,i=1e3/t,n,a,u=(s,o=Date.now())=>{r=o,n=null,a&&(clearTimeout(a),a=null),e.apply(null,s)};return[(...s)=>{let o=Date.now(),c=o-r;c>=i?u(s,o):(n=s,a||(a=setTimeout(()=>{a=null,u(n)},i-c)))},()=>n&&u(n)]}var $ep=Q1S;var Z$r=(e,t,r=3)=>{let i=0,n=Hep(50,250);return $ep(a=>{let u=a.loaded,l=a.lengthComputable?a.total:void 0,d=u-i,s=n(d),o=u<=l;i=u;let c={loaded:u,total:l,progress:l?u/l:void 0,bytes:d,rate:s||void 0,estimated:s&&l&&o?(l-u)/s:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(c)},r)},Xbn=(e,t)=>{let r=e!=null;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},Zbn=e=>(...t)=>us.asap(()=>e(...t));var Gep={flush:k$r.default.constants.Z_SYNC_FLUSH,finishFlush:k$r.default.constants.Z_SYNC_FLUSH},J1S={flush:k$r.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:k$r.default.constants.BROTLI_OPERATION_FLUSH},Qep=us.isFunction(k$r.default.createBrotliDecompress),{http:K1S,https:Y1S}=ttp.default,X1S=/https:?/,Jep=NT.protocols.map(e=>e+":"),Kep=(e,[t,r])=>(e.on("end",r).on("error",r),t);function Z1S(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function itp(e,t,r){let i=t;if(!i&&i!==!1){let n=(0,Xep.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){itp(a,t,a.href)}}var k1S=typeof process<"u"&&us.kindOf(process)==="process",eSS=e=>new Promise((t,r)=>{let i,n,a=(d,s)=>{n||(n=!0,i&&i(d,s))},u=d=>{a(d),t(d)},l=d=>{a(d,!0),r(d)};e(u,l,d=>i=d).catch(l)}),tSS=({address:e,family:t})=>{if(!us.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},Yep=(e,t)=>tSS(us.isObject(e)?e:{address:e,family:t}),ntp=k1S&&function(t){return eSS(async function(i,n,a){let{data:u,lookup:l,family:d}=t,{responseType:s,responseEncoding:o}=t,c=t.method.toUpperCase(),b,g=!1,O;if(l){let we=Wep(l,Ze=>us.isArray(Ze)?Ze:[Ze]);l=(Ze,Mt,De)=>{we(Ze,Mt,(Te,xt,Ee)=>{if(Te)return De(Te);let It=us.isArray(xt)?xt.map(st=>Yep(st)):[Yep(xt,Ee)];Mt.all?De(Te,It):De(Te,It[0].address,It[0].family)})}}let m=new rtp.EventEmitter,w=()=>{t.cancelToken&&t.cancelToken.unsubscribe(E),t.signal&&t.signal.removeEventListener("abort",E),m.removeAllListeners()};a((we,Ze)=>{b=!0,Ze&&(g=!0,w())});function E(we){m.emit("abort",!we||we.type?new H1e(null,t,O):we)}m.once("abort",n),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(E),t.signal&&(t.signal.aborted?E():t.signal.addEventListener("abort",E)));let A=FCi(t.baseURL,t.url),q=new URL(A,NT.hasBrowserEnv?NT.origin:void 0),D=q.protocol||Jep[0];if(D==="data:"){let we;if(c!=="GET")return mKt(i,n,{status:405,statusText:"method not allowed",headers:{},config:t});try{we=iMs(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(Ze){throw mp.from(Ze,mp.ERR_BAD_REQUEST,t)}return s==="text"?(we=we.toString(o),(!o||o==="utf8")&&(we=us.stripBOM(we))):s==="stream"&&(we=UCi.default.Readable.from(we)),mKt(i,n,{data:we,status:200,statusText:"OK",headers:new VI,config:t})}if(Jep.indexOf(D)===-1)return n(new mp("Unsupported protocol "+D,mp.ERR_BAD_REQUEST,t));let C=VI.from(t.headers).normalize();C.set("User-Agent","axios/"+LCi,!1);let{onUploadProgress:R,onDownloadProgress:$}=t,I=t.maxRate,U,H;if(us.isSpecCompliantForm(u)){let we=C.getContentType(/boundary=([-_\w\d]{10,70})/i);u=Lep(u,Ze=>{C.set(Ze)},{tag:`axios-${LCi}-boundary`,boundary:we&&we[1]||void 0})}else if(us.isFormData(u)&&us.isFunction(u.getHeaders)){if(C.set(u.getHeaders()),!C.hasContentLength())try{let we=await etp.default.promisify(u.getLength).call(u);Number.isFinite(we)&&we>=0&&C.setContentLength(we)}catch{}}else if(us.isBlob(u))u.size&&C.setContentType(u.type||"application/octet-stream"),C.setContentLength(u.size||0),u=UCi.default.Readable.from(tbo(u));else if(u&&!us.isStream(u)){if(!Buffer.isBuffer(u))if(us.isArrayBuffer(u))u=Buffer.from(new Uint8Array(u));else if(us.isString(u))u=Buffer.from(u,"utf-8");else return n(new mp("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",mp.ERR_BAD_REQUEST,t));if(C.setContentLength(u.length,!1),t.maxBodyLength>-1&&u.length>t.maxBodyLength)return n(new mp("Request body larger than maxBodyLength limit",mp.ERR_BAD_REQUEST,t))}let k=us.toFiniteNumber(C.getContentLength());us.isArray(I)?(U=I[0],H=I[1]):U=H=I,u&&(R||U)&&(us.isStream(u)||(u=UCi.default.Readable.from(u,{objectMode:!1})),u=UCi.default.pipeline([u,new oMs({maxRate:us.toFiniteNumber(U)})],us.noop),R&&u.on("progress",Kep(u,Xbn(k,Z$r(Zbn(R),!1,3)))));let K;if(t.auth){let we=t.auth.username||"",Ze=t.auth.password||"";K=we+":"+Ze}if(!K&&q.username){let we=q.username,Ze=q.password;K=we+":"+Ze}K&&C.delete("authorization");let te;try{te=NCi(q.pathname+q.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(we){let Ze=new Error(we.message);return Ze.config=t,Ze.url=t.url,Ze.exists=!0,n(Ze)}C.set("Accept-Encoding","gzip, compress, deflate"+(Qep?", br":""),!1);let fe={path:te,method:c,headers:C.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:K,protocol:D,family:d,beforeRedirect:Z1S,beforeRedirects:{}};!us.isUndefined(l)&&(fe.lookup=l),t.socketPath?fe.socketPath=t.socketPath:(fe.hostname=q.hostname.startsWith("[")?q.hostname.slice(1,-1):q.hostname,fe.port=q.port,itp(fe,t.proxy,D+"//"+q.hostname+(q.port?":"+q.port:"")+fe.path));let me,be=X1S.test(fe.protocol);if(fe.agent=be?t.httpsAgent:t.httpAgent,t.transport?me=t.transport:t.maxRedirects===0?me=be?kep.default:Zep.default:(t.maxRedirects&&(fe.maxRedirects=t.maxRedirects),t.beforeRedirect&&(fe.beforeRedirects.config=t.beforeRedirect),me=be?Y1S:K1S),t.maxBodyLength>-1?fe.maxBodyLength=t.maxBodyLength:fe.maxBodyLength=1/0,t.insecureHTTPParser&&(fe.insecureHTTPParser=t.insecureHTTPParser),O=me.request(fe,function(Ze){if(O.destroyed)return;let Mt=[Ze],De=+Ze.headers["content-length"];if($||H){let st=new oMs({maxRate:us.toFiniteNumber(H)});$&&st.on("progress",Kep(st,Xbn(De,Z$r(Zbn($),!0,3)))),Mt.push(st)}let Te=Ze,xt=Ze.req||O;if(t.decompress!==!1&&Ze.headers["content-encoding"])switch((c==="HEAD"||Ze.statusCode===204)&&delete Ze.headers["content-encoding"],(Ze.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Mt.push(k$r.default.createUnzip(Gep)),delete Ze.headers["content-encoding"];break;case"deflate":Mt.push(new Vep),Mt.push(k$r.default.createUnzip(Gep)),delete Ze.headers["content-encoding"];break;case"br":Qep&&(Mt.push(k$r.default.createBrotliDecompress(J1S)),delete Ze.headers["content-encoding"])}Te=Mt.length>1?UCi.default.pipeline(Mt,us.noop):Mt[0];let Ee=UCi.default.finished(Te,()=>{Ee(),w()}),It={status:Ze.statusCode,statusText:Ze.statusMessage,headers:new VI(Ze.headers),config:t,request:xt};if(s==="stream")It.data=Te,mKt(i,n,It);else{let st=[],ye=0;Te.on("data",function(Ot){st.push(Ot),ye+=Ot.length,t.maxContentLength>-1&&ye>t.maxContentLength&&(g=!0,Te.destroy(),n(new mp("maxContentLength size of "+t.maxContentLength+" exceeded",mp.ERR_BAD_RESPONSE,t,xt)))}),Te.on("aborted",function(){if(g)return;let Ot=new mp("maxContentLength size of "+t.maxContentLength+" exceeded",mp.ERR_BAD_RESPONSE,t,xt);Te.destroy(Ot),n(Ot)}),Te.on("error",function(Ot){O.destroyed||n(mp.from(Ot,null,t,xt))}),Te.on("end",function(){try{let Ot=st.length===1?st[0]:Buffer.concat(st);s!=="arraybuffer"&&(Ot=Ot.toString(o),(!o||o==="utf8")&&(Ot=us.stripBOM(Ot))),It.data=Ot}catch(Ot){return n(mp.from(Ot,null,t,It.request,It))}mKt(i,n,It)})}m.once("abort",st=>{Te.destroyed||(Te.emit("error",st),Te.destroy())})}),m.once("abort",we=>{n(we),O.destroy(we)}),O.on("error",function(Ze){n(mp.from(Ze,null,t,O))}),O.on("socket",function(Ze){Ze.setKeepAlive(!0,1e3*60)}),t.timeout){let we=parseInt(t.timeout,10);if(Number.isNaN(we)){n(new mp("error trying to parse `config.timeout` to int",mp.ERR_BAD_OPTION_VALUE,t,O));return}O.setTimeout(we,function(){if(b)return;let Mt=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",De=t.transitional||Jbn;t.timeoutErrorMessage&&(Mt=t.timeoutErrorMessage),n(new mp(Mt,De.clarifyTimeoutError?mp.ETIMEDOUT:mp.ECONNABORTED,t,O)),E()})}if(us.isStream(u)){let we=!1,Ze=!1;u.on("end",()=>{we=!0}),u.once("error",Mt=>{Ze=!0,O.destroy(Mt)}),u.on("close",()=>{!we&&!Ze&&E(new H1e("Request stream has been aborted",t,O))}),u.pipe(O)}else O.end(u)})};var atp=NT.hasStandardBrowserEnv?function(){let t=NT.navigator&&/(msie|trident)/i.test(NT.navigator.userAgent),r=document.createElement("a"),i;function n(a){let u=a;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=n(window.location.href),function(u){let l=us.isString(u)?n(u):u;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}();var otp=NT.hasStandardBrowserEnv?{write(e,t,r,i,n,a){let u=[e+"="+encodeURIComponent(t)];us.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),us.isString(i)&&u.push("path="+i),us.isString(n)&&u.push("domain="+n),a===!0&&u.push("secure"),document.cookie=u.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 utp=e=>e instanceof VI?{...e}:e;function o8t(e,t){t=t||{};let r={};function i(s,o,c){return us.isPlainObject(s)&&us.isPlainObject(o)?us.merge.call({caseless:c},s,o):us.isPlainObject(o)?us.merge({},o):us.isArray(o)?o.slice():o}function n(s,o,c){if(us.isUndefined(o)){if(!us.isUndefined(s))return i(void 0,s,c)}else return i(s,o,c)}function a(s,o){if(!us.isUndefined(o))return i(void 0,o)}function u(s,o){if(us.isUndefined(o)){if(!us.isUndefined(s))return i(void 0,s)}else return i(void 0,o)}function l(s,o,c){if(c in t)return i(s,o);if(c in e)return i(void 0,s)}let d={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(s,o)=>n(utp(s),utp(o),!0)};return us.forEach(Object.keys(Object.assign({},e,t)),function(o){let c=d[o]||n,b=c(e[o],t[o],o);us.isUndefined(b)&&c!==l||(r[o]=b)}),r}var rbo=e=>{let t=o8t({},e),{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:a,headers:u,auth:l}=t;t.headers=u=VI.from(u),t.url=NCi(FCi(t.baseURL,t.url),e.params,e.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let d;if(us.isFormData(r)){if(NT.hasStandardBrowserEnv||NT.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((d=u.getContentType())!==!1){let[s,...o]=d?d.split(";").map(c=>c.trim()).filter(Boolean):[];u.setContentType([s||"multipart/form-data",...o].join("; "))}}if(NT.hasStandardBrowserEnv&&(i&&us.isFunction(i)&&(i=i(t)),i||i!==!1&&atp(t.url))){let s=n&&a&&otp.read(a);s&&u.set(n,s)}return t};var rSS=typeof XMLHttpRequest<"u",stp=rSS&&function(e){return new Promise(function(r,i){let n=rbo(e),a=n.data,u=VI.from(n.headers).normalize(),{responseType:l,onUploadProgress:d,onDownloadProgress:s}=n,o,c,b,g,O;function m(){g&&g(),O&&O(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let w=new XMLHttpRequest;w.open(n.method.toUpperCase(),n.url,!0),w.timeout=n.timeout;function E(){if(!w)return;let q=VI.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:q,config:e,request:w};mKt(function($){r($),m()},function($){i($),m()},C),w=null}"onloadend"in w?w.onloadend=E:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(E)},w.onabort=function(){w&&(i(new mp("Request aborted",mp.ECONNABORTED,e,w)),w=null)},w.onerror=function(){i(new mp("Network Error",mp.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){let D=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",C=n.transitional||Jbn;n.timeoutErrorMessage&&(D=n.timeoutErrorMessage),i(new mp(D,C.clarifyTimeoutError?mp.ETIMEDOUT:mp.ECONNABORTED,e,w)),w=null},a===void 0&&u.setContentType(null),"setRequestHeader"in w&&us.forEach(u.toJSON(),function(D,C){w.setRequestHeader(C,D)}),us.isUndefined(n.withCredentials)||(w.withCredentials=!!n.withCredentials),l&&l!=="json"&&(w.responseType=n.responseType),s&&([b,O]=Z$r(s,!0),w.addEventListener("progress",b)),d&&w.upload&&([c,g]=Z$r(d),w.upload.addEventListener("progress",c),w.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(o=q=>{w&&(i(!q||q.type?new H1e(null,e,w):q),w.abort(),w=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));let A=_aa(n.url);if(A&&NT.protocols.indexOf(A)===-1){i(new mp("Unsupported protocol "+A+":",mp.ERR_BAD_REQUEST,e));return}w.send(a||null)})};var iSS=(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,l();let o=s instanceof Error?s:this.reason;i.abort(o instanceof mp?o:new H1e(o instanceof Error?o.message:o))}},u=t&&setTimeout(()=>{u=null,a(new mp(`timeout ${t} of ms exceeded`,mp.ETIMEDOUT))},t),l=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:d}=i;return d.unsubscribe=()=>us.asap(l),d}},ctp=iSS;var nSS=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},aSS=async function*(e,t){for await(let r of oSS(e))yield*nSS(r,t)},oSS=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()}},cMs=(e,t,r,i)=>{let n=aSS(e,t),a=0,u,l=d=>{u||(u=!0,i&&i(d))};return new ReadableStream({async pull(d){try{let{done:s,value:o}=await n.next();if(s){l(),d.close();return}let c=o.byteLength;if(r){let b=a+=c;r(b)}d.enqueue(new Uint8Array(o))}catch(s){throw l(s),s}},cancel(d){return l(d),n.return()}},{highWaterMark:2})};var nbo=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ftp=nbo&&typeof ReadableStream=="function",uSS=nbo&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),dtp=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sSS=ftp&&dtp(()=>{let e=!1,t=new Request(NT.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),ltp=64*1024,lMs=ftp&&dtp(()=>us.isReadableStream(new Response("").body)),ibo={stream:lMs&&(e=>e.body)};nbo&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ibo[t]&&(ibo[t]=us.isFunction(e[t])?r=>r[t]():(r,i)=>{throw new mp(`Response type '${t}' is not supported`,mp.ERR_NOT_SUPPORT,i)})})})(new Response);var cSS=async e=>{if(e==null)return 0;if(us.isBlob(e))return e.size;if(us.isSpecCompliantForm(e))return(await new Request(NT.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(us.isArrayBufferView(e)||us.isArrayBuffer(e))return e.byteLength;if(us.isURLSearchParams(e)&&(e=e+""),us.isString(e))return(await uSS(e)).byteLength},lSS=async(e,t)=>{let r=us.toFiniteNumber(e.getContentLength());return r??cSS(t)},ptp=nbo&&(async e=>{let{url:t,method:r,data:i,signal:n,cancelToken:a,timeout:u,onDownloadProgress:l,onUploadProgress:d,responseType:s,headers:o,withCredentials:c="same-origin",fetchOptions:b}=rbo(e);s=s?(s+"").toLowerCase():"text";let g=ctp([n,a&&a.toAbortSignal()],u),O,m=g&&g.unsubscribe&&(()=>{g.unsubscribe()}),w;try{if(d&&sSS&&r!=="get"&&r!=="head"&&(w=await lSS(o,i))!==0){let C=new Request(t,{method:"POST",body:i,duplex:"half"}),R;if(us.isFormData(i)&&(R=C.headers.get("content-type"))&&o.setContentType(R),C.body){let[$,I]=Xbn(w,Z$r(Zbn(d)));i=cMs(C.body,ltp,$,I)}}us.isString(c)||(c=c?"include":"omit");let E="credentials"in Request.prototype;O=new Request(t,{...b,signal:g,method:r.toUpperCase(),headers:o.normalize().toJSON(),body:i,duplex:"half",credentials:E?c:void 0});let A=await fetch(O),q=lMs&&(s==="stream"||s==="response");if(lMs&&(l||q&&m)){let C={};["status","statusText","headers"].forEach(U=>{C[U]=A[U]});let R=us.toFiniteNumber(A.headers.get("content-length")),[$,I]=l&&Xbn(R,Z$r(Zbn(l),!0))||[];A=new Response(cMs(A.body,ltp,$,()=>{I&&I(),m&&m()}),C)}s=s||"text";let D=await ibo[us.findKey(ibo,s)||"text"](A,e);return!q&&m&&m(),await new Promise((C,R)=>{mKt(C,R,{data:D,headers:VI.from(A.headers),status:A.status,statusText:A.statusText,config:e,request:O})})}catch(E){throw m&&m(),E&&E.name==="TypeError"&&/fetch/i.test(E.message)?Object.assign(new mp("Network Error",mp.ERR_NETWORK,e,O),{cause:E.cause||E}):mp.from(E,E&&E.code,e,O)}});var fMs={http:ntp,xhr:stp,fetch:ptp};us.forEach(fMs,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var _tp=e=>`- ${e}`,fSS=e=>us.isFunction(e)||e===null||e===!1,abo={getAdapter:e=>{e=us.isArray(e)?e:[e];let{length:t}=e,r,i,n={};for(let a=0;a<t;a++){r=e[a];let u;if(i=r,!fSS(r)&&(i=fMs[(u=String(r)).toLowerCase()],i===void 0))throw new mp(`Unknown adapter '${u}'`);if(i)break;n[u||"#"+a]=i}if(!i){let a=Object.entries(n).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build")),u=t?a.length>1?`since :
|
|
@@ -1929,7 +1929,7 @@ ${q}${A}${D}${$Mp.default.cursorHide}`});var ala=vi(Qqi(),1);function i7s(e,t){i
|
|
|
1929
1929
|
Run ${Qs.cyan("fern generator upgrade")} to upgrade your generators.`),n.length>2&&(r+=`
|
|
1930
1930
|
Run ${Qs.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),e0n(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function _7s({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:i=!0}){if(!hAp(e))return;let n=t??"",a=e.filter(l=>l.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let u=a.sort((l,d)=>l.generatorName.localeCompare(d.generatorName)||l.currentVersion.localeCompare(d.currentVersion));for(let l of u)n+=`
|
|
1931
1931
|
${await UiD(l.generatorName)} (${l.apiName!=null?"API: "+l.apiName+", ":""}Group: ${l.generatorGroup}) `+Qs.dim(l.currentVersion)+Qs.reset(" \u2192 ")+Qs.green(l.latestVersion);return n+=`
|
|
1932
|
-
`,i?e0n(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function UiD(e){let r=await new _Ap.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 ViD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let l={type:"singleApi",versions:{}};return await vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,o,c)=>{l.versions[s]==null&&(l.versions[s]={});let b=toi(o.name,c),g=await RGt({generatorName:b,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:n,includeMajor:a,context:c});g!=null&&(l.versions[s][o.name]={previousVersion:o.version,latestVersion:g})},generatorFilter:r,groupFilter:i}),l}let u={type:"multiApi",versions:{}};return await vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(l,d,s,o)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][d]==null&&(u.versions[l][d]={});let c=toi(s.name,o),b=await RGt({generatorName:c,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:o});b!=null&&(u.versions[l][d][s.name]={previousVersion:s.version,latestVersion:b})},generatorFilter:r,groupFilter:i}),u}async function vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let l=await q4t({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(l==null||l.groups==null)){for(let d of l.groups)if(!(n!=null&&d.groupName!==n))for(let s of d.generators)i!=null&&s.name!==i||await r(a.workspaceName,d.groupName,s,u)}})}))}function bAp(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[u,l]of Object.entries(a)){r.debug(`Checking if ${u} in group ${n} has an upgrade available...`);let d=Qre(l.latestVersion,l.previousVersion);r.debug(`Latest version: ${l.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:u,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:l.previousVersion,latestVersion:l.latestVersion})}return i}async function aSo({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let u=[];if(e!=null){let l=await ViD({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(l.type==="multiApi")for(let[d,s]of Object.entries(l.versions))u.push(...bAp(s,d,t.logger));else u.push(...bAp(l.versions,void 0,t.logger))}return u}var pla=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${n} ${a}`.trim(),l=u?`status code ${u}`:"an unknown error";super(`Request failed with ${l}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var Wmn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Hmn=e=>e!==null&&typeof e=="object";var _la=(...e)=>{for(let t of e)if((!Hmn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return v7s({},...e)},h7s=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,u]of n.entries())i&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function oSo(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:v7s(e[r]??[],t[r]??[])}var y7s=(e={},t={})=>({beforeRequest:oSo(e,t,"beforeRequest"),beforeRetry:oSo(e,t,"beforeRetry"),afterResponse:oSo(e,t,"afterResponse"),beforeError:oSo(e,t,"beforeError")}),v7s=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(Hmn(n)){for(let[a,u]of Object.entries(n))Hmn(u)&&a in t&&(u=v7s(t[a],u)),t={...t,[a]:u};Hmn(n.hooks)&&(i=y7s(i,n.hooks),t.hooks=i),Hmn(n.headers)&&(r=h7s(r,n.headers),t.headers=r)}return t};var gAp=(()=>{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})(),OAp=typeof globalThis.AbortController=="function",mAp=typeof globalThis.ReadableStream=="function",PAp=typeof globalThis.FormData=="function",uSo=["get","post","put","patch","head","delete"],WiD=()=>{};WiD();var jAp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},sSo=2147483647,cSo=Symbol("stop"),wAp={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},SAp={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 EAp=e=>uSo.includes(e)?e.toUpperCase():e,HiD=["get","put","head","delete","options","trace"],$iD=[408,413,429,500,502,503,504],GiD=[413,429,503],DAp={limit:2,methods:HiD,statusCodes:$iD,afterStatusCodes:GiD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},MAp=(e={})=>{if(typeof e=="number")return{...DAp,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{...DAp,...e}};async function b7s(e,t,r,i){return new Promise((n,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new Wmn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(u)})})}async function g7s(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 AAp=(e,t)=>{let r={};for(let i in t)!(i in SAp)&&!(i in wAp)&&!(i in e)&&(r[i]=t[i]);return r};var hla=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>sSo)throw new RangeError(`The \`timeout\` option cannot be greater than ${sSo}`);await Promise.resolve();let l=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(l.clone()));s instanceof globalThis.Response&&(l=s)}if(i._decorateResponse(l),!l.ok&&i._options.throwHttpErrors){let d=new pla(l,i.request,i._options);for(let s of i._options.hooks.beforeError)d=await s(d);throw d}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!mAp)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return i._stream(l.clone(),i._options.onDownloadProgress)}return l},u=i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n();for(let[l,d]of Object.entries(jAp))u[l]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let o=(await u).clone();if(l==="json"){if(o.status===204||(await o.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await o.text())}return o[l]()};return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:h7s(this._input.headers,r.headers),hooks:y7s({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:EAp(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:MAp(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(OAp){this.abortController=new globalThis.AbortController;let i=this._options.signal??this._input.signal;i?.addEventListener("abort",()=>{this.abortController.abort(i.reason)}),this._options.signal=this.abortController.signal}if(gAp&&(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),this._options.searchParams){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(PAp&&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)}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof Wmn)throw t;if(t instanceof pla){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),sSo);if(this._retryCount<1)throw r;await g7s(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})===cSo)return;return this._retry(t)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let n=await i(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=AAp(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):b7s(r,t,this.abortController,this._options)}_stream(t,r){let i=Number(t.headers.get("content-length"))||0,n=0;return t.status===204?(r&&r({percent:1,totalBytes:i,transferredBytes:n},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(a){let u=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:i},new Uint8Array);async function l(){let{done:d,value:s}=await u.read();if(d){a.close();return}if(r){n+=s.byteLength;let o=i===0?0:n/i;r({percent:o,transferredBytes:n,totalBytes:i},s)}a.enqueue(s),await l()}await l()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var O7s=e=>{let t=(r,i)=>hla.create(r,_la(e,i));for(let r of uSo)t[r]=(i,n)=>hla.create(i,_la(e,n,{method:r}));return t.create=r=>O7s(_la(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),O7s(_la(e,r))),t.stop=cSo,t},QiD=O7s(),qAp=QiD;var kAp=vi(ZAp(),1);function S7s(e){let t=(0,kAp.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var Qqp=vi(Gqp(),1),Jqp=vi(Qqi(),1),F7s=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},L7s=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function U7s(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??S7s(n),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),l=(0,Qqp.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,l&&(d.authorization=`${l.type} ${l.token}`);let s;try{s=await qAp(u,{headers:d,keepalive:!0}).json()}catch(c){throw c?.response?.status===404?new F7s(e):c}if(t.allVersions)return s;let o=new L7s(e,r);if(s["dist-tags"][r]){let{time:c}=s;s=s.versions[s["dist-tags"][r]],s.time=c}else if(r){let c=!!s.versions[r];if(i&&!c)for(let[g,O]of Object.entries(s.versions))O.deprecated&&delete s.versions[g];if(!c){let g=Object.keys(s.versions);if(r=Jqp.default.maxSatisfying(g,r),!r)throw o}let{time:b}=s;if(s=s.versions[r],s.time=b,!s)throw o}return s}async function mla(e,t){let{version:r}=await U7s(e.toLowerCase(),t);return r}async function kci({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:mla(e.packageName,{version:t?"prerelease":"latest"})}var Kqp=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],mSo=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=B0.Info;constructor(t){this.ttyAwareLogger=new nSo(t);let r=this.getPackageName(),i=this.getPackageVersion(),n=this.getCliName();(r==null||i==null||n==null)&&this.exitProgram(),this.environment={packageName:r,packageVersion:i,cliName:n}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.56.0"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${Qs.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new dte}failWithoutThrowing(t,r){this.didSucceed=!1,eSo({message:t,error:r,logger:this.logger})}async exit(){this._suppressUpgradeMessage||await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await $bn()).flush(),this.exitProgram()}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await yAp({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1932
|
+
`,i?e0n(n,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):n}async function UiD(e){let r=await new _Ap.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 ViD({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){if(t.length===1){let l={type:"singleApi",versions:{}};return await vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,o,c)=>{l.versions[s]==null&&(l.versions[s]={});let b=toi(o.name,c),g=await RGt({generatorName:b,cliVersion:e.environment.packageVersion,currentGeneratorVersion:o.version,channel:n,includeMajor:a,context:c});g!=null&&(l.versions[s][o.name]={previousVersion:o.version,latestVersion:g})},generatorFilter:r,groupFilter:i}),l}let u={type:"multiApi",versions:{}};return await vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(l,d,s,o)=>{if(l==null)return;u.versions[l]==null&&(u.versions[l]={}),u.versions[l][d]==null&&(u.versions[l][d]={});let c=toi(s.name,o),b=await RGt({generatorName:c,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:n,includeMajor:a,context:o});b!=null&&(u.versions[l][d][s.name]={previousVersion:s.version,latestVersion:b})},generatorFilter:r,groupFilter:i}),u}async function vAp({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:i,groupFilter:n}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async u=>{let l=await q4t({absolutePathToWorkspace:a.absoluteFilePath,context:u});if(!(l==null||l.groups==null)){for(let d of l.groups)if(!(n!=null&&d.groupName!==n))for(let s of d.generators)i!=null&&s.name!==i||await r(a.workspaceName,d.groupName,s,u)}})}))}function bAp(e,t,r){let i=[];for(let[n,a]of Object.entries(e))for(let[u,l]of Object.entries(a)){r.debug(`Checking if ${u} in group ${n} has an upgrade available...`);let d=Qre(l.latestVersion,l.previousVersion);r.debug(`Latest version: ${l.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),i.push({generatorName:u,generatorGroup:n,apiName:t,isUpgradeAvailable:d,currentVersion:l.previousVersion,latestVersion:l.latestVersion})}return i}async function aSo({project:e,cliContext:t,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a}){let u=[];if(e!=null){let l=await ViD({cliContext:t,project:e,generatorFilter:r,groupFilter:i,channel:n,includeMajor:a});if(l.type==="multiApi")for(let[d,s]of Object.entries(l.versions))u.push(...bAp(s,d,t.logger));else u.push(...bAp(l.versions,void 0,t.logger))}return u}var pla=class extends Error{response;request;options;constructor(t,r,i){let n=t.status||t.status===0?t.status:"",a=t.statusText||"",u=`${n} ${a}`.trim(),l=u?`status code ${u}`:"an unknown error";super(`Request failed with ${l}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=i}};var Wmn=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var Hmn=e=>e!==null&&typeof e=="object";var _la=(...e)=>{for(let t of e)if((!Hmn(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return v7s({},...e)},h7s=(e={},t={})=>{let r=new globalThis.Headers(e),i=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(let[a,u]of n.entries())i&&u==="undefined"||u===void 0?r.delete(a):r.set(a,u);return r};function oSo(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:v7s(e[r]??[],t[r]??[])}var y7s=(e={},t={})=>({beforeRequest:oSo(e,t,"beforeRequest"),beforeRetry:oSo(e,t,"beforeRetry"),afterResponse:oSo(e,t,"afterResponse"),beforeError:oSo(e,t,"beforeError")}),v7s=(...e)=>{let t={},r={},i={};for(let n of e)if(Array.isArray(n))Array.isArray(t)||(t=[]),t=[...t,...n];else if(Hmn(n)){for(let[a,u]of Object.entries(n))Hmn(u)&&a in t&&(u=v7s(t[a],u)),t={...t,[a]:u};Hmn(n.hooks)&&(i=y7s(i,n.hooks),t.hooks=i),Hmn(n.headers)&&(r=h7s(r,n.headers),t.headers=r)}return t};var gAp=(()=>{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})(),OAp=typeof globalThis.AbortController=="function",mAp=typeof globalThis.ReadableStream=="function",PAp=typeof globalThis.FormData=="function",uSo=["get","post","put","patch","head","delete"],WiD=()=>{};WiD();var jAp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},sSo=2147483647,cSo=Symbol("stop"),wAp={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},SAp={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 EAp=e=>uSo.includes(e)?e.toUpperCase():e,HiD=["get","put","head","delete","options","trace"],$iD=[408,413,429,500,502,503,504],GiD=[413,429,503],DAp={limit:2,methods:HiD,statusCodes:$iD,afterStatusCodes:GiD,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},MAp=(e={})=>{if(typeof e=="number")return{...DAp,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{...DAp,...e}};async function b7s(e,t,r,i){return new Promise((n,a)=>{let u=setTimeout(()=>{r&&r.abort(),a(new Wmn(e))},i.timeout);i.fetch(e,t).then(n).catch(a).then(()=>{clearTimeout(u)})})}async function g7s(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 AAp=(e,t)=>{let r={};for(let i in t)!(i in SAp)&&!(i in wAp)&&!(i in e)&&(r[i]=t[i]);return r};var hla=class e{static create(t,r){let i=new e(t,r),n=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>sSo)throw new RangeError(`The \`timeout\` option cannot be greater than ${sSo}`);await Promise.resolve();let l=await i._fetch();for(let d of i._options.hooks.afterResponse){let s=await d(i.request,i._options,i._decorateResponse(l.clone()));s instanceof globalThis.Response&&(l=s)}if(i._decorateResponse(l),!l.ok&&i._options.throwHttpErrors){let d=new pla(l,i.request,i._options);for(let s of i._options.hooks.beforeError)d=await s(d);throw d}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!mAp)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return i._stream(l.clone(),i._options.onDownloadProgress)}return l},u=i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(n):n();for(let[l,d]of Object.entries(jAp))u[l]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||d);let o=(await u).clone();if(l==="json"){if(o.status===204||(await o.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await o.text())}return o[l]()};return u}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:h7s(this._input.headers,r.headers),hooks:y7s({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:EAp(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:MAp(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(OAp){this.abortController=new globalThis.AbortController;let i=this._options.signal??this._input.signal;i?.addEventListener("abort",()=>{this.abortController.abort(i.reason)}),this._options.signal=this.abortController.signal}if(gAp&&(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),this._options.searchParams){let n="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,n);(PAp&&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)}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof Wmn)throw t;if(t instanceof pla){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),sSo);if(this._retryCount<1)throw r;await g7s(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})===cSo)return;return this._retry(t)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let n=await i(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=AAp(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):b7s(r,t,this.abortController,this._options)}_stream(t,r){let i=Number(t.headers.get("content-length"))||0,n=0;return t.status===204?(r&&r({percent:1,totalBytes:i,transferredBytes:n},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(a){let u=t.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:i},new Uint8Array);async function l(){let{done:d,value:s}=await u.read();if(d){a.close();return}if(r){n+=s.byteLength;let o=i===0?0:n/i;r({percent:o,transferredBytes:n,totalBytes:i},s)}a.enqueue(s),await l()}await l()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}};var O7s=e=>{let t=(r,i)=>hla.create(r,_la(e,i));for(let r of uSo)t[r]=(i,n)=>hla.create(i,_la(e,n,{method:r}));return t.create=r=>O7s(_la(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),O7s(_la(e,r))),t.stop=cSo,t},QiD=O7s(),qAp=QiD;var kAp=vi(ZAp(),1);function S7s(e){let t=(0,kAp.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var Qqp=vi(Gqp(),1),Jqp=vi(Qqi(),1),F7s=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},L7s=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function U7s(e,t={}){let{version:r="latest"}=t,{omitDeprecated:i=!0}=t,n=e.split("/")[0],a=t.registryUrl??S7s(n),u=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),l=(0,Qqp.default)(a.toString(),{recursive:!0}),d={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};t.fullMetadata&&delete d.accept,l&&(d.authorization=`${l.type} ${l.token}`);let s;try{s=await qAp(u,{headers:d,keepalive:!0}).json()}catch(c){throw c?.response?.status===404?new F7s(e):c}if(t.allVersions)return s;let o=new L7s(e,r);if(s["dist-tags"][r]){let{time:c}=s;s=s.versions[s["dist-tags"][r]],s.time=c}else if(r){let c=!!s.versions[r];if(i&&!c)for(let[g,O]of Object.entries(s.versions))O.deprecated&&delete s.versions[g];if(!c){let g=Object.keys(s.versions);if(r=Jqp.default.maxSatisfying(g,r),!r)throw o}let{time:b}=s;if(s=s.versions[r],s.time=b,!s)throw o}return s}async function mla(e,t){let{version:r}=await U7s(e.toLowerCase(),t);return r}async function kci({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:mla(e.packageName,{version:t?"prerelease":"latest"})}var Kqp=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],mSo=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=B0.Info;constructor(t){this.ttyAwareLogger=new nSo(t);let r=this.getPackageName(),i=this.getPackageVersion(),n=this.getCliName();(r==null||i==null||n==null)&&this.exitProgram(),this.environment={packageName:r,packageVersion:i,cliName:n}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.56.3"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logDebugInfo(){this.logger.debug(`Running ${Qs.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new dte}failWithoutThrowing(t,r){this.didSucceed=!1,eSo({message:t,error:r,logger:this.logger})}async exit(){this._suppressUpgradeMessage||await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await $bn()).flush(),this.exitProgram()}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((i,n)=>setTimeout(()=>n("Request timed out"),300))]),r=await yAp({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
1933
1933
|
`)||(r+=`
|
|
1934
1934
|
`),this.logger.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram(){process.exit(this.didSucceed?0:1)}longestWorkspaceName;registerWorkspaces(t){let r=Nus(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 ola(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 dte}finally{i.finish()}return n}async instrumentPostHogEvent(t){(await $bn()).sendEvent(t)}logger=CHr(this.log.bind(this));constructTaskInitForWorkspace(t){let r=Yqp(t.type==="docs"?"docs":t.workspaceName??"api"),i=1+(this.longestWorkspaceName!=null?Yqp(this.longestWorkspaceName):r).length,n=r.padEnd(i),a=Kqp[this.numTasks++%Kqp.length],u=Qs.hex(a)(n);return{...this.constructTaskInit(),logPrefix:u}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===dC.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}])}logImmediately(t){let r=t.filter(i=>vai.indexOf(i.level)>=vai.indexOf(this.logLevel));this.ttyAwareLogger.log(r,{includeDebugInfo:this.logLevel===B0.Debug})}_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 kci({cliEnvironment:this.environment,includePreReleases:t}),i=Qre(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(i?"Upgrade available.":"No upgrade available."));let n={isUpgradeAvailable:i,latestVersion:r},a=await aSo({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:n,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){return await X3s({message:t,default:r})}async getInput(t){return await Z3s({message:t.message,default:t.default})}};function Yqp(e){return`[${e}]:`}var _Hp=require("fs/promises");function Jre({breadcrumbs:e=[],title:t,subtitle:r}){let i=[];return e.length>0&&i.push(Qs.blue(e.join(" -> "))),i.push(t),r!=null&&i.push(Qs.dim(r)),i.join(`
|
|
1935
1935
|
`)}var E5p=require("fs/promises");var F8t=class e{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;type=e.Type;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}};var cSe=class extends F8t{definition;sources;constructor({definition:t,sources:r,...i}){super(i),this.definition=t,this.sources=r??[]}async getDefinition(){return this.definition}async toFernWorkspace(){return this}getSources(){return this.sources}getAbsoluteFilePaths(){return[this.absoluteFilePath]}};var Pla=class{context;constructor(t){this.context=t}};var PSo=class e{files={};directories={};getAllFiles(){let t={},r=(i,n)=>{for(let[u,l]of Object.entries(i.files)){let d=n!=null?ry.of(`${n}${X2t}${u}`):ry.of(u);t[d]=l}let a=Object.keys(i.directories).sort();for(let u of a){let l=n!=null?`${n}${X2t}${u}`:u,d=i.directories[u];r(d,l)}};return r(this),t}getOrCreateFile(t){return this.getOrCreateFileRecursive(t.split(X2t))}getOrCreateFileRecursive(t){if(t.length===1)return this.files[ry.of(t[0])]??={};let[r,...i]=t;if(r==null)throw new Error(`Internal error; cannot add file with path: ${t}`);return this.directories[r]||(this.directories[r]=new e),this.directories[r].getOrCreateFileRecursive(i)}};var Yxi=class{enableUniqueErrorsPerEndpoint;root;rootApiFile;packageMarkerFile={};basePath=void 0;constructor(t){this.enableUniqueErrorsPerEndpoint=t,this.root=new PSo,this.rootApiFile={name:"api","error-discrimination":{strategy:"status-code"}}}setDisplayName({displayName:t}){this.rootApiFile["display-name"]=t}addNavigation({navigation:t}){this.packageMarkerFile.navigation=t}setServiceInfo(t,{auth:r,"base-path":i,"display-name":n,docs:a}){let u=this.getOrCreateFile(t);u.service==null&&(u.service={auth:!1,"base-path":"",endpoints:{}}),r!=null&&(u.service.auth=r),i!=null&&(u.service["base-path"]=i),n!=null&&(u.service["display-name"]=n),a!=null&&(u.docs=a)}addAudience(t){this.rootApiFile.audiences==null&&(this.rootApiFile.audiences=[]),this.rootApiFile.audiences.push(t)}setAuth(t){this.rootApiFile.auth=t}addAuthScheme({name:t,schema:r}){this.rootApiFile["auth-schemes"]==null&&(this.rootApiFile["auth-schemes"]={}),this.rootApiFile["auth-schemes"][t]==null&&(this.rootApiFile["auth-schemes"][t]=r)}setDefaultEnvironment(t){this.rootApiFile["default-environment"]=t}setDefaultUrl(t){this.rootApiFile["default-url"]=t}setBasePath(t){this.basePath=t}setApiVersion(t){this.rootApiFile.version=t}getEnvironmentType(){let t=Object.entries(this.rootApiFile.environments??{})[0];if(t!=null)return o$r(t[1],{singleBaseUrl:()=>"single",multipleBaseUrls:()=>"multi"})}addEnvironment({name:t,schema:r}){this.rootApiFile.environments==null&&(this.rootApiFile.environments={}),this.rootApiFile.environments[t]=r}getGlobalHeaderNames(){let t=Object.keys(this.rootApiFile.headers??{});if(this.rootApiFile["auth-schemes"]!=null)for(let i of Object.values(this.rootApiFile["auth-schemes"]))ZnD(i)&&t.push(i.header);let r=this.getVersionHeader();return r!=null&&t.push(r),new Set(t)}addGlobalHeader({name:t,schema:r}){let i=this.getVersionHeader();i!=null&&i===t||(this.rootApiFile.headers==null&&(this.rootApiFile.headers={}),this.rootApiFile.headers[t]=r)}addIdempotencyHeader({name:t,schema:r}){this.rootApiFile["idempotency-headers"]==null&&(this.rootApiFile["idempotency-headers"]={}),this.rootApiFile["idempotency-headers"][t]=r}addVariable({name:t,schema:r}){this.rootApiFile.variables==null&&(this.rootApiFile.variables={}),this.rootApiFile.variables[t]=r}addImport({file:t,fileToImport:r,alias:i}){if(t===r)return;let n=i??vg((UCe(r)+"/"+XAi(r,{stripExtension:!0})).replaceAll("__package__","root"));if(t===ry.of(T3))return this.rootApiFile.imports==null&&(this.rootApiFile.imports={}),this.rootApiFile.imports[n]=XKa(UCe(Zdn.of(`/${t}`)),Zdn.of(`/${r}`)),n;let a=this.getOrCreateFile(t);return a.imports==null&&(a.imports={}),a.imports[n]=XKa(UCe(Zdn.of(`/${t}`)),Zdn.of(`/${r}`)),n}addType(t,{name:r,schema:i}){let n=this.getOrCreateFile(t);n.types==null&&(n.types={}),n.types[r]=i}addTypeExample(t,r,i){let n=this.getOrCreateFile(t);n.types==null&&(n.types={});let a=n.types[r];a!=null&&(typeof a=="string"?n.types[r]={type:a,examples:[i]}:(a.examples==null&&(a.examples=[]),a.examples.push(i)))}addError(t,{name:r,schema:i}){let n=this.getOrCreateFile(t);n.errors==null&&(n.errors={}),n.errors[r]==null?n.errors[r]=i:n.errors[r]?.type!==i.type&&(n.errors[r]={"status-code":i["status-code"],type:"unknown"})}addErrorExample(t,{name:r,example:i}){let n=this.getOrCreateFile(t);if(n.errors==null)return;let a=n.errors[r];if(a==null)return;a.examples==null&&(a.examples=[]),(a.examples.some(l=>u1e(l,i))??!1)||a.examples?.push(i)}addEndpoint(t,{name:r,schema:i,source:n}){let a=this.getOrCreateFile(t);a.service==null&&(a.service={auth:!1,"base-path":"",endpoints:{}}),n!=null&&(a.service.source=n),a.service.endpoints[r]=i}addWebhook(t,{name:r,schema:i}){let n=this.getOrCreateFile(t);n.webhooks==null&&(n.webhooks={}),n.webhooks[r]=i}addChannel(t,{channel:r}){let i=this.getOrCreateFile(t);i.channel=r;let n=this.basePath;n!=null&&(i.channel.path=sR(n,r.path))}addChannelExample(t,{example:r}){let i=this.getOrCreateFile(t);i.channel==null&&(i.channel={path:"",auth:!1}),i.channel.messages==null&&(i.channel.messages={}),i.channel.examples==null&&(i.channel.examples=[]),i.channel.examples.push(r)}addChannelMessage(t,{messageId:r,message:i}){let n=this.getOrCreateFile(t);n.channel==null&&(n.channel={path:"",auth:!1}),n.channel.messages==null&&(n.channel.messages={}),n.channel.messages[r]=i}build(){let t=this.root.getAllFiles(),r=this.basePath;if(r!=null){this.packageMarkerFile.service!=null&&(this.packageMarkerFile.service={...this.packageMarkerFile.service,endpoints:Object.fromEntries(Object.entries(this.packageMarkerFile.service.endpoints).map(([n,a])=>[n,{...a,path:sR(r,a.path)}]))});for(let n of Object.values(t))n.service!=null&&(n.service={...n.service,endpoints:Object.fromEntries(Object.entries(n.service.endpoints).map(([a,u])=>[a,{...u,path:sR(r,u.path)}]))})}return{rootApiFile:this.rootApiFile,packageMarkerFile:this.packageMarkerFile,definitionFiles:t}}getOrCreateFile(t){return t===W1?this.packageMarkerFile:this.root.getOrCreateFile(t)}getVersionHeader(){if(this.rootApiFile.version!=null)return typeof this.rootApiFile.version.header=="string"?this.rootApiFile.version.header:this.rootApiFile.version.header.value}};function ZnD(e){return e?.header!=null}var Kre={openapi:e=>({...e,type:"openapi",_visit:function(t){return Kre._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return Kre._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"openapi":return t.openapi(e);case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var Xmn={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return Xmn._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var k8={basic:e=>({...e,type:"basic",_visit:function(t){return k8._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return k8._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return k8._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return k8._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return k8._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"basic":return t.basic(e);case"bearer":return t.bearer(e);case"header":return t.header(e);case"query":return t.query(e);case"oauth":return t.oauth(e);default:return t._other(e)}}};var Q0={primitive:e=>({value:e,type:"primitive",_visit:function(t){return Q0._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Q0._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return Q0._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return Q0._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return Q0._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return Q0._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Q0._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return Q0._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e.value);case"object":return t.object(e);case"array":return t.array(e.value);case"map":return t.map(e.value);case"enum":return t.enum(e.value);case"literal":return t.literal(e.value);case"oneOf":return t.oneOf(e.value);case"unknown":return t.unknown(e.value);default:return t._other(e)}}};var i_={int:e=>({value:e,type:"int",_visit:function(t){return i_._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return i_._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return i_._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return i_._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return i_._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return i_._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return i_._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return i_._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return i_._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return i_._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return i_._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e.value);case"int64":return t.int64(e.value);case"uint":return t.uint(e.value);case"uint64":return t.uint64(e.value);case"float":return t.float(e.value);case"double":return t.double(e.value);case"string":return t.string(e.value);case"datetime":return t.datetime(e.value);case"date":return t.date(e.value);case"base64":return t.base64(e.value);case"boolean":return t.boolean(e.value);default:return t._other(e)}}};var Zmn={boolean:e=>({value:e,type:"boolean",_visit:function(t){return Zmn._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return Zmn._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var eli={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return eli._visit(this,t)}}),undiscriminated:e=>({value:e,type:"undiscriminated",_visit:function(t){return eli._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e.value);case"undiscriminated":return t.undiscriminated(e.value);default:return t._other(e)}}};var $U={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case $U.GenerallyAvailable:return t.generallyAvailable();case $U.Beta:return t.beta();case $U.Deprecated:return t.deprecated();default:return t._other()}}};var qIe={cursor:e=>({...e,type:"cursor",_visit(t){return qIe._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit(t){return qIe._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit(t){return qIe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"cursor":return t.cursor(e);case"offset":return t.offset(e);case"custom":return t.custom(e);default:return t._other(e)}}};var GGr={language:e=>({...e,type:"language",_visit:function(t){return GGr._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return GGr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"language":return t.language(e);case"sdk":return t.sdk(e);default:return t._other(e)}}};var GU={Curl:"curl",Python:"python",Javascript:"javascript",Typescript:"typescript",Go:"go",Ruby:"ruby",Csharp:"csharp",Java:"java",Js:"js",Node:"node",Ts:"ts",Nodets:"nodets",Golang:"golang",Dotnet:"dotnet",Jvm:"jvm",_visit:(e,t)=>{switch(e){case GU.Curl:return t.curl();case GU.Python:return t.python();case GU.Javascript:return t.javascript();case GU.Typescript:return t.typescript();case GU.Go:return t.go();case GU.Ruby:return t.ruby();case GU.Csharp:return t.csharp();case GU.Java:return t.java();case GU.Js:return t.js();case GU.Node:return t.node();case GU.Ts:return t.ts();case GU.Nodets:return t.nodets();case GU.Golang:return t.golang();case GU.Dotnet:return t.dotnet();case GU.Jvm:return t.jvm();default:return t._other()}}};var L8t={unknown:e=>({value:e,type:"unknown",_visit:function(t){return L8t._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return L8t._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"unknown":return t.unknown(e.value);case"full":return t.full(e);default:return t._other(e)}}};var TIe={withStreaming:e=>({...e,type:"withStreaming",_visit:function(t){return TIe._visit(this,t)}}),withoutStreaming:e=>({value:e,type:"withoutStreaming",_visit:function(t){return TIe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"withStreaming":return t.withStreaming(e);case"withoutStreaming":return t.withoutStreaming(e.value);default:return t._other(e)}}};var W$={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case W$.Get:return t.get();case W$.Post:return t.post();case W$.Put:return t.put();case W$.Patch:return t.patch();case W$.Delete:return t.delete();case W$.Head:return t.head();case W$.Options:return t.options();case W$.Trace:return t.trace();default:return t._other()}}};var tli={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return tli._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return tli._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return tli._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);default:return t._other(e)}}};var CIe={file:e=>({...e,type:"file",_visit:function(t){return CIe._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return CIe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e.value);default:return t._other(e)}}};var Yre={file:e=>({...e,type:"file",_visit:function(t){return Yre._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return Yre._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return Yre._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return Yre._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return Yre._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return Yre._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var py={primitive:e=>({...e,type:"primitive",_visit:function(t){return py._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return py._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return py._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return py._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return py._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return py._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return py._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return py._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return py._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return py._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return py._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var sj={int:e=>({...e,type:"int",_visit:function(t){return sj._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return sj._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return sj._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return sj._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return sj._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return sj._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return sj._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return sj._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return sj._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return sj._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return sj._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint();case"uint64":return t.uint64();case"float":return t.float();case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime();case"date":return t.date();case"base64":return t.base64();case"boolean":return t.boolean(e);default:return t._other(e)}}};var YB={boolean:e=>({value:e,type:"boolean",_visit:function(t){return YB._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return YB._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"boolean":return t.boolean(e.value);case"string":return t.string(e.value);default:return t._other(e)}}};var QGr={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return QGr._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return QGr._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var lSe={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return lSe._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return lSe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return lSe._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"octetStream":return t.octetStream(e);case"multipart":return t.multipart(e);case"json":return t.json(e);default:return t._other(e)}}};var XB={file:e=>({...e,type:"file",_visit:function(t){return XB._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return XB._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return XB._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return XB._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return XB._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return XB._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"file":return t.file(e);case"json":return t.json(e);case"text":return t.text(e);case"streamingSse":return t.streamingSse(e);case"streamingText":return t.streamingText(e);case"streamingJson":return t.streamingJson(e);default:return t._other(e)}}};var El={primitive:e=>({...e,type:"primitive",_visit:function(t){return El._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return El._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return El._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return El._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return El._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return El._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return El._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return El._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return El._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return El._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return El._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"primitive":return t.primitive(e);case"object":return t.object(e);case"array":return t.array(e);case"map":return t.map(e);case"optional":return t.optional(e);case"enum":return t.enum(e);case"reference":return t.reference(e);case"literal":return t.literal(e);case"oneOf":return t.oneOf(e.value);case"nullable":return t.nullable(e);case"unknown":return t.unknown(e);default:return t._other(e)}}};var PY={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return PY._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return PY._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"discriminated":return t.discriminated(e);case"undiscriminated":return t.undiscriminated(e);default:return t._other(e)}}};var Jd={int:e=>({...e,type:"int",_visit:function(t){return Jd._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return Jd._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return Jd._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return Jd._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return Jd._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return Jd._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Jd._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return Jd._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return Jd._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return Jd._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Jd._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"int":return t.int(e);case"int64":return t.int64(e);case"uint":return t.uint(e);case"uint64":return t.uint64(e);case"float":return t.float(e);case"double":return t.double(e);case"string":return t.string(e);case"datetime":return t.datetime(e);case"date":return t.date(e);case"base64":return t.base64(e);case"boolean":return t.boolean(e);default:return t._other(e)}}};var ev={};Io(ev,{AllOfPropertyConflict:()=>OPn,ArraySchema:()=>zDo,ArraySchemaWithExample:()=>lEo,Availability:()=>CSo,Base64WithExample:()=>aEo,BasicSecurityScheme:()=>ISo,BearerSecurityScheme:()=>zSo,BooleanSchema:()=>qDo,BooleanWithExample:()=>oEo,CasingOverrides:()=>FSo,CommonProperty:()=>HDo,CommonPropertyWithExample:()=>gEo,CursorPagination:()=>hDo,CustomCodeSample:()=>pDo,CustomCodeSampleLanguage:()=>lDo,CustomCodeSampleSdk:()=>dDo,CustomPagination:()=>vDo,DateWithExample:()=>nEo,DatetimeWithExample:()=>iEo,DiscriminatedOneOfSchema:()=>VDo,DiscriminatedOneOfSchemaWithExample:()=>vEo,DoubleSchema:()=>MDo,DoubleWithExample:()=>tEo,Encoding:()=>TSo,Endpoint:()=>bDo,EndpointExample:()=>hPn,EndpointResponseExample:()=>cDo,EndpointSdkName:()=>fYt,EndpointWithExample:()=>DTp,EnumSchema:()=>rPn,EnumSchemaWithExample:()=>sEo,EnumValue:()=>nli,ErrorExample:()=>nDo,FernExample:()=>oDo,FileResponse:()=>lPn,FileSchema:()=>XSo,FloatWithExample:()=>eEo,FullEndpointExample:()=>_Do,FullExample:()=>BA,FullObjectExample:()=>GSo,FullOneOfExample:()=>JSo,GlobalHeader:()=>CDo,Header:()=>oli,HeaderExample:()=>_Pn,HeaderSecurityScheme:()=>RSo,HeaderWithExample:()=>cli,HttpEndpointServer:()=>dPn,HttpError:()=>aDo,HttpErrorWithExample:()=>KDo,HttpMethod:()=>aPn,IdempotencyHeader:()=>BDo,Int64WithExample:()=>XDo,IntSchema:()=>DDo,IntWithExample:()=>YDo,JsonRequest:()=>tDo,JsonRequestWithExample:()=>GDo,JsonResponse:()=>fPn,JsonResponseWithExample:()=>jPn,KeyValuePair:()=>QSo,LiteralExample:()=>$So,LiteralSchema:()=>gPn,LiteralSchemaValue:()=>xDo,LongSchema:()=>EDo,MapSchema:()=>RDo,MapSchemaWithExample:()=>fEo,MultipartRequest:()=>cPn,MultipartRequestProperty:()=>eDo,MultipartRequestPropertyEncoding:()=>kSo,MultipartSchema:()=>ZSo,NamedFullExample:()=>pYt,Namespace:()=>LSo,NamespaceId:()=>HSo,NullableSchema:()=>FDo,NullableSchemaWithExample:()=>pEo,OauthSecurityScheme:()=>VSo,ObjectProperty:()=>UDo,ObjectPropertyConflictInfo:()=>mPn,ObjectPropertyWithExample:()=>yEo,ObjectSchema:()=>IDo,ObjectSchemaWithExample:()=>_Eo,OctetStreamRequest:()=>sPn,OffsetPagination:()=>yDo,OneOfSchema:()=>LDo,OneOfSchemaWithExample:()=>hEo,OpenApiIntermediateRepresentation:()=>wTp,OpenApiSource:()=>ESo,OptionalSchema:()=>NDo,OptionalSchemaWithExample:()=>dEo,Pagination:()=>yPn,PathParameter:()=>oPn,PathParameterExample:()=>uDo,PathParameterWithExample:()=>$Do,PrimitiveExample:()=>nPn,PrimitiveSchema:()=>sli,PrimitiveSchemaValue:()=>TDo,PrimitiveSchemaValueWithExample:()=>uEo,PrimitiveSchemaWithExample:()=>wPn,PropertyKey:()=>iPn,ProtobufEncoding:()=>qSo,ProtobufSource:()=>MSo,QueryParameter:()=>uPn,QueryParameterExample:()=>pPn,QueryParameterWithExample:()=>PPn,QuerySecurityScheme:()=>NSo,ReferencedSchema:()=>dYt,Request:()=>rDo,RequestWithExample:()=>QDo,Response:()=>iDo,ResponseWithExample:()=>JDo,Schema:()=>EO,SchemaId:()=>jY,SchemaWithExample:()=>vM,Schemas:()=>SDo,SdkGroup:()=>USo,SdkGroupInfo:()=>KSo,SdkGroupName:()=>ali,SecurityScheme:()=>WSo,SecuritySchemeId:()=>xSo,Server:()=>Dla,Source:()=>ASo,StatusCode:()=>sYt,StreamingResponseExample:()=>sDo,StringSchema:()=>ADo,StringSchemaWithExample:()=>rEo,SupportedSdkLanguage:()=>fDo,Tag:()=>BSo,TagId:()=>wY,Tags:()=>YSo,TextResponse:()=>uli,Uint64WithExample:()=>kDo,UintWithExample:()=>ZDo,UnDiscriminatedOneOfSchema:()=>WDo,UnDiscriminatedOneOfSchemaWithExample:()=>bEo,UnknownSchemaWithExample:()=>cEo,Webhook:()=>gDo,WebhookExampleCall:()=>bPn,WebhookHttpMethod:()=>vPn,WebhookWithExample:()=>ETp,WebsocketChannel:()=>wDo,WebsocketHandshake:()=>ODo,WebsocketHandshakeWithExample:()=>STp,WebsocketMessageExample:()=>PDo,WebsocketServer:()=>mDo,WebsocketSessionExample:()=>jDo,WithAvailability:()=>uh,WithDescription:()=>Of,WithEncoding:()=>Xre,WithInline:()=>XD,WithName:()=>Xb,WithNamespace:()=>lYt,WithSdkGroupName:()=>DO,WithSource:()=>ny,WithStatusCode:()=>cYt,WithTitle:()=>SO,commons:()=>G7s,example:()=>Q7s,finalIr:()=>J7s,parseIr:()=>K7s});var G7s={};Io(G7s,{BasicSecurityScheme:()=>ISo,BearerSecurityScheme:()=>zSo,Encoding:()=>TSo,HeaderSecurityScheme:()=>RSo,Namespace:()=>LSo,NamespaceId:()=>HSo,OauthSecurityScheme:()=>VSo,OpenApiSource:()=>ESo,ProtobufEncoding:()=>qSo,ProtobufSource:()=>MSo,QuerySecurityScheme:()=>NSo,SchemaId:()=>jY,SdkGroup:()=>USo,SdkGroupName:()=>ali,SecurityScheme:()=>WSo,SecuritySchemeId:()=>xSo,Server:()=>Dla,Source:()=>ASo,StatusCode:()=>sYt,Tag:()=>BSo,TagId:()=>wY,WithAvailability:()=>uh,WithDescription:()=>Of,WithEncoding:()=>Xre,WithInline:()=>XD,WithName:()=>Xb,WithNamespace:()=>lYt,WithSdkGroupName:()=>DO,WithSource:()=>ny,WithStatusCode:()=>cYt,WithTitle:()=>SO});var At={};Io(At,{JsonError:()=>kmn,ParseError:()=>ePn,any:()=>fTp,bigint:()=>Zqp,boolean:()=>dTp,booleanLiteral:()=>lTp,date:()=>kqp,discriminant:()=>mTp,enum_:()=>wSo,getObjectLikeUtils:()=>U8t,getObjectUtils:()=>Xxi,getSchemaUtils:()=>CA,isProperty:()=>ili,lazy:()=>eTp,lazyObject:()=>uTp,list:()=>DSo,number:()=>pTp,object:()=>SSo,objectWithoutOptionalProperties:()=>oTp,optional:()=>V7s,property:()=>rTp,record:()=>vTp,set:()=>bTp,string:()=>_Tp,stringLiteral:()=>cTp,transform:()=>W7s,undiscriminatedUnion:()=>OTp,union:()=>jTp,unknown:()=>hTp,withParsedProperties:()=>$7s});var FP={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",OPTIONAL:"optional"};function yM(e,t){return`Expected ${t}. Received ${knD(e)}.`}function knD(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(e instanceof BigInt)return"BigInt";switch(typeof e){case"string":return`"${e}"`;case"bigint":case"number":case"boolean":case"undefined":return`${e}`}return typeof e}function e5(e){return{...e,json:Xqp(e.json),parse:Xqp(e.parse)}}function Xqp(e){return(t,r)=>{let i=e(t,r),{skipValidation:n=!1}=r??{};return!i.ok&&n?(console.warn(["Failed to validate.",...i.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|
|
@@ -1992,7 +1992,7 @@ ${U.stack}`)),O}};O=await A();let q=g.apiWorkspaces.flatMap($=>$.getAbsoluteFile
|
|
|
1992
1992
|
`}),r.push(e[i]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
1993
1993
|
`}),r}function hd_(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function qZs(e,t){let r=yd_(e,t),i=r.one(e,void 0),n=_d_(r),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return n&&("children"in a,a.children.push({type:"text",value:`
|
|
1994
1994
|
`},n)),a}var vd_=require("fs");var XZD=["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"];function ZZD({readFile:e=r=>(0,vd_.readFileSync)(r,"utf-8"),...t}){let r=new Set,i=[t],n=[],a=[],u=1e3,l=0;do{if(l++,l>u)throw new Error("Infinite loop detected while collecting links and sources");let d=i.shift();if(d==null)break;let{content:s,absoluteFilepath:o}=d;if(o!=null){if(r.has(o))throw new Error(`Circular import detected: ${o}`);r.add(o)}let c=r1n(s),b=qZs(c,{allowDangerousHtml:!0,passThrough:[...XZD]});Rf(b,g=>{if(g.type==="mdxjsEsm"&&o!=null)return g.data?.estree&&XYt(g.data.estree,{enter:m=>{if(m.type==="ImportDeclaration"&&m.source.type==="Literal"&&typeof m.source.value=="string"){let w=Xa.of(m.source.value),E=OO(fp(o),w);(E.endsWith(".mdx")||E.endsWith(".md"))&&i.push({content:e(E),absoluteFilepath:E})}}}),"skip";if(g.type==="element"){let m=g.properties.href;typeof m=="string"&&n.push({href:m,sourceFilepath:o,position:g.position});let w=g.properties.src;typeof w=="string"&&a.push({src:w,sourceFilepath:o,position:g.position})}function O(m,w){i1n(m,{src:E=>{let A=BQr(E.value);typeof A=="string"&&a.push({src:A,sourceFilepath:o,position:w})},href:E=>{let A=BQr(E.value);typeof A=="string"&&n.push({href:A,sourceFilepath:o,position:w})}})}if(g.type==="mdxJsxFlowElement"||g.type==="mdxJsxTextElement"){let m=zfi(g.attributes.filter(xQr).find(E=>E.name==="href")?.value),w=zfi(g.attributes.filter(xQr).find(E=>E.name==="src")?.value);if(g.name==="Markdown"){if(o&&typeof w=="string"){let E=OO(fp(o),w);i.push({content:e(E),absoluteFilepath:E})}return"skip"}typeof m=="string"&&n.push({href:m,sourceFilepath:o,position:g.position}),typeof w=="string"&&a.push({src:w,sourceFilepath:o,position:g.position}),g.attributes.forEach(E=>{E.type==="mdxJsxAttribute"&&typeof E.value!="string"&&E.value!=null&&E.value.data?.estree?O(E.value.data.estree,E.position):E.type==="mdxJsxExpressionAttribute"&&E.data?.estree&&O(E.data.estree,E.position)})}(g.type==="mdxFlowExpression"||g.type==="mdxTextExpression")&&g.data?.estree&&O(g.data.estree,g.position)})}while(i.length>0);return{links:n,sources:a}}function bd_({content:e,absoluteFilepath:t}){try{return ZZD({content:e,absoluteFilepath:t})}catch{return{links:[],sources:[]}}}function gd_({relativeFilepath:e,allRuleVisitors:t,addViolations:r}){function i(n){let a=async(u,l)=>{for(let d of t){let s=d[n];if(s!=null){let o=await s(u);r(o.map(c=>({name:c.name,severity:c.severity,relativeFilepath:c.relativeFilepath??Xa.of(""),nodePath:l,message:c.message})))}}};return{[n]:a}}return{...i("file"),...i("filepath"),...i("markdownPage"),...i("versionFile"),...i("apiSection"),...i("permissions")}}var Pd_=require("fs/promises");async function pV({absoluteFilepathToConfiguration:e,rawUnresolvedFilepath:t,visitor:r,nodePath:i,willBeUploaded:n=!0}){let a=OO(fp(e),t);await r.filepath?.({absoluteFilepath:a,value:t,willBeUploaded:n},[a])}var Od_=require("fs/promises");async function CZs({absolutePathToFernFolder:e,navigation:t,fernWorkspaces:r,visitor:i,absoluteFilepathToConfiguration:n,context:a,nodePath:u}){tkD(t)?await Promise.all(t.map(async(l,d)=>{l.layout!=null&&await Promise.all(l.layout.map(async(s,o)=>{await TZs({absolutePathToFernFolder:e,navigationItem:s,visitor:i,nodePath:[...u,`${d}`,"layout",`${o}`],absoluteFilepathToConfiguration:n,fernWorkspaces:r,context:a})}))})):await Promise.all(t.map(async(l,d)=>{await TZs({absolutePathToFernFolder:e,navigationItem:l,visitor:i,nodePath:[...u,`${d}`],absoluteFilepathToConfiguration:n,fernWorkspaces:r,context:a})}))}async function TZs({absolutePathToFernFolder:e,navigationItem:t,visitor:r,nodePath:i,absoluteFilepathToConfiguration:n,fernWorkspaces:a,context:u}){if(await RHt(t,{alphabetized:Qo,api:Qo,apiName:Qo,audiences:Qo,openrpc:async l=>{l!=null&&await pV({absoluteFilepathToConfiguration:n,rawUnresolvedFilepath:l,visitor:r,nodePath:[...i,"openrpc"],willBeUploaded:!1})},displayErrors:Qo,snippets:Qo,summary:Qo,title:Qo,layout:Qo,icon:Qo,slug:Qo,hidden:Qo,skipSlug:Qo,paginated:Qo,playground:Qo,flattened:Qo,featureFlag:Qo,path:async l=>{l!=null&&await pV({absoluteFilepathToConfiguration:n,rawUnresolvedFilepath:l,visitor:r,nodePath:[...i,"path"],willBeUploaded:!1})},page:Qo,contents:async l=>{l!=null&&await Promise.all(l.map(async(d,s)=>{await TZs({absolutePathToFernFolder:e,navigationItem:d,visitor:r,nodePath:[...i,"contents",`${s}`],absoluteFilepathToConfiguration:n,fernWorkspaces:a,context:u})}))},viewers:async l=>{l!=null&&l.length>0&&await r.permissions?.({viewers:l},[...i,"viewers"])},orphaned:Qo}),kZD(t)){let l=OO(fp(n),t.path);if(await Cf(l)){let d=(await(0,Od_.readFile)(l)).toString();await r.markdownPage?.({title:t.page,content:d,absoluteFilepath:l},[...i,t.path]);try{let{filepaths:s}=d_a(d,{absolutePathToFernFolder:e,absolutePathToMarkdownFile:l});for(let o of s)await r.filepath?.({absoluteFilepath:o,value:Qq(e,o),willBeUploaded:!0},[...i,t.path])}catch{}}}if(ekD(t)){let l=a.find(d=>d.workspaceName===t.apiName);l!=null&&await r.apiSection?.({config:t,workspace:l,context:u},[...i,"api"])}}function kZD(e){return e.page!=null}function ekD(e){return e.api!=null}function tkD(e){return e[0]?.tab!=null}async function jd_({contents:e,visitor:t,absoluteFilepathToConfiguration:r,context:i,fernWorkspaces:n,absolutePathToFernFolder:a}){await t.file?.({config:e},[]),await RHt(e,{instances:Qo,analytics:Qo,announcement:Qo,backgroundImage:async u=>{u!=null&&(typeof u=="string"?await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:u,visitor:t,nodePath:["background-image"]}):(u.dark!=null&&await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:u.dark,visitor:t,nodePath:["background-image","dark"]}),u.light!=null&&await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:u.light,visitor:t,nodePath:["background-image","light"]})))},colors:Qo,css:async u=>{u!=null&&(Array.isArray(u)?await Promise.all(u.map((l,d)=>pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:l,visitor:t,nodePath:["css",`${d}`],willBeUploaded:!1}))):await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:u,visitor:t,nodePath:["css"],willBeUploaded:!1}))},defaultLanguage:Qo,experimental:Qo,favicon:async u=>{u!=null&&await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:u,visitor:t,nodePath:["favicon"]})},footerLinks:Qo,integrations:Qo,js:async u=>{u!=null&&(Array.isArray(u)?await Promise.all(u.map((l,d)=>md_({absoluteFilepathToConfiguration:r,visitor:t,script:l,nodePath:["js",`${d}`]}))):await md_({absoluteFilepathToConfiguration:r,visitor:t,script:u,nodePath:["js"]}))},landingPage:Qo,layout:Qo,logo:async u=>{e.logo?.dark!=null&&await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:e.logo.dark,visitor:t,nodePath:["logo","dark"]}),e.logo?.light!=null&&await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:e.logo.light,visitor:t,nodePath:["logo","light"]})},metadata:Qo,navbarLinks:Qo,navigation:async u=>{u!=null&&await CZs({absolutePathToFernFolder:a,navigation:u,visitor:t,nodePath:["navigation"],absoluteFilepathToConfiguration:r,fernWorkspaces:n,context:i})},redirects:Qo,tabs:Qo,title:Qo,typography:async u=>{u!=null&&await RHt(u,{bodyFont:async l=>{l!=null&&await BZs({absoluteFilepathToConfiguration:r,visitor:t,font:l,nodePath:["typography","bodyFont"]})},codeFont:async l=>{l!=null&&await BZs({absoluteFilepathToConfiguration:r,visitor:t,font:l,nodePath:["typography","codeFont"]})},headingsFont:async l=>{l!=null&&await BZs({absoluteFilepathToConfiguration:r,visitor:t,font:l,nodePath:["typography","headingsFont"]})}})},versions:async u=>{u!=null&&await Promise.all(u.map(async(l,d)=>{await pV({absoluteFilepathToConfiguration:r,rawUnresolvedFilepath:l.path,visitor:t,nodePath:["versions",`${d}`],willBeUploaded:!1});let s=OO(fp(r),l.path),o=rp.load((await(0,Pd_.readFile)(s)).toString());await Cf(s)&&await t.versionFile?.({path:l.path,content:o},[l.path]);let c=await INo({value:o});c.type==="success"&&await CZs({absolutePathToFernFolder:a,navigation:c.contents.navigation,visitor:t,nodePath:["navigation"],absoluteFilepathToConfiguration:s,fernWorkspaces:n,context:i})}))},roles:Qo})}async function BZs({absoluteFilepathToConfiguration:e,visitor:t,font:r,nodePath:i}){r.path!=null&&await pV({absoluteFilepathToConfiguration:e,rawUnresolvedFilepath:r.path,visitor:t,nodePath:i,willBeUploaded:!0});for(let n of r.paths??[])typeof n=="string"?await pV({absoluteFilepathToConfiguration:e,rawUnresolvedFilepath:n,visitor:t,nodePath:i,willBeUploaded:!0}):await pV({absoluteFilepathToConfiguration:e,rawUnresolvedFilepath:n.path,visitor:t,nodePath:i,willBeUploaded:!0})}async function md_({absoluteFilepathToConfiguration:e,visitor:t,script:r,nodePath:i}){let n=typeof r=="string"?r:"path"in r?r.path:null;n&&await pV({absoluteFilepathToConfiguration:e,rawUnresolvedFilepath:n,visitor:t,nodePath:i,willBeUploaded:!0})}var wd_={name:"accent-color-contrast",create:()=>({file:async({config:e})=>{if(e.colors==null)return[];let t=WYa(e.colors);return t==="dark"?NNo(e.colors,"dark"):t==="light"?NNo(e.colors,"light"):t==="darkAndLight"?[...NNo(e.colors,"dark"),...NNo(e.colors,"light")]:[]}})};function NNo(e,t){let r=Zea(e.accentPrimary??e.accentPrimaryDeprecated,"accent-primary",t),i=Zea(e.background,"background",t)??(t==="dark"?"#000":"#FFF"),n=[];if(!kp(i).isValid())n.push({severity:"fatal",message:`Invalid background color provided for colors.background.${t}: ${i}.`});else{let a=rkD(kp(i),t);kp(i).toHexString()!==a.toHexString()&&n.push({severity:"warning",message:`The provided background color for ${t} mode is not ${t} enough. It will be adjusted to ${a.toHexString()}.`}),i=a.toHexString()}if(r==null)n.push({severity:"warning",message:`No accent-color provided for ${t} mode. A random color will be used.`});else if(!kp(r).isValid())n.push({severity:"fatal",message:`Invalid accent-color provided for colors.accent-primary.${t}: ${r}.`});else{let a=kp.readability(r,i),u=`${a.toFixed(2)}:1`;a<3?n.push({severity:"warning",message:`The contrast ratio between the accent color and the background color for ${t} mode is ${u}. It should be at least 3:1.`}):a<4.5?n.push({severity:"warning",message:`The contrast ratio between the accent color and the background color for ${t} mode is ${u}. Fern will adjust the color to meet the minimum contrast ratio of 4.5:1 for WCAG AA and 7:1 for WCAG AAA.`}):a<7&&n.push({severity:"warning",message:`The contrast ratio between the accent color and the background color for ${t} mode is ${u}. Fern will adjust the color to meet the minimum contrast ratio of 7:1 for WCAG AAA.`})}return n}function rkD(e,t){return t==="dark"&&e.isDark()||t==="light"&&e.isLight()?e:ikD(e)}function ikD(e){if(e==null)return;let{h:t,s:r,v:i}=e.toHsv();return kp({h:t,s:r,v:1-i})}var Sd_={name:"all-roles-must-be-declared",create:e=>{let t=e.workspace.config.roles;return{permissions:r=>{let i=[...r.viewers??[]],n=[];for(let a of i)(t==null||!t.includes(a))&&n.push({severity:"fatal",message:`Role "${a}" is used but not declared at the top level of the docs.yml file.`});return n}}}};var xZs={name:"filepaths-exist",create:()=>({filepath:async({absoluteFilepath:e,value:t})=>await Cf(e)?[]:[{severity:"fatal",message:`Path ${t} does not exist`}]})};var IZs={name:"only-versioned-navigation",create:()=>({file:async({config:e})=>e.navigation!=null&&e.versions!=null?[{severity:"fatal",message:"Cannot contain both navigation and versions. If you want versioned docs, use versions. Otherwise use navigation."}]:[]})};var zZs={name:"playground-environments-exist",create:()=>({apiSection:async({workspace:e,context:t,config:r})=>{let i=(await e.getDefinition({context:t})).rootApiFile.contents.environments,n=new Set(Object.keys(i??{})),a=r.playground?.environments;if(a==null||a.length==null)return[];let u=a.filter(l=>!n.has(l));return u.length===0?[]:u.length===1?[{severity:"fatal",message:`The API does not contain the ${u[0]} environment. ${Dd_(Array.from(n))??""}`}]:[{severity:"fatal",message:`The API does not contain the following environments: ${u.join(", ")}. ${Dd_(Array.from(n))??""}`}]}})};function Dd_(e){if(e.length!==0)return e.length===1&&e[0]!=null?`The only configured environment is ${e[0]}`:`Existing environments include ${e.join(", ")}.`}var RZs={name:"valid-docs-endpoints",create:()=>({file:async({config:e})=>!e.analytics||!Object.keys(e.analytics).length?[]:[[e.analytics.intercom?.apiBase,"Intercom API Base"],[e.analytics.posthog?.endpoint,"Posthog Host Endpoint"]].filter(([i])=>i&&!nkD(i)).map(([i,n])=>({severity:"warning",message:`${n} <${i}> is malformed. Make sure it includes a protocol (e.g. 'https://')!`}))})};function nkD(e){try{return!!new URL(e).protocol}catch{return!1}}var ip_=vi(Fd_(),1);var MkD="End-Of-Stream",tz=class extends Error{constructor(){super(MkD)}};var $No=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,r)=>{this.reject=r,this.resolve=t})}};var AkD=1*1024*1024,Aha=class{constructor(t){if(this.s=t,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>this.reject(new tz)),this.s.once("error",r=>this.reject(r)),this.s.once("close",()=>this.reject(new Error("Stream closed")))}async peek(t,r,i){let n=await this.read(t,r,i);return this.peekQueue.push(t.subarray(r,r+n)),n}async read(t,r,i){if(i===0)return 0;if(this.peekQueue.length===0&&this.endOfStream)throw new tz;let n=i,a=0;for(;this.peekQueue.length>0&&n>0;){let u=this.peekQueue.pop();if(!u)throw new Error("peekData should be defined");let l=Math.min(u.length,n);t.set(u.subarray(0,l),r+a),a+=l,n-=l,l<u.length&&this.peekQueue.push(u.subarray(l))}for(;n>0&&!this.endOfStream;){let u=Math.min(n,AkD),l=await this.readFromStream(t,r+a,u);if(a+=l,l<u)break;n-=l}return a}async readFromStream(t,r,i){let n=this.s.read(i);if(n)return t.set(n,r),n.length;{let a={buffer:t,offset:r,length:i,deferred:new $No};return this.deferred=a.deferred,this.s.once("readable",()=>{this.readDeferred(a)}),a.deferred.promise}}readDeferred(t){let r=this.s.read(t.length);r?(t.buffer.set(r,t.offset),t.deferred.resolve(r.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.endOfStream=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}};var hks=require("buffer"),eSn=class{constructor(t){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=t||{}}async readToken(t,r=this.position){let i=hks.Buffer.alloc(t.len);if(await this.readBuffer(i,{position:r})<t.len)throw new tz;return t.get(i,0)}async peekToken(t,r=this.position){let i=hks.Buffer.alloc(t.len);if(await this.peekBuffer(i,{position:r})<t.len)throw new tz;return t.get(i,0)}async readNumber(t){if(await this.readBuffer(this.numBuffer,{length:t.len})<t.len)throw new tz;return t.get(this.numBuffer,0)}async peekNumber(t){if(await this.peekBuffer(this.numBuffer,{length:t.len})<t.len)throw new tz;return t.get(this.numBuffer,0)}async ignore(t){if(this.fileInfo.size!==void 0){let r=this.fileInfo.size-this.position;if(t>r)return this.position+=r,r}return this.position+=t,t}async close(){}normalizeOptions(t,r){if(r&&r.position!==void 0&&r.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return r?{mayBeLess:r.mayBeLess===!0,offset:r.offset?r.offset:0,length:r.length?r.length:t.length-(r.offset?r.offset:0),position:r.position?r.position:this.position}:{mayBeLess:!1,offset:0,length:t.length,position:this.position}}};var qkD=256e3,GNo=class extends eSn{constructor(t,r){super(r),this.streamReader=new Aha(t)}async getFileInfo(){return this.fileInfo}async readBuffer(t,r){let i=this.normalizeOptions(t,r),n=i.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(t,r);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(i.length===0)return 0;let a=await this.streamReader.read(t,i.offset,i.length);if(this.position+=a,(!r||!r.mayBeLess)&&a<i.length)throw new tz;return a}async peekBuffer(t,r){let i=this.normalizeOptions(t,r),n=0;if(i.position){let a=i.position-this.position;if(a>0){let u=new Uint8Array(i.length+a);return n=await this.peekBuffer(u,{mayBeLess:i.mayBeLess}),t.set(u.subarray(a),i.offset),n-a}else if(a<0)throw new Error("Cannot peek from a negative offset in a stream")}if(i.length>0){try{n=await this.streamReader.peek(t,i.offset,i.length)}catch(a){if(r&&r.mayBeLess&&a instanceof tz)return 0;throw a}if(!i.mayBeLess&&n<i.length)throw new tz}return n}async ignore(t){let r=Math.min(qkD,t),i=new Uint8Array(r),n=0;for(;n<t;){let a=t-n,u=await this.readBuffer(i,{length:Math.min(r,a)});if(u<0)return u;n+=u}return n}};var QNo=class extends eSn{constructor(t,r){super(r),this.uint8Array=t,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:t.length}async readBuffer(t,r){if(r&&r.position){if(r.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=r.position}let i=await this.peekBuffer(t,r);return this.position+=i,i}async peekBuffer(t,r){let i=this.normalizeOptions(t,r),n=Math.min(this.uint8Array.length-i.position,i.length);if(!i.mayBeLess&&n<i.length)throw new tz;return t.set(this.uint8Array.subarray(i.position,i.position+n),i.offset),n}async close(){}};function Ld_(e,t){return t=t||{},new GNo(e,t)}function Ud_(e,t){return new QNo(e,t)}var XQr=require("buffer");var Wd_=vi(Vd_(),1),Hd_=require("buffer");function gie(e){return new DataView(e.buffer,e.byteOffset)}var $d_={len:1,get(e,t){return gie(e).getUint8(t)},put(e,t,r){return gie(e).setUint8(t,r),t+1}},JNo={len:2,get(e,t){return gie(e).getUint16(t,!0)},put(e,t,r){return gie(e).setUint16(t,r,!0),t+2}},KNo={len:2,get(e,t){return gie(e).getUint16(t)},put(e,t,r){return gie(e).setUint16(t,r),t+2}};var Gd_={len:4,get(e,t){return gie(e).getUint32(t,!0)},put(e,t,r){return gie(e).setUint32(t,r,!0),t+4}},Qd_={len:4,get(e,t){return gie(e).getUint32(t)},put(e,t,r){return gie(e).setUint32(t,r),t+4}};var Jd_={len:4,get(e,t){return gie(e).getInt32(t)},put(e,t,r){return gie(e).setInt32(t,r),t+4}};var Kd_={len:8,get(e,t){return gie(e).getBigUint64(t,!0)},put(e,t,r){return gie(e).setBigUint64(t,r,!0),t+8}};var YQr=class{constructor(t,r){this.len=t,this.encoding=r}get(t,r){return Hd_.Buffer.from(t).toString(this.encoding,r,r+this.len)}},vks=class e{constructor(t){this.len=t}static decode(t,r,i){let n="";for(let a=r;a<i;++a)n+=e.codePointToString(e.singleByteDecoder(t[a]));return n}static inRange(t,r,i){return r<=t&&t<=i}static codePointToString(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}static singleByteDecoder(t){if(e.inRange(t,0,127))return t;let r=e.windows1252[t-128];if(r===null)throw Error("invaliding encoding");return r}get(t,r=0){return e.decode(t,r,r+this.len)}};vks.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255];function Yd_(e){return[...e].map(t=>t.charCodeAt(0))}function Xd_(e,t=0){let r=Number.parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let i=8*32;for(let n=t;n<t+148;n++)i+=e[n];for(let n=t+156;n<t+512;n++)i+=e[n];return r===i}var Zd_={get:(e,t)=>e[t+3]&127|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4};var kd_=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx"],ep_=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx"];var tp_=4100;async function rp_(e){return new bks().fromBuffer(e)}function OXt(e,t,r){r={offset:0,...r};for(let[i,n]of t.entries())if(r.mask){if(n!==(r.mask[i]&e[i+r.offset]))return!1}else if(n!==e[i+r.offset])return!1;return!0}var bks=class{constructor(t){this.detectors=t?.customDetectors,this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(t){let r=t.position;for(let i of this.detectors||[]){let n=await i(t);if(n)return n;if(r!==t.position)return}return this.parse(t)}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof t}\``);let r=t instanceof Uint8Array?t:new Uint8Array(t);if(r?.length>1)return this.fromTokenizer(Ud_(r))}async fromBlob(t){let r=await t.arrayBuffer();return this.fromBuffer(new Uint8Array(r))}async fromStream(t){let r=await Ld_(t);try{return await this.fromTokenizer(r)}finally{await r.close()}}async toDetectionStream(t,r={}){let{default:i}=await import("stream"),{sampleSize:n=tp_}=r;return new Promise((a,u)=>{t.on("error",u),t.once("readable",()=>{(async()=>{try{let l=new i.PassThrough,d=i.pipeline?i.pipeline(t,l,()=>{}):t.pipe(l),s=t.read(n)??t.read()??XQr.Buffer.alloc(0);try{l.fileType=await this.fromBuffer(s)}catch(o){o instanceof tz?l.fileType=void 0:u(o)}a(d)}catch(l){u(l)}})()})})}check(t,r){return OXt(this.buffer,t,r)}checkString(t,r){return this.check(Yd_(t),r)}async parse(t){if(this.buffer=XQr.Buffer.alloc(tp_),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,await t.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(t);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await t.ignore(6);let r=await t.readToken(Zd_);return t.position+r>t.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await t.ignore(r),this.fromTokenizer(t))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;t.position+30<t.fileInfo.size;){await t.readBuffer(this.buffer,{length:30});let r={compressedSize:this.buffer.readUInt32LE(18),uncompressedSize:this.buffer.readUInt32LE(22),filenameLength:this.buffer.readUInt16LE(26),extraFieldLength:this.buffer.readUInt16LE(28)};if(r.filename=await t.readToken(new YQr(r.filenameLength,"utf-8")),await t.ignore(r.extraFieldLength),r.filename==="META-INF/mozilla.rsa")return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml"))switch(r.filename.split("/")[0]){case"_rels":break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};default:break}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if(r.filename==="mimetype"&&r.compressedSize===r.uncompressedSize){let i=await t.readToken(new YQr(r.compressedSize,"utf-8"));switch(i=i.trim(),i){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};default:}}if(r.compressedSize===0){let i=-1;for(;i<0&&t.position<t.fileInfo.size;)await t.peekBuffer(this.buffer,{mayBeLess:!0}),i=this.buffer.indexOf("504B0304",0,"hex"),await t.ignore(i>=0?i:this.buffer.length)}else await t.ignore(r.compressedSize)}}catch(r){if(!(r instanceof tz))throw r}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let r=XQr.Buffer.alloc(8);return await t.readBuffer(r),OXt(r,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:OXt(r,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:OXt(r,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:OXt(r,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:OXt(r,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:OXt(r,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&this.buffer[8]&96){let r=this.buffer.toString("binary",8,12).replace("\0"," ").trim();switch(r){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return r.startsWith("3g")?r.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await t.ignore(1350);let r=10*1024*1024,i=XQr.Buffer.alloc(Math.min(r,t.fileInfo.size));if(await t.readBuffer(i,{mayBeLess:!0}),i.includes(XQr.Buffer.from("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(r){if(!(r instanceof tz))throw r}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let r=await this.readTiffHeader(!1);if(r)return r}if(this.check([77,77])){let r=await this.readTiffHeader(!0);if(r)return r}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function r(){let l=await t.peekNumber($d_),d=128,s=0;for(;!(l&d)&&d!==0;)++s,d>>=1;let o=XQr.Buffer.alloc(s+1);return await t.readBuffer(o),o}async function i(){let l=await r(),d=await r();d[0]^=128>>d.length-1;let s=Math.min(6,d.length);return{id:l.readUIntBE(0,l.length),len:d.readUIntBE(d.length-s,s)}}async function n(l){for(;l>0;){let d=await i();if(d.id===17026)return(await t.readToken(new YQr(d.len,"utf-8"))).replaceAll(/\00.*$/g,"");await t.ignore(d.len),--l}}let a=await i();switch(await n(a.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let r=this.buffer.toString("binary",2,6);if(r.match("^d*")&&r>=1e3&&r<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await t.ignore(8),await t.readToken(new YQr(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("**ACE",{offset:7})&&(await t.peekBuffer(this.buffer,{length:14,mayBeLess:!0}),this.checkString("**",{offset:12})))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.check([137,80,78,71,13,10,26,10])){await t.ignore(8);async function r(){return{length:await t.readToken(Jd_),type:await t.readToken(new YQr(4,"binary"))}}do{let i=await r();if(i.length<0)return;switch(i.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await t.ignore(i.length+4)}}while(t.position+8<t.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function r(){let i=XQr.Buffer.alloc(16);return await t.readBuffer(i),{id:i,size:Number(await t.readToken(Kd_))}}for(await t.ignore(30);t.position+24<t.fileInfo.size;){let i=await r(),n=i.size-24;if(OXt(i.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let a=XQr.Buffer.alloc(16);if(n-=await t.readBuffer(a),OXt(a,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(OXt(a,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await t.ignore(n)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await t.ignore(20),await t.readToken(new YQr(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await t.peekBuffer(this.buffer,{length:Math.min(256,t.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let r=this.buffer.readUInt32LE(12);if(r>12&&this.buffer.length>=r+16)try{let i=this.buffer.slice(16,r+16).toString();if(JSON.parse(i).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0}),Xd_(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(t){let r=await this.tokenizer.readToken(t?KNo:JNo);switch(this.tokenizer.ignore(10),r){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let r=await this.tokenizer.readToken(t?KNo:JNo);for(let i=0;i<r;++i){let n=await this.readTiffTag(t);if(n)return n}}async readTiffHeader(t){let r=(t?KNo:JNo).get(this.buffer,2),i=(t?Qd_:Gd_).get(this.buffer,4);if(r===42){if(i>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(i>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}return await this.tokenizer.ignore(i),await this.readTiffIFD(t)??{ext:"tif",mime:"image/tiff"}}if(r===43)return{ext:"tif",mime:"image/tiff"}}};var s94=new Set(kd_),c94=new Set(ep_);var np_=require("fs/promises"),ap_=vi(require("path"),1);var BkD=new Set(["image/jpeg","image/png","image/gif","image/webp","image/tiff","image/x-icon","video/quicktime","video/mp4","video/webm","audio/mpeg","audio/ogg","audio/wav","application/pdf","application/xml","font/woff","font/woff2","font/otf","font/ttf"]),xkD=new Set(["ASCII","UTF-8","UTF-16","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","WINDOWS-1250","WINDOWS-1251","WINDOWS-1252","WINDOWS-1253","WINDOWS-1254","WINDOWS-1255","WINDOWS-1256","WINDOWS-1257","WINDOWS-1258","SHIFT_JIS","SHIFT-JIS","EUC-JP","ISO-2022-JP","BIG5","GB2312","GB18030","KOI8-R"]),gks={name:"valid-file-types",create:()=>({filepath:async({absoluteFilepath:e,willBeUploaded:t})=>t?await Cf(e)?IkD(e):[]:[]})},IkD=async e=>{let t=new Uint8Array(await(0,np_.readFile)(e)),r=await rp_(t);if(r!=null)return BkD.has(r.mime)?[]:[{severity:"fatal",message:`The file type of ${r.mime} is not allowed: ${e}`}];let i=ap_.default.extname(e).toLowerCase();i.startsWith(".")&&(i=i.substring(1));let n=ip_.default.detect(t);return n==null?[{severity:"fatal",message:`The encoding of the file could not be detected: ${e}`}]:xkD.has(n.toUpperCase())?[]:[{severity:"fatal",message:`The encoding of ${n} is not allowed: ${e}`}]};var op_=require("fs/promises"),up_=vi(u8t(),1),Oks={name:"valid-frontmatter",create:()=>({filepath:async({absoluteFilepath:e})=>{if(!e.endsWith(".md")&&!e.endsWith(".mdx"))return[];try{let t=await(0,op_.readFile)(e,"utf-8");return(0,up_.default)(t),[]}catch(t){return[{severity:"fatal",message:`Failed to parse frontmatter${t instanceof Error?`: ${t.message}`:""}`}]}}})};var Op_=require("crypto"),Eks=vi(require("path"),1);var sp_=require("fs"),YNo=class{parse({absoluteFilePath:t}){let r=(0,sp_.readFileSync)(t,"utf-8"),i=r.match(/option\s+csharp_namespace\s*=\s*"([^"]+)";/),n=r.match(/package\s+([a-zA-Z_][\w.]*);/),a=r.match(/service\s+([a-zA-Z_]\w*)\s*{/);return{csharpNamespace:i?.[1],packageName:n?.[1],serviceName:a?.[1]}}};var XNo=class{context;workspace;sourceCache;constructor(t,r){this.context=t,this.workspace=r,this.sourceCache=new Map}resolveSourceOrThrow({source:t,relativeFilepath:r}){let i=this.resolveSource({source:t});if(i==null){if(UGt(t))throw new Error(`Cannot resolve source ${t.proto} from file ${r}`);this.context.logger.warn(`Cannot resolve source ${t.openapi} from file ${r}`)}return i}resolveSource({source:t}){return UGt(t)?this.resolveProtobufSource({source:t}):this.resolveOpenAPISource({source:t})}resolveProtobufSource({source:t}){let r=Xu(this.workspace.absoluteFilePath,Xa.of(t.proto));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!wHr(r))return;let n=new YNo().parse({absoluteFilePath:r}),a={type:"protobuf",absoluteFilePath:r,relativeFilePath:Xa.of(t.proto),csharpNamespace:n.csharpNamespace,packageName:n.packageName,serviceName:n.serviceName};return this.sourceCache.set(r,a),a}resolveOpenAPISource({source:t}){let r=Xu(this.workspace.absoluteFilePath,Xa.of(t.openapi));if(this.sourceCache.has(r))return this.sourceCache.get(r);if(!wHr(r))return;let i={type:"openapi",absoluteFilePath:r,relativeFilePath:Xa.of(t.openapi)};return this.sourceCache.set(r,i),i}};function zkD(e){for(var t=[],r=0;r<e.length;){var i=e[r];if(i==="*"||i==="+"||i==="?"){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if(i==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if(i==="{"){t.push({type:"OPEN",index:r,value:e[r++]});continue}if(i==="}"){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(i===":"){for(var n="",a=r+1;a<e.length;){var u=e.charCodeAt(a);if(u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95){n+=e[a++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:n}),r=a;continue}if(i==="("){var l=1,d="",a=r+1;if(e[a]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;){if(e[a]==="\\"){d+=e[a++]+e[a++];continue}if(e[a]===")"){if(l--,l===0){a++;break}}else if(e[a]==="("&&(l++,e[a+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(a));d+=e[a++]}if(l)throw new TypeError("Unbalanced pattern at ".concat(r));if(!d)throw new TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:d}),r=a;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}function cp_(e,t){t===void 0&&(t={});for(var r=zkD(e),i=t.prefixes,n=i===void 0?"./":i,a=t.delimiter,u=a===void 0?"/#?":a,l=[],d=0,s=0,o="",c=function(U){if(s<r.length&&r[s].type===U)return r[s++].value},b=function(U){var H=c(U);if(H!==void 0)return H;var k=r[s],K=k.type,te=k.index;throw new TypeError("Unexpected ".concat(K," at ").concat(te,", expected ").concat(U))},g=function(){for(var U="",H;H=c("CHAR")||c("ESCAPED_CHAR");)U+=H;return U},O=function(U){for(var H=0,k=u;H<k.length;H++){var K=k[H];if(U.indexOf(K)>-1)return!0}return!1},m=function(U){var H=l[l.length-1],k=U||(H&&typeof H=="string"?H:"");if(H&&!k)throw new TypeError('Must have text between two parameters, missing text after "'.concat(H.name,'"'));return!k||O(k)?"[^".concat(sdi(u),"]+?"):"(?:(?!".concat(sdi(k),")[^").concat(sdi(u),"])+?")};s<r.length;){var w=c("CHAR"),E=c("NAME"),A=c("PATTERN");if(E||A){var q=w||"";n.indexOf(q)===-1&&(o+=q,q=""),o&&(l.push(o),o=""),l.push({name:E||d++,prefix:q,suffix:"",pattern:A||m(q),modifier:c("MODIFIER")||""});continue}var D=w||c("ESCAPED_CHAR");if(D){o+=D;continue}o&&(l.push(o),o="");var C=c("OPEN");if(C){var q=g(),R=c("NAME")||"",$=c("PATTERN")||"",I=g();b("CLOSE"),l.push({name:R||($?d++:""),pattern:R&&!$?m(q):$,prefix:q,suffix:I,modifier:c("MODIFIER")||""});continue}b("END")}return l}function lp_(e,t){return RkD(cp_(e,t),t)}function RkD(e,t){t===void 0&&(t={});var r=mks(t),i=t.encode,n=i===void 0?function(d){return d}:i,a=t.validate,u=a===void 0?!0:a,l=e.map(function(d){if(typeof d=="object")return new RegExp("^(?:".concat(d.pattern,")$"),r)});return function(d){for(var s="",o=0;o<e.length;o++){var c=e[o];if(typeof c=="string"){s+=c;continue}var b=d?d[c.name]:void 0,g=c.modifier==="?"||c.modifier==="*",O=c.modifier==="*"||c.modifier==="+";if(Array.isArray(b)){if(!O)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(b.length===0){if(g)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<b.length;m++){var w=n(b[m],c);if(u&&!l[o].test(w))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(w,'"'));s+=c.prefix+w+c.suffix}continue}if(typeof b=="string"||typeof b=="number"){var w=n(String(b),c);if(u&&!l[o].test(w))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(w,'"'));s+=c.prefix+w+c.suffix;continue}if(!g){var E=O?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(E))}}return s}}function fp_(e,t){var r=[],i=dp_(e,r,t);return NkD(i,r,t)}function NkD(e,t,r){r===void 0&&(r={});var i=r.decode,n=i===void 0?function(a){return a}:i;return function(a){var u=e.exec(a);if(!u)return!1;for(var l=u[0],d=u.index,s=Object.create(null),o=function(b){if(u[b]===void 0)return"continue";var g=t[b-1];g.modifier==="*"||g.modifier==="+"?s[g.name]=u[b].split(g.prefix+g.suffix).map(function(O){return n(O,g)}):s[g.name]=n(u[b],g)},c=1;c<u.length;c++)o(c);return{path:l,index:d,params:s}}}function sdi(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function mks(e){return e&&e.sensitive?"":"i"}function FkD(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,i=0,n=r.exec(e.source);n;)t.push({name:n[1]||i++,prefix:"",suffix:"",modifier:"",pattern:""}),n=r.exec(e.source);return e}function LkD(e,t,r){var i=e.map(function(n){return dp_(n,t,r).source});return new RegExp("(?:".concat(i.join("|"),")"),mks(r))}function UkD(e,t,r){return VkD(cp_(e,r),t,r)}function VkD(e,t,r){r===void 0&&(r={});for(var i=r.strict,n=i===void 0?!1:i,a=r.start,u=a===void 0?!0:a,l=r.end,d=l===void 0?!0:l,s=r.encode,o=s===void 0?function(H){return H}:s,c=r.delimiter,b=c===void 0?"/#?":c,g=r.endsWith,O=g===void 0?"":g,m="[".concat(sdi(O),"]|$"),w="[".concat(sdi(b),"]"),E=u?"^":"",A=0,q=e;A<q.length;A++){var D=q[A];if(typeof D=="string")E+=sdi(o(D));else{var C=sdi(o(D.prefix)),R=sdi(o(D.suffix));if(D.pattern)if(t&&t.push(D),C||R)if(D.modifier==="+"||D.modifier==="*"){var $=D.modifier==="*"?"?":"";E+="(?:".concat(C,"((?:").concat(D.pattern,")(?:").concat(R).concat(C,"(?:").concat(D.pattern,"))*)").concat(R,")").concat($)}else E+="(?:".concat(C,"(").concat(D.pattern,")").concat(R,")").concat(D.modifier);else{if(D.modifier==="+"||D.modifier==="*")throw new TypeError('Can not repeat "'.concat(D.name,'" without a prefix and suffix'));E+="(".concat(D.pattern,")").concat(D.modifier)}else E+="(?:".concat(C).concat(R,")").concat(D.modifier)}}if(d)n||(E+="".concat(w,"?")),E+=r.endsWith?"(?=".concat(m,")"):"$";else{var I=e[e.length-1],U=typeof I=="string"?w.indexOf(I[I.length-1])>-1:I===void 0;n||(E+="(?:".concat(w,"(?=").concat(m,"))?")),U||(E+="(?=".concat(w,"|").concat(m,")"))}return new RegExp(E,mks(r))}function dp_(e,t,r){return e instanceof RegExp?FkD(e,t):Array.isArray(e)?LkD(e,t,r):UkD(e,t,r)}function pp_(e){return e.split(/[?#]/)[0]??""}function ZNo(e){return e.startsWith("/")?e.slice(1):e}function Pks(e){return e.startsWith("/")?e:`/${e}`}function kNo(e){return e.endsWith("/")?e.slice(0,-1):e}function _p_(e){let t=[];return e.config.instances.forEach(r=>{t.push(r.url),typeof r.customDomain=="string"?t.push(r.customDomain):Array.isArray(r.customDomain)&&t.push(...r.customDomain)}),t}function hp_(e){let t=new URL(DSe(e));return{domain:t.host,basePath:t.pathname==="/"||t.pathname===""?void 0:t.pathname}}function WkD(e,t){if(e===t)return{params:{},path:t,index:0};try{return fp_(e)(t)}catch(r){return console.error(r,{pattern:e,path:t}),!1}}function HkD(e,t){try{return lp_(e)(t.params)}catch(r){return console.error(r,{match:t,destination:e}),e}}function yp_(e,t,r=[]){for(let i of r){let n=kNo($kD(i.source,t.basePath)),a=WkD(n,e);if(a){let u=HkD(i.destination,a);if(!u.startsWith("/"))try{new URL(u)}catch{console.error("Invalid redirect destination:",u);return}return{redirect:{destination:encodeURI(u),permanent:i.permanent??!1}}}}}function $kD(e,t){return t==null||e.startsWith(t)?e:Cv(t,e)}async function wks({pathname:e,markdown:t,absoluteFilepath:r,workspaceAbsoluteFilePath:i,pageSlugs:n,absoluteFilePathsToSlugs:a,redirects:u=[],baseUrl:l}){e=kNo(e);let d=r!=null?a.get(r)??[]:[];if(e.trim()==="")return!0;if(e.startsWith("/")){let o=vp_(jks(e,l,u));for(let b=0;b<5;++b){let g=vp_(jks(o,l,u));if(o===g)break;o=g}if(t&&n.has(ZNo(o)))return!0;let c=Xu(i,Xa.of(ZNo(e)));return await Cf(c,"file")?!0:d.map(b=>Pks(b))}if(r!=null){if(e==="."){let c=fp(r);if(await Cf(c,"directory"))return!0}let o=Xu(fp(r),Xa.of(e));if(await Cf(o,"file"))return!0}if(!t)return d.map(o=>Pks(o));let s=[];for(let o of d){let c=new URL(`/${o}`,DSe(l.domain)),b=jks(new URL(e,c).pathname,l,u);n.has(ZNo(b))||s.push(o)}return s.length>0?s:!0}function jks(e,t,r){let i=yp_(e,t,r);return i==null?e:i.redirect.destination}function vp_(e){let t=e.indexOf("#");return t===-1?e:e.substring(0,t)}var bp_=/^(?:[a-z+]+:)/gi;function GkD(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);return r?(r[0].match(/\n/g)||[]).length+1:0}function Sks(e,t){return e&&{...e,start:{...e.start,line:e.start.line+t},end:{...e.end,line:e.end.line+t}}}function Dks(e,{absoluteFilepath:t,instanceUrls:r}){let i=[],n=[],a=GkD(e),{links:u,sources:l}=bd_({content:e,absoluteFilepath:t});return u.forEach(d=>{if(d.href.trimStart().match(bp_)){if(!d.href.trimStart().startsWith("http"))return;try{let o=new URL(d.href);if(!r.some(c=>d.href.includes(c)))return;n.push({pathname:o.pathname,sourceFilepath:d.sourceFilepath,position:Sks(d.position,a),markdown:!0})}catch{i.push({severity:"warning",message:`Invalid URL: ${d.href}`})}return}let s=pp_(d.href);s.trim()!==""&&n.push({pathname:s,sourceFilepath:d.sourceFilepath,position:Sks(d.position,a),markdown:!0})}),l.forEach(d=>{if(d.src.match(bp_))try{new URL(d.src)}catch{i.push({severity:"warning",message:`Invalid URL: ${d.src}`});return}else n.push({pathname:d.src,sourceFilepath:d.sourceFilepath,position:Sks(d.position,a),markdown:!1})}),{pathnamesToCheck:n,violations:i}}var eFo=Ffs({logger:CHr(Qo)}),aRi={name:"valid-markdown-links",create:async({workspace:e,fernWorkspaces:t,ossWorkspaces:r})=>{let i=_p_(e),n=i[0]??"http://localhost",a=hp_(i[0]??"http://localhost"),l=await new O5t(n,e,r,t,eFo).resolve();if(!l.config.root)throw new Error("Root node not found");let d=zo.migrate.FernNavigationV1ToLatest.create().root(l.config.root),s=zo.NodeCollector.collect(d),o=new Set,c=new Map,b=[];return s.slugMap.forEach((g,O)=>{if(o.add(O),g==null||!zo.isPage(g))return;zo.isApiLeaf(g)&&b.push(g);let m=zo.getPageId(g);if(m==null)return;let w=Xu(e.absoluteFilePath,Xa.of(m)),E=c.get(w)??[];E.push(O),c.set(w,E)}),{markdownPage:async({content:g,absoluteFilepath:O})=>{let m=c.get(O);if(!m||m.length===0)return[];let{pathnamesToCheck:w,violations:E}=Dks(g,{absoluteFilepath:O,instanceUrls:i}),A=await Promise.all(w.map(async q=>{let D=await wks({pathname:q.pathname,markdown:q.markdown,absoluteFilepath:O,workspaceAbsoluteFilePath:e.absoluteFilePath,pageSlugs:o,absoluteFilePathsToSlugs:c,redirects:e.config.redirects,baseUrl:a});return D===!0?[]:D.map(C=>{let[R,$]=gp_({pathnameToCheck:q,targetPathname:C,absoluteFilepathToWorkspace:e.absoluteFilePath});return{name:aRi.name,severity:"error",message:R,relativeFilepath:$}})}));return[...E,...A.flat()]},apiSection:async({workspace:g,config:O})=>{let m=await g.toFernWorkspace({context:eFo},{enableUniqueErrorsPerEndpoint:!0,detectGlobalHeaders:!1}),w=_2({workspace:m,audiences:O.audiences?{type:"select",audiences:O.audiences}:{type:"all"},generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!1},readme:void 0,version:void 0,packageName:void 0,context:eFo,sourceResolver:new XNo(eFo,m)}),E=QkD($_a(w,(0,Op_.randomUUID)())),A=[];for(let q of b){let D=await JkD(Ufi.prune(E,q));for(let C of D){let{pathnamesToCheck:R,violations:$}=Dks(C,{instanceUrls:i});A.push(...$);let I=await Promise.all(R.map(async U=>{let H=await wks({pathname:U.pathname,markdown:U.markdown,workspaceAbsoluteFilePath:e.absoluteFilePath,pageSlugs:o,absoluteFilePathsToSlugs:c,redirects:e.config.redirects,baseUrl:a});return H===!0?[]:H.map(k=>{let[K,te]=gp_({pathnameToCheck:U,targetPathname:k,absoluteFilepathToWorkspace:e.absoluteFilePath});return{name:aRi.name,severity:"error",message:K,relFilepath:te}})}));A.push(...I.flat())}}return A}}}};function gp_({pathnameToCheck:e,targetPathname:t,absoluteFilepathToWorkspace:r}){let i=`${t} links to non-existent page ${Qs.bold(e.pathname)}`,{position:n,sourceFilepath:a}=e;if(a==null||n==null)return[i,Xa.of("")];i=`broken link to ${Qs.bold(e.pathname)}`,e.pathname.length>0&&!Eks.default.isAbsolute(e.pathname)&&(i+=` (resolved path: ${Eks.default.join(t,e.pathname)})`);let u=Qq(r,a);return i+=`
|
|
1995
|
-
fix here: ${u}:${n.start.line}:${n.start.column}`,[i,u]}function QkD(e){return Ufi.ApiDefinitionV1ToLatest.from(e,{useJavaScriptAsTypeScript:!1,alwaysEnableJavaScriptFetch:!1,usesApplicationJsonInFormDataValue:!1}).migrate()}async function JkD(e){let t=[];return Ufi.Transformer.descriptions(r=>(typeof r=="string"&&t.push(r),r)).apiDefinition(e),t}var Mks={name:"validate-version-file",create:()=>({versionFile:async({path:e,content:t})=>{let r=await INo({value:t});return r.type==="success"?[]:[{severity:"fatal",message:`${r.message}`}]}})};var mp_=[xZs,IZs,Mks,wd_,aRi,gks,zZs,RZs,Sd_,Oks];function Pp_(e){if(!e)return mp_;let t=new Set(e);return mp_.filter(r=>!t.has(r.name))}async function qha(e,t,r,i,n,a){let u=n?[aRi]:Pp_(a);return KkD({workspace:e,rules:u,context:t,fernWorkspaces:r,ossWorkspaces:i})}async function KkD({workspace:e,rules:t,context:r,fernWorkspaces:i,ossWorkspaces:n}){let a=[],u=await Promise.all(t.map(d=>d.create({workspace:e,fernWorkspaces:i,ossWorkspaces:n,logger:r.logger}))),l=gd_({relativeFilepath:Xa.of(G2t),allRuleVisitors:u,addViolations:d=>{a.push(...d)}});return await jd_({contents:e.config,visitor:l,absoluteFilepathToConfiguration:Xu(e.absoluteFilePath,Xa.of(G2t)),absolutePathToFernFolder:e.absoluteFilePath,context:r,fernWorkspaces:i}),a}async function Aks({workspace:e,fernWorkspaces:t,ossWorkspaces:r,context:i,logWarnings:n,errorOnBrokenLinks:a,logSummary:u=!0,excludeRules:l}){let d=performance.now(),s=await qha(e,i,t,r,!1,l),o=performance.now()-d,{hasErrors:c}=Z1n({violations:s,context:i,logWarnings:n,logSummary:u,logBreadcrumbs:!1,elapsedMillis:o});return a&&(c=c||s.some(b=>b.name==="valid-markdown-links")),{hasErrors:c}}async function tFo({workspace:e,fernWorkspaces:t,ossWorkspaces:r,context:i,logWarnings:n,errorOnBrokenLinks:a,excludeRules:u}){let{hasErrors:l}=await Aks({workspace:e,context:i,logWarnings:n,fernWorkspaces:t,ossWorkspaces:r,errorOnBrokenLinks:a,excludeRules:u});l&&i.failAndThrow()}async function jp_({loadProject:e,cliContext:t,port:r,bundlePath:i,brokenLinks:n}){let a=await e(),u=a.docsWorkspaces;u!=null&&(await t.instrumentPostHogEvent({orgId:a.config.organization,command:"fern docs dev"}),await t.runTaskForWorkspace(u,async l=>{l.logger.info(`Starting server on port ${r}`),await _Xs({initialProject:a,reloadProject:e,validateProject:async d=>{let s=d.docsWorkspaces;if(s==null)return;let o=await Promise.all(d.apiWorkspaces.map(async b=>b.toFernWorkspace({context:l}))),c=n?[]:["valid-markdown-links"];await Aks({workspace:s,context:l,logWarnings:!0,logSummary:!1,fernWorkspaces:o,ossWorkspaces:await vie(d),excludeRules:c});for(let b of o)await t.runTaskForWorkspace(b,async g=>{await EZs({workspace:b,context:g,logWarnings:!1,logSummary:!1})})},context:l,port:r,bundlePath:i})}))}async function wp_({project:e,cliContext:t,shouldFix:r}){await Promise.all(e.apiWorkspaces.map(async i=>{i instanceof y7||await t.runTaskForWorkspace(i,async n=>{await JAs({workspace:await i.toFernWorkspace({context:n}),context:n,shouldFix:r})})}))}var Sp_=vi(require("path"),1);async function tSn({workspace:e,context:t,generationLanguage:r,keywords:i,smartCasing:n,disableExamples:a,audiences:u,readme:l,includeDynamicExamples:d}){return await vXt({workspace:e,context:t,logWarnings:!1}),_2({workspace:e,generationLanguage:r,keywords:i,smartCasing:n,exampleGeneration:{disabled:a},audiences:u,readme:l,version:void 0,packageName:void 0,context:t,sourceResolver:new d2(t,e),includeDynamicExamples:d})}async function Dp_({project:e,irFilepath:t,cliContext:r,generationLanguage:i,audiences:n,version:a,keywords:u,smartCasing:l,includeDynamicExamples:d}){await Promise.all(e.apiWorkspaces.map(async s=>{await r.runTaskForWorkspace(s,async o=>{r.logger.info(`Generating IR for workspace ${s.workspaceName??"api"}`);let c=await s.toFernWorkspace({context:o}),b=await tSn({workspace:c,context:o,generationLanguage:i,keywords:u,smartCasing:l,disableExamples:!1,audiences:n,readme:void 0,includeDynamicExamples:d});if(b.dynamic==null)throw new Error("Internal error; dynamic IR was not generated");let g=Sp_.default.resolve(t);await EHr(Wl.of(g),b.dynamic),o.logger.info(`Wrote IR to ${g}`)})}))}var Ep_=require("fs/promises"),Mp_=vi(require("path"),1);async function Ap_({project:e,outputFilepath:t,cliContext:r,audiences:i}){await Promise.all(e.apiWorkspaces.map(async n=>{await r.runTaskForWorkspace(n,async a=>{let u=await n.toFernWorkspace({context:a}),l=await tSn({workspace:u,context:a,generationLanguage:void 0,audiences:i,keywords:void 0,smartCasing:!1,disableExamples:!1,readme:void 0,includeDynamicExamples:!1}),d=SSe({ir:l,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0}}),s=Mp_.default.resolve(t);await(0,Ep_.writeFile)(s,await qHr(d,{pretty:!0})),a.logger.info(`Wrote FDR API definition to ${s}`)})}))}var FhP=vi(require("path"),1);var $e=Symbol(),ii=Symbol();var qp_={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.246",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var he={};Io(he,{V1:()=>acB,V10:()=>ocB,V11:()=>ucB,V12:()=>scB,V13:()=>ccB,V14:()=>lcB,V15:()=>fcB,V16:()=>dcB,V17:()=>pcB,V18:()=>_cB,V19:()=>hcB,V2:()=>ycB,V20:()=>vcB,V21:()=>bcB,V22:()=>gcB,V23:()=>W$0.FernIrV23,V24:()=>H$0.FernIrV24,V25:()=>$$0.FernIrV25,V26:()=>G$0.FernIrV26,V27:()=>Q$0.FernIrV27,V28:()=>J$0.FernIrV28,V29:()=>K$0.FernIrV29,V3:()=>OcB,V30:()=>Y$0.FernIrV30,V31:()=>X$0.FernIrV31,V32:()=>Z$0.FernIrV32,V33:()=>k$0.FernIrV33,V34:()=>eG0.FernIrV34,V35:()=>tG0.FernIrV35,V36:()=>rG0.FernIrV36,V37:()=>iG0.FernIrV37,V38:()=>nG0.FernIrV38,V39:()=>aG0.FernIrV39,V4:()=>mcB,V40:()=>oG0.FernIrV40,V41:()=>uG0.FernIrV41,V42:()=>sG0.FernIrV42,V43:()=>cG0.FernIrV43,V44:()=>lG0.FernIrV44,V45:()=>fG0.FernIrV45,V46:()=>dG0.FernIrV46,V47:()=>pG0.FernIrV47,V48:()=>_G0.FernIrV48,V49:()=>hG0.FernIrV49,V5:()=>PcB,V50:()=>yG0.FernIrV50,V51:()=>vG0.FernIrV51,V52:()=>bG0.FernIrV52,V53:()=>gG0.FernIrV53,V54:()=>OG0.FernIrV54,V55:()=>mG0.FernIrV55,V56:()=>Tc,V6:()=>jcB,V7:()=>wcB,V8:()=>ScB,V9:()=>DcB});var acB=vi(S0_(),1),ocB=vi(Gw_(),1),ucB=vi(yq_(),1),scB=vi(pR_(),1),ccB=vi(l4_(),1),lcB=vi(uW_(),1),fcB=vi(nY_(),1),dcB=vi(yih(),1),pcB=vi(Mlh(),1),_cB=vi(Lvh(),1),hcB=vi(twh(),1),ycB=vi(YMh(),1),vcB=vi(Dzh(),1),bcB=vi(a4h(),1),gcB=vi(NWh(),1),W$0=vi(iJh(),1),H$0=vi(LZh(),1),$$0=vi(Miy(),1),G$0=vi(gsy(),1),Q$0=vi(_py(),1),J$0=vi(lby(),1),K$0=vi(oPy(),1),OcB=vi(KEy(),1),Y$0=vi(XCy(),1),X$0=vi(kRy(),1),Z$0=vi(l2y(),1),k$0=vi(A0c(),1),eG0=vi(BGy(),1),tG0=vi(MZy(),1),rG0=vi(jnv(),1),iG0=vi(Olv(),1),nG0=vi(Oyv(),1),aG0=vi(Rmv(),1),mcB=vi(IEv(),1),oG0=vi(ZBv(),1),uG0=vi(v3v(),1),sG0=vi(L5v(),1),cG0=vi(f$v(),1),lG0=vi(RXv(),1),fG0=vi(wnb(),1),dG0=vi(vfb(),1),pG0=vi(_bb(),1),_G0=vi(fwb(),1),hG0=vi(fqb(),1),PcB=vi(YIb(),1),yG0=vi(a2b(),1),vG0=vi(wVb(),1),bG0=vi(JKb(),1),gG0=vi(Pu0(),1),OG0=vi(n00(),1),mG0=vi(GM0(),1),jcB=vi(eI0(),1),wcB=vi(s70(),1),ScB=vi(y90(),1),DcB=vi(V$0(),1);function PG0({inlinedRequest:e,allTypes:t}){let r=new Set,i=t.reduce((n,a)=>({...n,[WTc(a.name)]:a}),{});for(let n of e.extends)jG0({typeName:n,typeNameToDeclaration:i,referencedTypes:r});for(let n of e.properties)EMn({reference:n.valueType,typeNameToDeclaration:i,referencedTypes:r});return[...r].reduce((n,a)=>{let u=i[a];if(u==null)throw new Error("Cannot find declaration for ID: "+a);return[...n,u.name]},[])}function EMn({reference:e,typeNameToDeclaration:t,referencedTypes:r}){he.V2.types.TypeReference._visit(e,{primitive:Qo,container:i=>{EcB({container:i,typeNameToDeclaration:t,referencedTypes:r})},named:i=>{jG0({typeName:i,typeNameToDeclaration:t,referencedTypes:r})},unknown:Qo,void:Qo,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function EcB({container:e,typeNameToDeclaration:t,referencedTypes:r}){he.V2.types.ContainerType._visit(e,{list:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},set:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},optional:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:i,valueType:n})=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r}),EMn({reference:n,typeNameToDeclaration:t,referencedTypes:r})},literal:Qo,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function jG0({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let i=WTc(e);r.add(i);let n=t[i];if(n==null)throw new Error("Cannot locate type: "+i);for(let a of n.referencedTypes)r.add(WTc(a))}function WTc(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var wG0={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.249",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-3-g97d4964",[J.JAVA_SDK]:"0.0.134-3-g97d4964",[J.JAVA_SPRING]:"0.0.134-3-g97d4964",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(i=>McB(r,i,e.types,n=>{t.push(n)}))}))}}}};function McB(e,t,r,i){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:AcB(t,e,r,i),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function AcB(e,t,r,i){let n=e.requestBody;return n==null?{docs:void 0,type:he.V2.types.TypeReference.void(),typeV2:void 0}:he.V3.services.http.HttpRequestBody._visit(n,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let u={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},l=he.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});i({docs:void 0,availability:e.availability,name:u,shape:l,referencedTypes:PG0({inlinedRequest:a,allTypes:r}),examples:[]});let d=he.V2.types.TypeReference.named(u);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+n.type)}})}var EG0={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:"0.0.11-4-g1c29f6c",[J.POSTMAN]:"0.0.32-rc0",[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>MG0(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(i=>xcB(i))}))}))}})};function MG0(e){return he.V4.types.ExampleTypeShape._visit(e,{object:t=>he.V3.types.ExampleType.object(qcB(t)),union:t=>he.V3.types.ExampleType.union(CcB(t)),alias:t=>he.V3.types.ExampleType.alias(BcB(t)),enum:he.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function qcB(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:vZ(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function vZ(e){return he.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:he.V3.types.ExampleTypeReference.primitive,container:t=>he.V3.types.ExampleTypeReference.container(TcB(t)),named:t=>he.V3.types.ExampleTypeReference.named(AG0(t)),unknown:he.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function TcB(e){return he.V4.types.ExampleContainer._visit(e,{list:t=>he.V3.types.ExampleContainer.list(t.map(vZ)),set:t=>he.V3.types.ExampleContainer.set(t.map(vZ)),optional:t=>he.V3.types.ExampleContainer.optional(t!=null?vZ(t):void 0),map:t=>he.V3.types.ExampleContainer.map(t.map(r=>({key:vZ(r.key),value:vZ(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function AG0(e){return{typeName:e.typeName,shape:MG0(e.shape)}}function CcB(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:he.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>he.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(AG0(t)),singleProperty:t=>he.V3.types.ExampleSingleUnionTypeProperties.singleProperty(vZ(t)),noProperties:()=>he.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function BcB(e){return{value:vZ(e.value)}}function xcB(e){return{servicePathParameters:e.servicePathParameters.map(t=>SG0(t)),endpointPathParameters:e.servicePathParameters.map(t=>SG0(t)),serviceHeaders:e.serviceHeaders.map(t=>DG0(t)),endpointHeaders:e.endpointHeaders.map(t=>DG0(t)),queryParameters:e.queryParameters.map(t=>IcB(t)),request:e.request!=null?zcB(e.request):void 0,response:NcB(e.response)}}function SG0(e){return{key:e.key,value:vZ(e.value)}}function DG0(e){return{key:e.wireKey,value:vZ(e.value)}}function IcB(e){return{key:e.wireKey,value:vZ(e.value)}}function zcB(e){return he.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>RcB(r))}),reference:t=>he.V3.services.http.ExampleRequestBody.reference(vZ(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function RcB(e){return{wireKey:e.wireKey,value:vZ(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function NcB(e){return he.V4.services.http.ExampleResponse._visit(e,{ok:t=>he.V3.services.http.ExampleResponse.ok({body:t.body!=null?vZ(t.body):void 0}),error:t=>he.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?vZ(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var s5o=class{errors;constructor(t){this.errors=t.errors.reduce((r,i)=>({...r,[qG0(i.name)]:i}),{})}getDeclaration(t){let r=qG0(t),i=this.errors[r];if(i==null)throw new Error("Error does not exist: "+r);return i}};function qG0(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function iLt(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function WDe(e){return{...iLt(e.name),wireValue:e.wireValue}}function D2(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function E2(e){return{wireValue:e.wireValue,name:D2(e.name)}}function q9i(e){return e.map(t=>iLt(t))}function T9i(e){return e.map(t=>D2(t))}function Y5(e){return{fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath),name:e.name.originalName,nameV2:iLt(e.name),nameV3:D2(e.name)}}function _z(e){return he.V5.types.TypeReference._visit(e,{named:t=>he.V4.types.TypeReference.named(Y5(t)),container:t=>he.V4.types.TypeReference.container(MMn(t)),primitive:t=>he.V4.types.TypeReference.primitive(t),unknown:he.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function MMn(e){return he.V5.types.ContainerType._visit(e,{list:t=>he.V4.types.ContainerType.list(_z(t)),set:t=>he.V4.types.ContainerType.set(_z(t)),map:({keyType:t,valueType:r})=>he.V4.types.ContainerType.map({keyType:_z(t),valueType:_z(r)}),optional:t=>he.V4.types.ContainerType.optional(_z(t)),literal:t=>he.V5.types.Literal._visit(t,{string:r=>he.V4.types.ContainerType.literal(he.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}var c5o=class{types;constructor(t){this.types=t.types.reduce((r,i)=>({...r,[TG0(i.name)]:i}),{})}resolveTypeReference(t){return he.V5.types.TypeReference._visit(t,{container:r=>he.V4.types.ResolvedTypeReference.container(MMn(r)),named:r=>{let i=this.getTypeDeclaration(r);return i.shape._type==="alias"?this.resolveTypeReference(i.shape.aliasOf):he.V4.types.ResolvedTypeReference.named({name:Y5(r),shape:FcB(i.shape._type)})},primitive:he.V4.types.ResolvedTypeReference.primitive,unknown:he.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=TG0(t),i=this.types[r];if(i==null)throw new Error("Type does not exist: "+i);return i}};function TG0(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function FcB(e){switch(e){case"object":return he.V4.types.ShapeType.Object;case"union":return he.V4.types.ShapeType.Union;case"enum":return he.V4.types.ShapeType.Enum;default:Ko(e)}}function C9i(e){return{name:WDe(e.name),nameV2:E2(e.name),valueType:_z(e.valueType),availability:e.availability,docs:e.docs}}function CG0(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>LcB(t))}}function LcB(e){return he.V5.auth.AuthScheme._visit(e,{basic:he.V4.auth.AuthScheme.basic,bearer:he.V4.auth.AuthScheme.bearer,header:t=>he.V4.auth.AuthScheme.header(C9i(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function BG0(e){return{docs:e.docs,id:e.id,url:e.url,name:D2(e.name)}}function xG0({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let i=e.type!=null?he.V4.types.Type.alias({aliasOf:_z(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:iLt(e.name.name),nameV3:D2(e.name.name),fernFilepath:q9i(e.name.fernFilepath),fernFilepathV2:T9i(e.name.fernFilepath)},discriminantValueV2:E2(e.discriminantValue),discriminantValueV3:he.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:he.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:n=>he.V4.errors.ErrorDeclarationDiscriminantValue.property(E2(n.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:E2(e.discriminantValue),type:i??he.V4.types.Type.alias({aliasOf:he.V4.types.TypeReference.void(),resolvedType:he.V4.types.ResolvedTypeReference.void()}),typeV2:i,typeV3:e.type!=null?_z(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function bZ(e){return{jsonExample:e.jsonExample,shape:IG0(e.shape)}}function IG0(e){return he.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:he.V4.types.ExampleTypeReferenceShape.primitive,container:t=>he.V4.types.ExampleTypeReferenceShape.container(VcB(t)),unknown:he.V4.types.ExampleTypeReferenceShape.unknown,named:t=>he.V4.types.ExampleTypeReferenceShape.named(UcB(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function UcB(e){return{typeName:Y5(e.typeName),shape:l5o(e.shape)}}function VcB(e){return he.V5.types.ExampleContainer._visit(e,{list:t=>he.V4.types.ExampleContainer.list(t.map(r=>bZ(r))),set:t=>he.V4.types.ExampleContainer.set(t.map(r=>bZ(r))),optional:t=>he.V4.types.ExampleContainer.optional(t!=null?bZ(t):void 0),map:t=>he.V4.types.ExampleContainer.map(t.map(r=>({key:bZ(r.key),value:bZ(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function l5o(e){return he.V5.types.ExampleTypeShape._visit(e,{alias:t=>he.V4.types.ExampleTypeShape.alias({value:bZ(t.value)}),object:t=>he.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:bZ(r.value),originalTypeDeclaration:Y5(r.originalTypeDeclaration)}))}),union:t=>he.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:he.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>he.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:Y5(r.typeName),shape:l5o(r.shape)}),singleProperty:r=>he.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:IG0(r.shape)}),noProperties:he.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>he.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function NG0({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:WcB(e.name),basePath:HcB(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>$cB({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>C9i(r)),pathParameters:e.pathParameters.map(r=>FG0(r))}}function WcB(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath)}}function HcB(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function $cB({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:iLt(e.name),nameV2:D2(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>C9i(r)),path:e.path,pathParameters:e.pathParameters.map(r=>FG0(r)),queryParameters:e.queryParameters.map(r=>GcB(r)),requestBody:e.requestBody!=null?QcB(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?JcB(e.sdkRequest):void 0,response:KcB(e.response),errors:e.errors.map(r=>YcB(r)),errorsV2:XcB({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>elB(r))}}function FG0(e){return{docs:e.docs,availability:e.availability,name:iLt(e.name),nameV2:D2(e.name),valueType:_z(e.valueType)}}function GcB(e){return{docs:e.docs,availability:e.availability,name:WDe(e.name),nameV2:E2(e.name),valueType:_z(e.valueType),allowMultiple:e.allowMultiple}}function QcB(e){return he.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V4.services.http.HttpRequestBody.inlinedRequestBody({name:D2(t.name),extends:t.extends.map(r=>Y5(r)),properties:t.properties.map(r=>({docs:r.docs,name:E2(r.name),valueType:_z(r.valueType)}))}),reference:t=>he.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:_z(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function JcB(e){return{requestParameterName:D2(e.requestParameterName),shape:he.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>he.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:_z(t.requestBodyType)}),wrapper:t=>he.V4.services.http.SdkRequestShape.wrapper({wrapperName:D2(t.wrapperName),bodyKey:D2(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function KcB(e){let t=e.type!=null?_z(e.type):void 0;return{docs:e.docs,type:t??he.V4.types.TypeReference.void(),typeV2:t}}function YcB(e){return{docs:e.docs,error:HTc(e.error)}}function XcB({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>ZcB({responseError:r,errorResolver:t}))}}function ZcB({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:WDe(r.discriminantValue),shape:kcB({responseError:e,declaration:r})}}function kcB({responseError:e,declaration:t}){return t.type==null?he.V4.services.commons.ResponseErrorShape.noProperties():he.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:HTc(e.error)})}function HTc(e){return{name:e.name.originalName,nameV2:iLt(e.name),nameV3:D2(e.name),fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath)}}function elB(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>zG0(t)),endpointPathParameters:e.endpointPathParameters.map(t=>zG0(t)),serviceHeaders:e.serviceHeaders.map(t=>RG0(t)),endpointHeaders:e.endpointHeaders.map(t=>RG0(t)),queryParameters:e.queryParameters.map(t=>tlB(t)),request:e.request!=null?rlB(e.request):void 0,response:nlB(e.response)}}function zG0(e){return{key:e.key,value:bZ(e.value)}}function RG0(e){return{wireKey:e.wireKey,value:bZ(e.value)}}function tlB(e){return{wireKey:e.wireKey,value:bZ(e.value)}}function rlB(e){return he.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>ilB(r))}),reference:t=>he.V4.services.http.ExampleRequestBody.reference(bZ(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function ilB(e){return{wireKey:e.wireKey,value:bZ(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?Y5(e.originalTypeDeclaration):void 0}}function nlB(e){return he.V5.http.ExampleResponse._visit(e,{ok:t=>he.V4.services.http.ExampleResponse.ok({body:t.body!=null?bZ(t.body):void 0}),error:t=>he.V4.services.http.ExampleResponse.error({error:HTc(t.error),body:t.body!=null?bZ(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function LG0(e){return{docs:e.docs,availability:e.availability,name:Y5(e.name),shape:alB(e.shape),examples:e.examples.map(t=>olB(t)),referencedTypes:e.referencedTypes.map(t=>Y5(t))}}function alB(e){return he.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>he.V4.types.Type.alias({aliasOf:_z(t),resolvedType:ulB(r)}),enum:t=>he.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:WDe(r.name),nameV2:E2(r.name),value:r.name.wireValue}))}),object:t=>he.V4.types.Type.object({extends:t.extends.map(r=>Y5(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:WDe(r.name),nameV2:E2(r.name),valueType:_z(r.valueType)}))}),union:t=>he.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:WDe(t.discriminant),discriminantV3:E2(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:WDe(r.discriminantValue),discriminantValueV2:E2(r.discriminantValue),valueType:he.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>he.V4.types.TypeReference.named(Y5(i)),singleProperty:i=>_z(i.type),noProperties:he.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:he.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>he.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(Y5(i)),singleProperty:i=>he.V4.types.SingleUnionTypeProperties.singleProperty({name:WDe(i.name),nameV2:E2(i.name),type:_z(i.type)}),noProperties:he.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function olB(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:l5o(e.shape)}}function ulB(e){return he.V5.types.ResolvedTypeReference._visit(e,{named:t=>he.V4.types.ResolvedTypeReference.named({name:Y5(t.name),shape:slB(t.shape)}),container:t=>he.V4.types.ResolvedTypeReference.container(MMn(t)),primitive:he.V4.types.ResolvedTypeReference.primitive,unknown:he.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function slB(e){return he.V5.types.ShapeType._visit(e,{enum:()=>he.V5.types.ShapeType.Enum,object:()=>he.V5.types.ShapeType.Object,union:()=>he.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var UG0={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[J.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new c5o(e),r=new s5o(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:CG0(e.auth),headers:e.headers.map(i=>C9i(i)),types:e.types.map(i=>LG0(i)),services:{http:e.services.map(i=>NG0({service:i,errorResolver:r})),websocket:[]},errors:e.errors.map(i=>xG0({errorDeclaration:i,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:WDe(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:E2(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(i=>BG0(i)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?D2(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:he.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:he.V4.ir.ErrorDiscriminationStrategy.statusCode,property:i=>he.V4.ir.ErrorDiscriminationStrategy.property({discriminant:E2(i.discriminant),contentProperty:E2(i.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var VG0={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[J.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[J.OPENAPI]:"0.0.16-1-ga2c0ada",[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?he.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:i=>i.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var WG0={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.268",[J.TYPESCRIPT_EXPRESS]:"0.0.268",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],i=r!=null?`${r.pascalCase.safeName}Service`:"Service",n=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",u=a.toUpperCase(),l=q3(n);return{...t,name:{name:{originalName:i,camelCase:{safeName:n,unsafeName:n},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:u,unsafeName:u},pascalCase:{safeName:l,unsafeName:l}},fernFilepath:t.name.fernFilepath}}})})};var GG0={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[J.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[J.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[J.OPENAPI_PYTHON_CLIENT]:"0.0.0",[J.OPENAPI]:"0.0.20-1-gbbeb9bd",[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:clB(e.auth),headers:e.headers.map(t=>f5o(t)),types:e.types.map(t=>llB(t)),errors:e.errors.map(t=>vlB(t)),services:e.services.map(t=>blB(t))})};function $Tc(e){return e.allParts}function clB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V7.auth.AuthScheme.header(f5o(t)))}}function f5o(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:XG(e.valueType)}}function XG(e){return he.V8.types.TypeReference._visit(e,{container:t=>he.V7.types.TypeReference.container(QG0(t)),named:t=>he.V7.types.TypeReference.named(nLt(t)),primitive:he.V7.types.TypeReference.primitive,unknown:he.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function QG0(e){return he.V8.types.ContainerType._visit(e,{list:t=>he.V7.types.ContainerType.list(XG(t)),optional:t=>he.V7.types.ContainerType.optional(XG(t)),set:t=>he.V7.types.ContainerType.set(XG(t)),map:({keyType:t,valueType:r})=>he.V7.types.ContainerType.map({keyType:XG(t),valueType:XG(r)}),literal:he.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function nLt(e){return{name:e.name,fernFilepath:$Tc(e.fernFilepath)}}function llB(e){return{docs:e.docs,availability:e.availability,name:nLt(e.name),shape:flB(e.shape),examples:e.examples.map(t=>hlB(t)),referencedTypes:e.referencedTypes.map(t=>nLt(t))}}function flB(e){return he.V8.types.Type._visit(e,{alias:t=>he.V7.types.Type.alias({aliasOf:XG(t.aliasOf),resolvedType:dlB(t.resolvedType)}),enum:he.V7.types.Type.enum,object:t=>he.V7.types.Type.object({extends:t.extends.map(r=>nLt(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:XG(r.valueType)}))}),union:t=>he.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>plB(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function dlB(e){return he.V8.types.ResolvedTypeReference._visit(e,{container:t=>he.V7.types.ResolvedTypeReference.container(QG0(t)),named:t=>he.V7.types.ResolvedTypeReference.named({name:nLt(t.name),shape:t.shape}),primitive:he.V7.types.ResolvedTypeReference.primitive,unknown:he.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function plB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:_lB(e.shape)}}function _lB(e){return he.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(nLt(t)),singleProperty:t=>he.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:XG(t.type)}),noProperties:he.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function hlB(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:GTc(e.shape)}}function GTc(e){return he.V8.types.ExampleTypeShape._visit(e,{alias:t=>he.V7.types.ExampleTypeShape.alias({value:eae(t.value)}),enum:he.V7.types.ExampleTypeShape.enum,object:t=>he.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:eae(r.value),originalTypeDeclaration:nLt(r.originalTypeDeclaration)}))}),union:t=>he.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:ylB(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function eae(e){return{jsonExample:e.jsonExample,shape:JG0(e.shape)}}function JG0(e){return he.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>he.V7.types.ExampleTypeReferenceShape.named({typeName:nLt(t.typeName),shape:GTc(t.shape)}),container:t=>he.V7.types.ExampleTypeReferenceShape.container(he.V8.types.ExampleContainer._visit(t,{list:r=>he.V7.types.ExampleContainer.list(r.map(i=>eae(i))),set:r=>he.V7.types.ExampleContainer.set(r.map(i=>eae(i))),optional:r=>he.V7.types.ExampleContainer.optional(r!=null?eae(r):void 0),map:r=>he.V7.types.ExampleContainer.map(r.map(i=>({key:eae(i.key),value:eae(i.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:he.V7.types.ExampleTypeReferenceShape.primitive,unknown:he.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function ylB(e){return he.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:nLt(t.typeName),shape:GTc(t.shape)}),singleProperty:t=>he.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:JG0(t.shape)}),noProperties:he.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function vlB(e){return{docs:e.docs,name:QTc(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?XG(e.type):void 0,statusCode:e.statusCode}}function QTc(e){return{name:e.name,fernFilepath:$Tc(e.fernFilepath)}}function blB(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:$Tc(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>KG0(t)),headers:e.headers.map(t=>f5o(t)),endpoints:e.endpoints.map(t=>glB(t))}}function KG0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:XG(e.valueType)}}function glB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>OlB(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>KG0(t)),sdkRequest:e.sdkRequest!=null?PlB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?wlB(e.requestBody):void 0,response:SlB(e.response),headers:e.headers.map(t=>f5o(t)),queryParameters:e.queryParameters.map(t=>mlB(t)),examples:e.examples.map(t=>DlB(t))}}function OlB(e){return{docs:e.docs,error:QTc(e.error)}}function mlB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:XG(e.valueType),allowMultiple:e.allowMultiple}}function PlB(e){return{requestParameterName:e.requestParameterName,shape:jlB(e.shape)}}function jlB(e){return he.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:XG(t.requestBodyType)}),wrapper:he.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function wlB(e){return he.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>nLt(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:XG(r.valueType)}))}),reference:t=>he.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:XG(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function SlB(e){return{docs:e.docs,type:e.type!=null?XG(e.type):void 0}}function DlB(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>HG0(t)),endpointPathParameters:e.endpointPathParameters.map(t=>HG0(t)),queryParameters:e.queryParameters.map(t=>ElB(t)),serviceHeaders:e.serviceHeaders.map(t=>$G0(t)),endpointHeaders:e.endpointHeaders.map(t=>$G0(t)),request:e.request!=null?MlB(e.request):void 0,response:AlB(e.response)}}function HG0(e){return{key:e.key,value:eae(e.value)}}function ElB(e){return{wireKey:e.wireKey,value:eae(e.value)}}function $G0(e){return{wireKey:e.wireKey,value:eae(e.value)}}function MlB(e){return he.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:eae(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?nLt(r.originalTypeDeclaration):void 0}))}),reference:t=>he.V7.http.ExampleRequestBody.reference(eae(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function AlB(e){return he.V8.http.ExampleResponse._visit(e,{ok:t=>he.V7.http.ExampleResponse.ok({body:t.body!=null?eae(t.body):void 0}),error:t=>he.V7.http.ExampleResponse.error({error:QTc(t.error),body:t.body!=null?eae(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var YG0={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[J.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[J.JAVA_SDK]:"0.0.134-4-gef1ec4f",[J.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[J.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[J.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))n.shape._type==="union"&&n.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${n.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===dC.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var XG0={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:ii,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let i=t[r.service];if(i==null)throw new Error("Service does not exist: "+r.service);i.docs=r.docs}return{...e,services:t}}};var ZG0={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[J.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-15-ge1ac358",[J.JAVA_SDK]:"0.0.134-15-ge1ac358",[J.JAVA_SPRING]:"0.0.134-15-ge1ac358",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:ii,[J.OPENAPI]:$e,[J.POSTMAN]:"0.0.40-1-g9aa2117",[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:qlB(e.auth,t)})};function qlB(e,t){return{...e,schemes:e.schemes.map(r=>TlB(r,t))}}function TlB(e,{taskContext:t,targetGenerator:r}){return he.V11.auth.AuthScheme._visit(e,{bearer:he.V10.auth.AuthScheme.bearer,basic:he.V10.auth.AuthScheme.basic,header:i=>i.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):he.V10.auth.AuthScheme.header({docs:i.docs,availability:{status:he.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:i.name,wireValue:i.header},valueType:i.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var eQ0={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[J.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.1.0-1-gdb5c636",[J.JAVA_SDK]:"0.1.0-1-gdb5c636",[J.JAVA_SPRING]:"0.1.0-1-gdb5c636",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:"0.0.23-8-g479c860",[J.OPENAPI]:"0.0.22-1-g1c86b58",[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let i=od(e.types,n=>({...n,shape:he.V12.types.Type._visit(n.shape,{union:he.V11.types.Type.union,enum:he.V11.types.Type.enum,object:he.V11.types.Type.object,alias:a=>he.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:he.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:he.V11.types.ResolvedTypeReference.container,primitive:he.V11.types.ResolvedTypeReference.primitive,named:u=>u.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(kG0({taskContext:t,targetGenerator:r})):he.V11.types.ResolvedTypeReference.named({shape:u.shape,name:u.name}),unknown:he.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(kG0({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:i,services:od(e.services,n=>ClB(n,{taskContext:t,targetGenerator:r}))}}};function kG0(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function ClB(e,t){return{...e,endpoints:e.endpoints.map(r=>BlB(r,t))}}function BlB(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?he.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:he.V11.http.HttpRequestBody.inlinedRequestBody,reference:he.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var tQ0={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:od(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:he.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var rQ0={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V14.types.Type._visit(r.shape,{union:i=>he.V13.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:MF(n.valueType)})),types:i.types.map(n=>zlB(n))}),enum:he.V13.types.Type.enum,object:i=>he.V13.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:MF(n.valueType)}))}),alias:i=>he.V13.types.Type.alias({aliasOf:MF(i.aliasOf),resolvedType:NlB(i.resolvedType)}),undiscriminatedUnion:i=>he.V13.types.Type.undiscriminatedUnion(FlB(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:xlB(e.auth),headers:e.headers.map(r=>YTc(r)),types:t,services:od(e.services,r=>LlB(r)),errors:od(e.errors,r=>QlB(r))}}};function xlB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V13.auth.AuthScheme.header(IlB(t)))}}function IlB(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:MF(e.valueType)}}function YTc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:MF(e.valueType)}}function MF(e){return he.V14.types.TypeReference._visit(e,{container:t=>he.V13.types.TypeReference.container(iQ0(t)),primitive:t=>t==="DATE"?he.V13.types.TypeReference.primitive(he.V13.types.PrimitiveType.String):he.V13.types.TypeReference.primitive(t),named:he.V13.types.TypeReference.named,unknown:he.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function iQ0(e){return he.V14.types.ContainerType._visit(e,{list:t=>he.V13.types.ContainerType.list(MF(t)),optional:t=>he.V13.types.ContainerType.optional(MF(t)),set:t=>he.V13.types.ContainerType.set(MF(t)),map:({keyType:t,valueType:r})=>he.V13.types.ContainerType.map({keyType:MF(t),valueType:MF(r)}),literal:he.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function zlB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:RlB(e.shape)}}function RlB(e){return he.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:MF(t.type)}),noProperties:he.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function NlB(e){return he.V14.types.ResolvedTypeReference._visit(e,{container:t=>he.V13.types.ResolvedTypeReference.container(iQ0(t)),named:he.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?he.V13.types.ResolvedTypeReference.primitive(he.V13.types.PrimitiveType.String):he.V13.types.ResolvedTypeReference.primitive(t),unknown:he.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function FlB(e){return{members:e.members.map(t=>({...t,type:MF(t.type)}))}}function LlB(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>nQ0(t)),headers:e.headers.map(t=>YTc(t)),endpoints:e.endpoints.map(t=>UlB(t))}}function nQ0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:MF(e.valueType)}}function UlB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>nQ0(t)),sdkRequest:e.sdkRequest!=null?WlB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?$lB(e.requestBody):void 0,response:e.response!=null?JTc(e.response):void 0,headers:e.headers.map(t=>YTc(t)),queryParameters:e.queryParameters.map(t=>VlB(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?KTc(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?GlB(e.sdkResponse):void 0}}function VlB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:MF(e.valueType),allowMultiple:e.allowMultiple}}function WlB(e){return{requestParameterName:e.requestParameterName,shape:HlB(e.shape)}}function HlB(e){return he.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:MF(t.requestBodyType)}),wrapper:he.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function $lB(e){return he.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:MF(r.valueType)}))}),reference:t=>he.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:MF(t.requestBodyType)}),fileUpload:t=>he.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:MF(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function JTc(e){return{docs:e.docs,responseBodyType:MF(e.responseBodyType)}}function KTc(e){return{dataEventType:MF(e.dataEventType),terminator:e.terminator}}function GlB(e){return he.V14.http.SdkResponse._visit(e,{streaming:t=>he.V13.http.SdkResponse.streaming(KTc(t)),nonStreaming:t=>he.V13.http.SdkResponse.nonStreaming(JTc(t)),maybeStreaming:t=>he.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:JTc(t.nonStreaming),streaming:KTc(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function QlB(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?MF(e.type):void 0,statusCode:e.statusCode}}var aQ0={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[J.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.0.52-3-gd9df38df",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V15.types.Type._visit(r.shape,{union:i=>he.V14.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:AF(n.valueType)})),types:i.types.map(n=>YlB(n))}),enum:he.V14.types.Type.enum,object:i=>he.V14.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:AF(n.valueType)}))}),alias:i=>he.V14.types.Type.alias({aliasOf:AF(i.aliasOf),resolvedType:ZlB(i.resolvedType)}),undiscriminatedUnion:i=>he.V14.types.Type.undiscriminatedUnion(klB(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:JlB(e.auth),headers:e.headers.map(r=>kTc(r)),types:t,services:od(e.services,r=>efB(r)),errors:od(e.errors,r=>ufB(r))}}};function JlB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V14.auth.AuthScheme.header(KlB(t)))}}function KlB(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:AF(e.valueType)}}function kTc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:AF(e.valueType)}}function AF(e){return he.V15.types.TypeReference._visit(e,{container:t=>he.V14.types.TypeReference.container(oQ0(t)),primitive:t=>t==="BASE_64"?he.V14.types.TypeReference.primitive(he.V14.types.PrimitiveType.String):he.V14.types.TypeReference.primitive(t),named:he.V14.types.TypeReference.named,unknown:he.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function oQ0(e){return he.V15.types.ContainerType._visit(e,{list:t=>he.V14.types.ContainerType.list(AF(t)),optional:t=>he.V14.types.ContainerType.optional(AF(t)),set:t=>he.V14.types.ContainerType.set(AF(t)),map:({keyType:t,valueType:r})=>he.V14.types.ContainerType.map({keyType:AF(t),valueType:AF(r)}),literal:he.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function YlB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:XlB(e.shape)}}function XlB(e){return he.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:AF(t.type)}),noProperties:he.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function ZlB(e){return he.V15.types.ResolvedTypeReference._visit(e,{container:t=>he.V14.types.ResolvedTypeReference.container(oQ0(t)),named:he.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?he.V14.types.ResolvedTypeReference.primitive(he.V14.types.PrimitiveType.String):he.V14.types.ResolvedTypeReference.primitive(t),unknown:he.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function klB(e){return{members:e.members.map(t=>({...t,type:AF(t.type)}))}}function efB(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>uQ0(t)),headers:e.headers.map(t=>kTc(t)),endpoints:e.endpoints.map(t=>tfB(t))}}function uQ0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:AF(e.valueType)}}function tfB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>uQ0(t)),sdkRequest:e.sdkRequest!=null?ifB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?afB(e.requestBody):void 0,response:e.response!=null?XTc(e.response):void 0,headers:e.headers.map(t=>kTc(t)),queryParameters:e.queryParameters.map(t=>rfB(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ZTc(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?ofB(e.sdkResponse):void 0}}function rfB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:AF(e.valueType),allowMultiple:e.allowMultiple}}function ifB(e){return{requestParameterName:e.requestParameterName,shape:nfB(e.shape)}}function nfB(e){return he.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:AF(t.requestBodyType)}),wrapper:he.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function afB(e){return he.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:AF(r.valueType)}))}),reference:t=>he.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:AF(t.requestBodyType)}),fileUpload:t=>he.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:AF(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function XTc(e){return{docs:e.docs,responseBodyType:AF(e.responseBodyType)}}function ZTc(e){return{dataEventType:AF(e.dataEventType),terminator:e.terminator}}function ofB(e){return he.V15.http.SdkResponse._visit(e,{streaming:t=>he.V14.http.SdkResponse.streaming(ZTc(t)),nonStreaming:t=>he.V14.http.SdkResponse.nonStreaming(XTc(t)),maybeStreaming:t=>he.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:XTc(t.nonStreaming),streaming:ZTc(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function ufB(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?AF(e.type):void 0,statusCode:e.statusCode}}var sQ0={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[J.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[J.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[J.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:od(e.services,i=>({...i,pathParameters:eCc(i.pathParameters),endpoints:i.endpoints.map(n=>({...n,allPathParameters:eCc(n.allPathParameters),pathParameters:eCc(n.pathParameters)}))}))}};function eCc(e){return e.map(t=>sfB(t))}function sfB(e){return{...e,availability:{status:he.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var cQ0={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))if(n.shape._type==="union"&&n.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${i} in file ${n.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var lQ0={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[J.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[J.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.3.0-3-ge125e311",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:od(e.services,i=>{let n=i.endpoints[0]?.baseUrl;return i.endpoints.some(a=>a.baseUrl!==n)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...i,baseUrl:n}})})};var dQ0={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[J.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[J.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:"0.0.44-1-gbf4b0f3",[J.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>cfB(r,t)),types:od(e.types,r=>hfB(r,t))})};function cfB(e,t){return{...e,endpoints:e.endpoints.map(r=>lfB(r,t))}}function lfB(e,t){return{...e,examples:e.examples.map(r=>ffB(r,t))}}function ffB(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>tCc(r,t)),servicePathParameters:e.servicePathParameters.map(r=>tCc(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>tCc(r,t)),serviceHeaders:e.serviceHeaders.map(r=>fQ0(r,t)),endpointHeaders:e.endpointHeaders.map(r=>fQ0(r,t)),queryParameters:e.queryParameters.map(r=>dfB(r,t)),request:e.request!=null?pfB(e.request,t):void 0,response:_fB(e.response,t)}}function tCc(e,t){return{key:e.key,value:tae(e.value,t)}}function fQ0(e,t){return{wireKey:e.wireKey,value:tae(e.value,t)}}function dfB(e,t){return{wireKey:e.wireKey,value:tae(e.value,t)}}function pfB(e,t){return he.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>he.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(i=>({wireKey:i.wireKey,value:tae(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),reference:r=>he.V18.http.ExampleRequestBody.reference(tae(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function _fB(e,t){return he.V19.http.ExampleResponse._visit(e,{ok:r=>he.V18.http.ExampleResponse.ok({body:r.body!=null?tae(r.body,t):void 0}),error:r=>he.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?tae(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function hfB(e,t){return{...e,examples:e.examples.map(r=>yfB(r,t))}}function yfB(e,t){return{...e,shape:rCc(e.shape,t)}}function rCc(e,t){return he.V19.types.ExampleTypeShape._visit(e,{alias:r=>he.V18.types.ExampleTypeShape.alias({value:tae(r.value,t)}),object:r=>he.V18.types.ExampleTypeShape.object({properties:r.properties.map(i=>({wireKey:i.wireKey,value:tae(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),union:r=>he.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:he.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:i=>he.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:i.jsonExample,shape:pQ0(i.shape,t)}),samePropertiesAsObject:i=>he.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:i.typeName,shape:rCc(i.shape,t)}),noProperties:he.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:he.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function tae(e,t){return{jsonExample:e.jsonExample,shape:pQ0(e.shape,t)}}function pQ0(e,t){return he.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>he.V18.types.ExampleTypeReferenceShape.primitive(vfB(r,t)),named:r=>he.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:rCc(r.shape,t)}),container:r=>he.V18.types.ExampleTypeReferenceShape.container(he.V19.types.ExampleContainer._visit(r,{list:i=>he.V18.types.ExampleContainer.list(i.map(n=>tae(n,t))),set:i=>he.V18.types.ExampleContainer.set(i.map(n=>tae(n,t))),optional:i=>he.V18.types.ExampleContainer.optional(i!=null?tae(i,t):void 0),map:i=>he.V18.types.ExampleContainer.map(i.map(n=>({key:tae(n.key,t),value:tae(n.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:he.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function vfB(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var _Q0={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[J.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.20-3-g2505487f",[J.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[J.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[J.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[J.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[J.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[J.GO_FIBER]:ii,[J.GO_MODEL]:"0.0.0",[J.GO_SDK]:"0.0.0",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>bfB(r,t))})};function bfB(e,t){return{...e,endpoints:e.endpoints.map(r=>gfB(r,t))}}function gfB(e,t){return{...e,response:e.response!=null?hQ0(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?OfB(e.sdkResponse,t):void 0}}function hQ0(e,t){return he.V20.http.HttpResponse._visit(e,{fileDownload:()=>yQ0(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function OfB(e,t){return he.V20.http.SdkResponse._visit(e,{fileDownload:()=>yQ0(t),streaming:he.V19.http.SdkResponse.streaming,maybeStreaming:r=>he.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:hQ0(r.nonStreaming,t)}),json:he.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function yQ0({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var vQ0={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>mfB(r,t))})};function mfB(e,t){return{...e,endpoints:e.endpoints.map(r=>PfB(r,t))}}function PfB(e,t){return{...e,streamingResponse:e.streamingResponse!=null?iCc(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?jfB(e.sdkResponse,t):void 0}}function iCc(e,{taskContext:t,targetGenerator:r}){return{dataEventType:he.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:i=>i,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function jfB(e,t){return he.V21.http.SdkResponse._visit(e,{fileDownload:he.V20.http.SdkResponse.fileDownload,streaming:r=>he.V20.http.SdkResponse.streaming(iCc(r,t)),maybeStreaming:r=>he.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:iCc(r.streaming,t),nonStreaming:r.nonStreaming}),json:he.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var bQ0={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.5.0-3-gac7ce7c",[J.GO_MODEL]:"0.0.14-8-g2fa39f7",[J.GO_SDK]:"0.0.14-8-g2fa39f7",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:od(e.services,t=>wfB(t))})};function wfB(e){return{...e,endpoints:e.endpoints.map(t=>SfB(t))}}function SfB(e){return{...e,...e.response!=null?he.V22.http.HttpResponse._visit(e.response,{json:t=>({response:he.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:he.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:he.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:he.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:he.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var mQ0={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[J.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:"0.0.28-3-g112d3dd",[J.STOPLIGHT]:"0.0.28-3-g112d3dd",[J.POSTMAN]:"0.0.44-4-gddab2ae",[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],i={};for(let[n,a]of Object.entries(e.services)){let u=[];for(let l of a.endpoints){let d=DfB(l);d==null?r.push(l):u.push(d)}i[n]={...a,endpoints:u,headers:a.headers.map(l=>aCc(l)),pathParameters:a.pathParameters.map(l=>d5o(l))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(n=>n.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(n=>MfB(n))},headers:e.headers.map(n=>aCc(n)),types:od(e.types,n=>AfB(n)),services:i,errors:od(e.errors,n=>IfB(n)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(n=>d5o(n)),variables:e.variables.map(n=>zfB(n))}}};function DfB(e){let t;if(!(e.requestBody!=null&&(t=EfB(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>aCc(r)),pathParameters:e.pathParameters.map(r=>d5o(r)),allPathParameters:e.allPathParameters.map(r=>d5o(r)),queryParameters:e.queryParameters.map(r=>RfB(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:NfB(e.sdkRequest.shape)}:void 0,response:e.response!=null?FfB(e.response):void 0,examples:e.examples.map(r=>LfB(r))}}function EfB(e){switch(e.type){case"bytes":return;case"fileUpload":return he.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>VfB(t))});case"inlinedRequestBody":return he.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>WfB(t))});case"reference":return he.V22.http.HttpRequestBody.reference({...e,requestBodyType:qF(e.requestBodyType)});default:Ko(e)}}function aCc(e){return{...e,valueType:qF(e.valueType)}}function MfB(e){return e._visit({bearer:he.V22.auth.AuthScheme.bearer,basic:he.V22.auth.AuthScheme.basic,header:t=>he.V22.auth.AuthScheme.header({...t,valueType:qF(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function AfB(e){return{...e,shape:qfB(e.shape),examples:e.examples.map(t=>TfB(t))}}function qfB(e){return e._visit({alias:t=>he.V22.types.Type.alias({...t,aliasOf:qF(t.aliasOf),resolvedType:BfB(t.resolvedType)}),enum:he.V22.types.Type.enum,object:t=>he.V22.types.Type.object({...t,properties:t.properties.map(r=>gQ0(r))}),union:t=>he.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>gQ0(r)),types:t.types.map(r=>({...r,shape:xfB(r.shape)}))}),undiscriminatedUnion:t=>he.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:qF(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function TfB(e){return{...e,shape:oCc(e.shape)}}function oCc(e){return e._visit({alias:t=>he.V22.types.ExampleTypeShape.alias({...t,value:HDe(t.value)}),enum:he.V22.types.ExampleTypeShape.enum,object:t=>he.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:HDe(r.value)}))}),union:t=>he.V22.types.ExampleTypeShape.union({...t,properties:CfB(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function HDe(e){return{...e,shape:uCc(e.shape)}}function uCc(e){return e._visit({primitive:t=>he.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:he.V22.types.ExamplePrimitive.integer,double:he.V22.types.ExamplePrimitive.double,string:he.V22.types.ExamplePrimitive.string,boolean:he.V22.types.ExamplePrimitive.boolean,long:he.V22.types.ExamplePrimitive.long,datetime:r=>he.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:he.V22.types.ExamplePrimitive.date,uuid:he.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>he.V22.types.ExampleTypeReferenceShape.named({...t,shape:oCc(t.shape)}),container:t=>he.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>he.V22.types.ExampleContainer.list(r.map(i=>HDe(i))),set:r=>he.V22.types.ExampleContainer.set(r.map(i=>HDe(i))),optional:r=>he.V22.types.ExampleContainer.optional(r!=null?HDe(r):void 0),map:r=>he.V22.types.ExampleContainer.map(r.map(i=>({key:HDe(i.key),value:HDe(i.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:he.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function CfB(e){return e._visit({singleProperty:t=>he.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:uCc(t.shape)}),noProperties:he.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>he.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:oCc(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function qF(e){return e._visit({container:t=>he.V22.types.TypeReference.container(PQ0(t)),primitive:he.V22.types.TypeReference.primitive,named:he.V22.types.TypeReference.named,unknown:he.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function PQ0(e){return e._visit({list:t=>he.V22.types.ContainerType.list(qF(t)),set:t=>he.V22.types.ContainerType.set(qF(t)),optional:t=>he.V22.types.ContainerType.optional(qF(t)),map:t=>he.V22.types.ContainerType.map({keyType:qF(t.keyType),valueType:qF(t.valueType)}),literal:he.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function BfB(e){return e._visit({container:t=>he.V22.types.ResolvedTypeReference.container(PQ0(t)),primitive:he.V22.types.ResolvedTypeReference.primitive,named:he.V22.types.ResolvedTypeReference.named,unknown:he.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function gQ0(e){return{...e,valueType:qF(e.valueType)}}function xfB(e){return e._visit({noProperties:he.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>he.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:qF(t.type)}),samePropertiesAsObject:he.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function IfB(e){return{...e,type:e.type!=null?qF(e.type):void 0}}function zfB(e){return{...e,type:qF(e.type)}}function d5o(e){return{...e,valueType:qF(e.valueType)}}function RfB(e){return{...e,valueType:qF(e.valueType)}}function NfB(e){return e._visit({justRequestBody:t=>he.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:qF(t.requestBodyType)}),wrapper:he.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function FfB(e){return e._visit({json:t=>he.V22.http.HttpResponse.json({...t,responseBodyType:qF(t.responseBodyType)}),fileDownload:he.V22.http.HttpResponse.fileDownload,streaming:t=>he.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>he.V22.http.StreamingResponseChunkType.json(qF(r)),text:he.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function LfB(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>nCc(t)),servicePathParameters:e.servicePathParameters.map(t=>nCc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>nCc(t)),serviceHeaders:e.serviceHeaders.map(t=>OQ0(t)),endpointHeaders:e.endpointHeaders.map(t=>OQ0(t)),queryParameters:e.queryParameters.map(t=>UfB(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>he.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:HDe(r.value)}))}),reference:t=>he.V22.http.ExampleRequestBody.reference({...t,shape:uCc(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>he.V22.http.ExampleResponse.ok({...t,body:t.body!=null?HDe(t.body):void 0}),error:t=>he.V22.http.ExampleResponse.error({...t,body:t.body!=null?HDe(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function nCc(e){return{...e,value:HDe(e.value)}}function UfB(e){return{...e,value:HDe(e.value)}}function OQ0(e){return{...e,value:HDe(e.value)}}function VfB(e){return e._visit({file:he.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>he.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:qF(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function WfB(e){return{...e,valueType:qF(e.valueType)}}var W_={};Io(W_,{V23:()=>W8F,V24:()=>H8F,V25:()=>$8F,V26:()=>G8F,V27:()=>Q8F,V28:()=>J8F,V29:()=>K8F,V30:()=>Y8F,V31:()=>X8F,V32:()=>Z8F,V33:()=>k8F,V34:()=>e5F,V35:()=>t5F,V36:()=>r5F,V37:()=>i5F,V38:()=>n5F,V39:()=>a5F,V40:()=>o5F,V41:()=>u5F,V42:()=>s5F,V43:()=>c5F,V44:()=>l5F,V45:()=>f5F,V46:()=>d5F,V47:()=>p5F,V48:()=>_5F,V49:()=>h5F,V50:()=>y5F,V51:()=>v5F,V52:()=>b5F,V53:()=>g5F,V54:()=>O5F,V55:()=>m5F,V56:()=>t_});var W8F=vi(Eo(),1),H8F=vi(so(),1),$8F=vi(Za(),1),G8F=vi(Ja(),1),Q8F=vi(Ua(),1),J8F=vi(Va(),1),K8F=vi(Wa(),1),Y8F=vi(Ia(),1),X8F=vi(xa(),1),Z8F=vi(Oa(),1),k8F=vi(Wn(),1),e5F=vi(Vn(),1),t5F=vi(Tn(),1),r5F=vi(Cn(),1),i5F=vi(qn(),1),n5F=vi(Dn(),1),a5F=vi(ln(),1),o5F=vi(fn(),1),u5F=vi(sn(),1),s5F=vi(tn(),1),c5F=vi(en(),1),l5F=vi(Zi(),1),f5F=vi($i(),1),d5F=vi(Li(),1),p5F=vi(Fi(),1),_5F=vi(Ri(),1),h5F=vi(xi(),1),y5F=vi(Ai(),1),v5F=vi(Ei(),1),b5F=vi(gi(),1),g5F=vi(Gt(),1),O5F=vi(kh(),1),m5F=vi(Ih(),1);var i_P={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var n_P={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:"0.4.9-1-ge0997b3",[J.JAVA_SDK]:"0.4.9-1-ge0997b3",[J.JAVA_SPRING]:"0.4.9-1-ge0997b3",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],i=[],n={};for(let[a,u]of Object.entries(e.services)){let l=[];for(let d of u.endpoints){let s;if(d.sdkRequest!=null&&(s=P5F(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let o=d.response._visit({fileDownload:c=>he.V24.HttpResponse.fileDownload(c),json:c=>he.V24.HttpResponse.json(c),streaming:c=>he.V24.HttpResponse.streaming(c),text:()=>(i.push(d),he.V24.HttpResponse.json({docs:void 0,responseBodyType:he.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});l.push({...d,sdkRequest:s,response:o})}else l.push({...d,sdkRequest:s,response:void 0})}n[a]={...u,endpoints:l}}return i.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),i.length===1&&i[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${i[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${i.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:n}}};function P5F(e){let t=e.shape;if(t.type==="wrapper")return{shape:he.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:he.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var o_P={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[J.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,E5F(r)])),headers:e.headers.map(t=>yHu(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(i=>j5F(i))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,w5F(r)]))})};function j5F(e){return{...e,headers:e.headers.map(t=>yHu(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function w5F(e){return{...e,endpoints:e.endpoints.map(t=>S5F(t)),headers:e.headers.map(t=>yHu(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function S5F(e){return{...e,headers:e.headers.map(t=>yHu(t)),queryParameters:e.queryParameters.map(t=>D5F(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function yHu(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function D5F(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function E5F(e){return{...e,shape:e.shape._visit({union:t=>he.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>a_P(r))}),object:t=>he.V25.Type.object({...t,properties:t.properties.map(r=>a_P(r))}),enum:t=>he.V25.Type.enum({...t,values:t.values.map(r=>M5F(r))}),alias:t=>he.V25.Type.alias(t),undiscriminatedUnion:t=>he.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function a_P(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function M5F(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var u_P={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.6.1-3-g94ee67a",[J.GO_MODEL]:"0.6.1-3-g94ee67a",[J.GO_SDK]:"0.6.1-3-g94ee67a",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,A5F(r)]))})};function A5F(e){return{...e,endpoints:e.endpoints.map(t=>q5F(t))}}function q5F(e){return{...e,response:e.response!=null?T5F(e.response):void 0}}function T5F(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?he.V26.HttpResponse.json(t):he.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var s_P={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.9.0-2-g6b0be0e",[J.GO_MODEL]:"0.9.0-2-g6b0be0e",[J.GO_SDK]:"0.9.0-2-g6b0be0e",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:o9F(e.auth),headers:bHu(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,f9F(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,U5F(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,I5F(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,x5F(r)])),pathParameters:vHu(e.pathParameters),variables:C5F(e.variables)})};function C5F(e){return e.map(t=>B5F(t))}function B5F(e){return{...e,type:WR(e.type)}}function x5F(e){return{...e,type:e.type!=null?WR(e.type):void 0}}function I5F(e){return e.map(t=>z5F(t))}function z5F(e){return{...e,headers:bHu(e.headers),payload:R5F(e.payload)}}function R5F(e){switch(e.type){case"inlinedPayload":return he.V27.WebhookPayload.inlinedPayload(N5F(e));case"reference":return he.V27.WebhookPayload.reference({...e,payloadType:WR(e.payloadType)})}}function N5F(e){return{...e,properties:F5F(e.properties)}}function F5F(e){return e.map(t=>L5F(t))}function L5F(e){return{...e,valueType:WR(e.valueType)}}function U5F(e){return{...e,endpoints:V5F(e.endpoints),headers:bHu(e.headers),pathParameters:vHu(e.pathParameters)}}function V5F(e){return e.map(t=>W5F(t))}function W5F(e){return{...e,headers:bHu(e.headers),pathParameters:vHu(e.pathParameters),allPathParameters:vHu(e.allPathParameters),queryParameters:n9F(e.queryParameters),requestBody:e.requestBody!=null?X5F(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?J5F(e.sdkRequest):void 0,response:e.response!=null?H5F(e.response):void 0}}function H5F(e){switch(e.type){case"json":return he.V27.HttpResponse.json(Q5F(e.value));case"fileDownload":return he.V27.HttpResponse.fileDownload(e);case"text":return he.V27.HttpResponse.text(e);case"streaming":return he.V27.HttpResponse.streaming($5F(e));default:Ko(e)}}function $5F(e){return{...e,dataEventType:G5F(e.dataEventType)}}function G5F(e){switch(e.type){case"json":return he.V27.StreamingResponseChunkType.json(WR(e.json));case"text":return he.V27.StreamingResponseChunkType.text();default:Ko(e)}}function Q5F(e){switch(e.type){case"response":return he.V27.JsonResponse.response({...e,responseBodyType:WR(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:WR(e.responseBodyType),responseProperty:e.responseProperty!=null?d_P(e.responseProperty):void 0});default:Ko(e)}}function J5F(e){return{...e,shape:K5F(e.shape)}}function K5F(e){switch(e.type){case"justRequestBody":return he.V27.SdkRequestShape.justRequestBody(Y5F(e.value));case"wrapper":return he.V27.SdkRequestShape.wrapper(e);default:Ko(e)}}function Y5F(e){switch(e.type){case"typeReference":return he.V27.SdkRequestBodyType.typeReference(c_P(e));case"bytes":return he.V27.SdkRequestBodyType.bytes(e);default:Ko(e)}}function X5F(e){switch(e.type){case"inlinedRequestBody":return he.V27.HttpRequestBody.inlinedRequestBody(t9F(e));case"reference":return he.V27.HttpRequestBody.reference(c_P(e));case"fileUpload":return he.V27.HttpRequestBody.fileUpload(Z5F(e));case"bytes":return he.V27.HttpRequestBody.bytes(e);default:Ko(e)}}function Z5F(e){return{...e,properties:k5F(e.properties)}}function k5F(e){return e.map(t=>e9F(t))}function e9F(e){switch(e.type){case"file":return he.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return he.V27.FileUploadRequestProperty.bodyProperty(l_P(e));default:Ko(e)}}function c_P(e){return{...e,requestBodyType:WR(e.requestBodyType)}}function t9F(e){return{...e,properties:r9F(e.properties)}}function r9F(e){return e.map(t=>l_P(t))}function l_P(e){return{...e,valueType:WR(e.valueType)}}function vHu(e){return e.map(t=>i9F(t))}function i9F(e){return{...e,valueType:WR(e.valueType)}}function n9F(e){return e.map(t=>a9F(t))}function a9F(e){return{...e,valueType:WR(e.valueType)}}function o9F(e){return{...e,schemes:u9F(e.schemes)}}function u9F(e){return e.map(t=>s9F(t))}function s9F(e){switch(e.type){case"basic":return he.V27.AuthScheme.basic(e);case"bearer":return he.V27.AuthScheme.bearer(e);case"header":return c9F(e);default:Ko(e)}}function c9F(e){return he.V27.AuthScheme.header({...e,valueType:WR(e.valueType)})}function bHu(e){return e.map(t=>l9F(t))}function l9F(e){return{...e,valueType:WR(e.valueType)}}function f9F(e){return{...e,shape:d9F(e.shape)}}function d9F(e){switch(e.type){case"alias":return he.V27.Type.alias(p9F(e));case"enum":return he.V27.Type.enum(e);case"object":return he.V27.Type.object(_9F(e));case"union":return he.V27.Type.union(h9F(e));case"undiscriminatedUnion":return he.V27.Type.undiscriminatedUnion(y9F(e));default:Ko(e)}}function p9F(e){return{aliasOf:WR(e.aliasOf),resolvedType:O9F(e.resolvedType)}}function _9F(e){return{...e,properties:f_P(e.properties)}}function h9F(e){return{...e,types:v9F(e.types),baseProperties:f_P(e.baseProperties)}}function y9F(e){return{members:g9F(e.members)}}function f_P(e){return e.map(t=>d_P(t))}function d_P(e){return{...e,valueType:WR(e.valueType)}}function v9F(e){return e.map(t=>({...t,shape:b9F(t.shape)}))}function b9F(e){switch(e.propertiesType){case"samePropertiesAsObject":return he.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return he.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:WR(e.type)});case"noProperties":return he.V27.SingleUnionTypeProperties.noProperties();default:Ko(e)}}function g9F(e){return e.map(t=>({...t,type:WR(t.type)}))}function O9F(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?he.V27.ResolvedTypeReference.primitive(he.V27.PrimitiveType.Boolean):he.V27.ResolvedTypeReference.container(he.V27.ContainerType.literal(he.V27.Literal.string(e.container.literal.string))):he.V27.ResolvedTypeReference.container(p_P(e.container));case"named":return he.V27.ResolvedTypeReference.named(e);case"primitive":return he.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return he.V27.ResolvedTypeReference.unknown();default:Ko(e)}}function WR(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?he.V27.TypeReference.primitive(he.V27.PrimitiveType.Boolean):he.V27.TypeReference.container(he.V27.ContainerType.literal(he.V27.Literal.string(e.container.literal.string))):he.V27.TypeReference.container(p_P(e.container));case"named":return he.V27.TypeReference.named(e);case"primitive":return he.V27.TypeReference.primitive(e.primitive);case"unknown":return he.V27.TypeReference.unknown();default:Ko(e)}}function p_P(e){switch(e.type){case"list":return he.V27.ContainerType.list(WR(e.list));case"map":return he.V27.ContainerType.map({keyType:WR(e.keyType),valueType:WR(e.valueType)});case"optional":return he.V27.ContainerType.optional(WR(e.optional));case"set":return he.V27.ContainerType.set(WR(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return he.V27.ContainerType.literal(he.V27.Literal.string(e.literal.string));default:Ko(e)}}var h_P={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[J.JAVA_SDK]:"0.5.14-1-ge4bcd98",[J.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,m9F({typeId:t,allTypes:e.types})]))})};function m9F({typeId:e,allTypes:t}){let r=__P({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(i=>{let n=__P({typeId:i,allTypes:t});return{typeId:i,fernFilepath:n.name.fernFilepath,name:n.name.name}})}}function __P({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var y_P={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[J.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new Llf(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},Llf=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertType(i)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertService(i)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return he.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return he.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:Ko(t)}}convertExampleResponse(t){switch(t.type){case"ok":return he.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return he.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:Ko(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return he.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return he.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return he.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return he.V29.ExampleTypeReferenceShape.unknown(t);default:Ko(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return he.V29.ExamplePrimitive.integer(t.integer);case"double":return he.V29.ExamplePrimitive.double(t.double);case"string":return he.V29.ExamplePrimitive.string(t.string.original);case"boolean":return he.V29.ExamplePrimitive.boolean(t.boolean);case"long":return he.V29.ExamplePrimitive.long(t.long);case"datetime":return he.V29.ExamplePrimitive.datetime(t.datetime);case"date":return he.V29.ExamplePrimitive.date(t.date);case"uuid":return he.V29.ExamplePrimitive.uuid(t.uuid);default:Ko(t)}}convertExampleContainer(t){switch(t.type){case"list":return he.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return he.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return he.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return he.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:Ko(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return he.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return he.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return he.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return he.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:Ko(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return he.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(he.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return he.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return he.V29.ExampleSingleUnionTypeProperties.noProperties();default:Ko(t)}}};var v_P={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.8",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.8",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.7.0-rc0",[J.JAVA_SDK]:"0.7.0-rc0",[J.JAVA_SPRING]:"0.7.0-rc0",[J.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[J.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.7.5-1-gb54fb677",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(i=>({id:i.id,docs:i.docs,availability:i.availability,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,examples:i.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var g_P={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.9.4-2-g139cf36",[J.GO_MODEL]:"0.9.4-2-g139cf36",[J.GO_SDK]:"0.9.4-2-g139cf36",[J.RUBY_MODEL]:"0.0.0",[J.RUBY_SDK]:"0.0.0",[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:E9F(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(P9F)}]))})};function $en({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function P9F(e){return{...e,examples:$en({examples:e.examples,convert:j9F})}}function j9F(e){let t;if(e.request!=null&&(t=w9F(e.request),t==null))return;let r=S9F(e.response);if(r!=null)return{...e,rootPathParameters:$en({examples:e.rootPathParameters,convert:Ulf}),endpointPathParameters:$en({examples:e.endpointPathParameters,convert:Ulf}),servicePathParameters:$en({examples:e.servicePathParameters,convert:Ulf}),endpointHeaders:$en({examples:e.endpointHeaders,convert:b_P}),serviceHeaders:$en({examples:e.serviceHeaders,convert:b_P}),queryParameters:$en({examples:e.queryParameters,convert:D9F}),request:t,response:r}}function w9F(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=Vlf(e.shape);return t==null?void 0:he.V31.ExampleRequestBody.reference({...e,shape:t})}default:Ko(e)}}function S9F(e){switch(e.type){case"ok":{if(e.body==null)return he.V31.ExampleResponse.ok({body:void 0});let t=VPe(e.body);return t==null?void 0:he.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return he.V31.ExampleResponse.error({...e,body:void 0});let t=VPe(e.body);return t==null?void 0:he.V31.ExampleResponse.error({...e,body:t})}}}function Ulf(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function b_P(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function D9F(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function E9F(e){let t=[];for(let r of e){let i=M9F(r);i!=null&&t.push(i)}return t}function M9F(e){let t=O_P(e.shape);if(t!=null)return{...e,shape:t}}function O_P(e){switch(e.type){case"enum":return he.V31.ExampleTypeShape.enum(e);case"alias":{let t=VPe(e.value);return t==null?void 0:he.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=A9F(e.singleUnionType);return t==null?void 0:he.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:Ko(e)}}function VPe(e){let t=Vlf(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function A9F(e){let t=q9F(e.shape);if(t!=null)return{...e,shape:t}}function q9F(e){switch(e.type){case"noProperties":return he.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=Vlf(e.shape);return t==null?void 0:he.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:Ko(e)}}function Vlf(e){switch(e.type){case"container":{let t=T9F(e.container);return t==null?void 0:he.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=O_P(e.shape);return t==null?void 0:he.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return he.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return he.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:Ko(e)}}function T9F(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let i=VPe(r);i!=null&&t.push(i)}return he.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let i=VPe(r);i!=null&&t.push(i)}return he.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let i=VPe(r.key),n=VPe(r.value);i!=null&&n!=null&&t.push({key:i,value:n})}return he.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return he.V31.ExampleContainer.optional();let t=VPe(e.optional);return t==null?he.V31.ExampleContainer.optional():he.V31.ExampleContainer.optional(t)}default:Ko(e)}}var m_P={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.12.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.13.0-3-g8c56a41",[J.GO_MODEL]:"0.13.0-3-g8c56a41",[J.GO_SDK]:"0.13.0-3-g8c56a41",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:"0.0.0",[J.CSHARP_SDK]:"0.0.0",[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new Wlf(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>t.convertEndpoint(n))}]))}}},Wlf=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:he.V33.TypeReference.container(he.V33.ContainerType.optional(he.V33.TypeReference.primitive("STRING")))}:r),examples:C9F({examples:t.examples,convert:B9F})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:Ko(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:Ko(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:Ko(r.shape)}}};function C9F({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function B9F(e){return{...e,queryParameters:e.queryParameters.filter(t=>!Hlf(t.value))}}function Hlf(e){switch(e.shape.type){case"container":return x9F(e.shape.container);case"named":return I9F(e.shape);case"primitive":return!1;case"unknown":return!0;default:Ko(e.shape)}}function x9F(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&Hlf(e.optional);default:Ko(e)}}function I9F(e){switch(e.shape.type){case"alias":return Hlf(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:Ko(e.shape)}}var mLn=vi(A0c(),1);var P_P={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.10.4",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,requestBody:n.requestBody?._visit({inlinedRequestBody:a=>mLn.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>mLn.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>mLn.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(u=>(u.type==="file"&&u.value.type==="fileArray"&&t.taskContext.logger.warn(`${n.method} ${n.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),u.type==="file"?mLn.FernIrV33.FileUploadRequestProperty.file({...u.value}):u))}),bytes:a=>mLn.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var j_P={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.18.0",[J.GO_MODEL]:"0.18.0",[J.GO_SDK]:"0.18.0",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({docs:i.docs,availability:i.availability,id:i.id,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,idempotent:i.idempotent,examples:i.examples}))}]))})};var w_P={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.11.6",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var S_P={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.13.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.13.0",[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.12.0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var D_P={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[J.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.9.0-rc0",[J.PYTHON_PYDANTIC]:"0.9.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"1.2.0-rc0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?._visit({fileDownload:a=>he.V37.HttpResponse.fileDownload(a),json:a=>he.V37.HttpResponse.json(a),streaming:a=>a._visit({json:u=>he.V37.HttpResponse.streaming({dataEventType:he.V37.StreamingResponseChunkType.json(u.payload),docs:u.docs,terminator:u.terminator}),sse:()=>{},text:u=>he.V37.HttpResponse.streaming({dataEventType:he.V37.StreamingResponseChunkType.text(),docs:u.docs,terminator:void 0}),_other:()=>{}}),text:a=>he.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var E_P={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.9.0-rc1",[J.PYTHON_PYDANTIC]:"0.9.0-rc1",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"1.4.0-rc1",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:"0.7.0-rc0",[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>z9F(r))}})};function z9F(e){switch(e.type){case"basic":return he.V38.AuthScheme.basic(e);case"bearer":return he.V38.AuthScheme.bearer(e);case"header":return he.V38.AuthScheme.header(e);case"oauth":return he.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:Ko(e)}}var M_P={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.20.0",[J.GO_MODEL]:"0.20.0",[J.GO_SDK]:"0.20.0",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var A_P={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,i])=>[r,{name:i.name,discriminantValue:i.discriminantValue,type:i.type,statusCode:i.statusCode,docs:i.docs}]))})};var q_P={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:"0.8.0-rc0",[J.JAVA_SDK]:"0.9.0-rc0",[J.JAVA_SPRING]:"0.8.0-rc0",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>R9F(r))}})};function R9F(e){switch(e.type){case"basic":return he.V41.AuthScheme.basic(e);case"bearer":return he.V41.AuthScheme.bearer(e);case"header":return he.V41.AuthScheme.header(e);case"oauth":return he.V41.AuthScheme.oauth(N9F(e));default:Ko(e)}}function N9F(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:he.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:Ko(e.configuration.type)}}var T_P={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.17.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.13.0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?.body}))}]))})};var B_P={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.map(a=>F9F({example:a})).filter(u0)}))}]))})};function F9F({example:e}){return e._visit({userProvided:t=>he.V43.HttpEndpointExample.userProvided(C_P({example:t})),generated:t=>he.V43.HttpEndpointExample.generated(C_P({example:t})),_other:()=>{}})}function C_P({example:e}){return{...e,response:L9F({example:e.response})}}function L9F({example:e}){switch(e.type){case"ok":return U9F({example:e.value});case"error":return he.V43.ExampleResponse.error(e);default:Ko(e)}}function U9F({example:e}){switch(e.type){case"body":return he.V43.ExampleResponse.ok({body:e.value});case"sse":return he.V43.ExampleResponse.ok({body:void 0});case"stream":return he.V43.ExampleResponse.ok({body:void 0});default:Ko(e)}}var x_P={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V45.types.Type._visit(r.shape,{union:i=>he.V44.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Cq(n.valueType)})),types:i.types.map(n=>k9F(n))}),enum:he.V44.types.Type.enum,object:i=>he.V44.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Cq(n.valueType)}))}),alias:i=>he.V44.types.Type.alias({aliasOf:Cq(i.aliasOf),resolvedType:tLF(i.resolvedType)}),undiscriminatedUnion:i=>he.V44.types.Type.undiscriminatedUnion(rLF(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:J9F(e.auth),headers:e.headers.map(r=>PLn(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>PLn(r)),types:t,services:od(e.services,r=>iLF(r)),errors:od(e.errors,r=>gLF(r)),webhookGroups:od(e.webhookGroups,r=>$9F(r)),websocketChannels:od(e.websocketChannels,r=>V9F(r)),pathParameters:e.pathParameters.map(r=>z6a(r)),variables:e.variables.map(r=>nLF(r))}}};function V9F(e){return{...e,headers:e.headers.map(t=>PLn(t)),queryParameters:e.queryParameters.map(t=>R6a(t)),pathParameters:e.pathParameters.map(t=>z6a(t)),messages:e.messages.map(t=>W9F(t))}}function W9F(e){return{...e,body:H9F(e.body)}}function H9F(e){switch(e.type){case"inlinedBody":return he.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Cq(t.valueType)}))});case"reference":return he.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:Cq(e.bodyType)})}}function $9F(e){return e.map(t=>G9F(t))}function G9F(e){return{...e,headers:e.headers.map(t=>PLn(t)),payload:Q9F(e.payload)}}function Q9F(e){switch(e.type){case"reference":return he.V44.webhooks.WebhookPayload.reference({...e,payloadType:Cq(e.payloadType)});case"inlinedPayload":return he.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Cq(t.valueType)}))})}}function J9F(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V44.auth.AuthScheme.basic(t);case"bearer":return he.V44.auth.AuthScheme.bearer(t);case"header":return he.V44.auth.AuthScheme.header(K9F(t));case"oauth":return he.V44.auth.AuthScheme.oauth(Y9F(t))}})}}function K9F(e){return{...e,valueType:Cq(e.valueType)}}function Y9F(e){return{...e,configuration:he.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:X9F(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Z9F(e.configuration.refreshEndpoint):void 0})}}function X9F(e){return{...e,requestProperties:{clientId:gHu(e.requestProperties.clientId),clientSecret:gHu(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?gHu(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Mei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Mei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Mei(e.responseProperties.refreshToken):void 0}}}function Z9F(e){return{...e,requestProperties:{refreshToken:gHu(e.requestProperties.refreshToken)},responseProperties:{accessToken:Mei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Mei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Mei(e.responseProperties.refreshToken):void 0}}}function PLn(e){return{...e,valueType:Cq(e.valueType)}}function Cq(e){return he.V45.types.TypeReference._visit(e,{container:t=>he.V44.types.TypeReference.container(I_P(t)),primitive:t=>t.v1==="BIG_INTEGER"?he.V44.types.TypeReference.primitive(he.V44.types.PrimitiveType.String):he.V44.types.TypeReference.primitive(t.v1),named:he.V44.types.TypeReference.named,unknown:he.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function I_P(e){return he.V45.types.ContainerType._visit(e,{list:t=>he.V44.types.ContainerType.list(Cq(t)),optional:t=>he.V44.types.ContainerType.optional(Cq(t)),set:t=>he.V44.types.ContainerType.set(Cq(t)),map:({keyType:t,valueType:r})=>he.V44.types.ContainerType.map({keyType:Cq(t),valueType:Cq(r)}),literal:he.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function k9F(e){return{...e,shape:eLF(e.shape)}}function eLF(e){return he.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:Cq(t.type)}),noProperties:he.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function tLF(e){return he.V45.types.ResolvedTypeReference._visit(e,{container:t=>he.V44.types.ResolvedTypeReference.container(I_P(t)),named:he.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?he.V44.types.ResolvedTypeReference.primitive(he.V44.types.PrimitiveType.String):he.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:he.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function rLF(e){return{members:e.members.map(t=>({...t,type:Cq(t.type)}))}}function iLF(e){return{...e,pathParameters:e.pathParameters.map(t=>z6a(t)),headers:e.headers.map(t=>PLn(t)),endpoints:e.endpoints.map(t=>aLF(t))}}function z6a(e){return{...e,valueType:Cq(e.valueType)}}function nLF(e){return{...e,type:Cq(e.type)}}function aLF(e){return{...e,pagination:e.pagination!=null?lLF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>z6a(t)),pathParameters:e.pathParameters.map(t=>z6a(t)),sdkRequest:e.sdkRequest!=null?_LF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?vLF(e.requestBody):void 0,response:e.response!=null?oLF(e.response):void 0,headers:e.headers.map(t=>PLn(t)),queryParameters:e.queryParameters.map(t=>R6a(t))}}function oLF(e){return{...e,body:e.body!=null?uLF(e.body):void 0}}function uLF(e){switch(e.type){case"json":return he.V44.http.HttpResponseBody.json(sLF(e.value));case"fileDownload":return he.V44.http.HttpResponseBody.fileDownload(e);case"text":return he.V44.http.HttpResponseBody.text(e);case"streaming":return he.V44.http.HttpResponseBody.streaming(cLF(e.value))}}function sLF(e){switch(e.type){case"response":return he.V44.http.JsonResponse.response({...e,responseBodyType:Cq(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Cq(e.responseBodyType),responseProperty:e.responseProperty!=null?$lf(e.responseProperty):void 0})}}function cLF(e){switch(e.type){case"json":return he.V44.http.StreamingResponse.json({...e,payload:Cq(e.payload)});case"text":return he.V44.http.StreamingResponse.text(e);case"sse":return he.V44.http.StreamingResponse.sse({...e,payload:Cq(e.payload)})}}function lLF(e){switch(e.type){case"cursor":return he.V44.http.Pagination.cursor(fLF(e));case"offset":return he.V44.http.Pagination.offset(dLF(e))}}function fLF(e){return{...e,page:R6a(e.page),next:Mei(e.next),results:Mei(e.results)}}function dLF(e){return{...e,page:R6a(e.page),results:Mei(e.results)}}function gHu(e){return{...e,property:pLF(e.property)}}function pLF(e){switch(e.type){case"query":return he.V44.RequestPropertyValue.query(R6a(e));case"body":return he.V44.RequestPropertyValue.body($lf(e))}}function Mei(e){return{...e,property:$lf(e.property)}}function $lf(e){return{...e,valueType:Cq(e.valueType)}}function R6a(e){return{...e,valueType:Cq(e.valueType)}}function _LF(e){return{...e,shape:hLF(e.shape)}}function hLF(e){return he.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V44.http.SdkRequestShape.justRequestBody(yLF(t)),wrapper:he.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function yLF(e){switch(e.type){case"bytes":return he.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Cq(e.requestBodyType)})}}function vLF(e){return he.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Cq(r.valueType)}))}),reference:t=>he.V44.http.HttpRequestBody.reference({...t,requestBodyType:Cq(t.requestBodyType)}),fileUpload:t=>he.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Cq(r.valueType)});case"file":return he.V44.http.FileUploadRequestProperty.file(bLF(r.value))}})}),bytes:t=>he.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function bLF(e){switch(e.type){case"file":return he.V44.http.FileProperty.file(e);case"fileArray":return he.V44.http.FileProperty.fileArray(e)}}function gLF(e){return{...e,type:e.type!=null?Cq(e.type):void 0}}var R_P={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.21.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.16.0",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.9.0",[J.JAVA_SDK]:"0.10.0",[J.JAVA_SPRING]:"0.9.0",[J.PYTHON_FASTAPI]:"0.10.1",[J.PYTHON_PYDANTIC]:"0.9.1",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"2.9.9",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:OLF(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({...i,examples:mLF(i.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:PLF(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(i=>({...i,shape:r3(i.shape)}))}]))})};function r3(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.list(r.map(i=>r3(i)))),set:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.set(r.map(i=>r3(i)))),map:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.map(r.map(i=>({key:r3(i.key),value:r3(i.value)})))),optional:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.optional(r!=null?r3(r):void 0)),literal:r=>he.V45.ExampleTypeReferenceShape.primitive(r._visit({string:i=>he.V45.ExamplePrimitive.string(i),integer:i=>he.V45.ExamplePrimitive.integer(i),double:i=>he.V45.ExamplePrimitive.double(i),long:i=>he.V45.ExamplePrimitive.long(i),boolean:i=>he.V45.ExamplePrimitive.boolean(i),datetime:i=>he.V45.ExamplePrimitive.datetime(i),date:i=>he.V45.ExamplePrimitive.date(i),uuid:i=>he.V45.ExamplePrimitive.uuid(i),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.named({...t,shape:N_P(t.shape)})}),primitive:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>he.V45.ExamplePrimitive.string(r),integer:r=>he.V45.ExamplePrimitive.integer(r),double:r=>he.V45.ExamplePrimitive.double(r),long:r=>he.V45.ExamplePrimitive.long(r),boolean:r=>he.V45.ExamplePrimitive.boolean(r),datetime:r=>he.V45.ExamplePrimitive.datetime(r),date:r=>he.V45.ExamplePrimitive.date(r),uuid:r=>he.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function z_P(e){return{...e,properties:e.properties.map(t=>({...t,value:r3(t.value)}))}}function N_P(e){return e.type==="alias"?he.V45.ExampleTypeShape.alias({value:r3(e.value)}):e.type==="object"?he.V45.ExampleTypeShape.object(z_P(e)):e.type==="union"?he.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>he.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:z_P(t.object)}),singleProperty:t=>he.V45.ExampleSingleUnionTypeProperties.singleProperty(r3(t)),noProperties:()=>he.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?he.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:r3(e.singleUnionType)}):he.V45.ExampleTypeShape.enum(e)}function OLF(e){return e.map(t=>({...t,shape:N_P(t.shape)}))}function OHu(e){return e.map(t=>({...t,value:r3(t.value)}))}function Glf(e){return e.map(t=>({...t,value:r3(t.value)}))}function F_P(e){return e.map(t=>({...t,value:r3(t.value)}))}function mLF(e){return e.map(t=>{let r={...t,rootPathParameters:OHu(t.rootPathParameters),servicePathParameters:OHu(t.servicePathParameters),endpointPathParameters:OHu(t.endpointPathParameters),serviceHeaders:Glf(t.serviceHeaders),endpointHeaders:Glf(t.endpointHeaders),queryParameters:F_P(t.queryParameters),request:t.request?._visit({inlinedRequestBody:i=>he.V45.ExampleRequestBody.inlinedRequestBody({...i,properties:i.properties.map(n=>({...n,value:r3(n.value)}))}),reference:i=>he.V45.ExampleRequestBody.reference(r3(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}}),response:t.response._visit({ok:i=>he.V45.ExampleResponse.ok(i._visit({body:n=>he.V45.ExampleEndpointSuccessResponse.body(n!=null?r3(n):void 0),stream:n=>he.V45.ExampleEndpointSuccessResponse.stream(n.map(r3)),sse:n=>he.V45.ExampleEndpointSuccessResponse.sse(n.map(a=>({...a,data:r3(a.data)}))),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),error:i=>he.V45.ExampleResponse.error({...i,body:i.body!=null?r3(i.body):void 0}),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})};return t._visit({userProvided:()=>he.V45.HttpEndpointExample.userProvided(r),generated:()=>he.V45.HttpEndpointExample.generated(r),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})})}function PLF(e){return e.map(t=>({...t,pathParameters:OHu(t.pathParameters),headers:Glf(t.headers),queryParameters:F_P(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:i=>he.V45.ExampleWebSocketMessageBody.inlinedBody({...i,properties:i.properties.map(n=>({...n,value:r3(n.value)}))}),reference:i=>he.V45.ExampleWebSocketMessageBody.reference(r3(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})}))}))}var L_P={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let i=r.endpoints.map(n=>{let{autogeneratedExamples:a,userSpecifiedExamples:u,...l}=n;return{...l,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...n.userSpecifiedExamples.map(s=>{if(s.example!=null)return he.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(u0),...n.autogeneratedExamples.map(s=>he.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:i}]}))})};var U_P={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.29.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.17.0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.map(a=>({...a,pagination:a.pagination!=null?wLF(a.pagination):void 0}));return[r,{...i,endpoints:n}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:jLF(t)},services:t}}};function jLF(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function wLF(e){switch(e.type){case"cursor":{let t=SLF(e);return t!=null?he.V47.Pagination.cursor(t):void 0}case"offset":{let t=DLF(e);return t!=null?he.V47.Pagination.offset(t):void 0}default:Ko(e)}}function SLF(e){let t=V_P(e.page);if(t!=null)return{...e,page:t}}function DLF(e){if(e.step!=null)return;let t=V_P(e.page);if(t!=null)return{...e,page:t}}function V_P(e){switch(e.property.type){case"query":return e.property}}var W_P={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.11.0-rc0",[J.PYTHON_PYDANTIC]:"0.10.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"2.11.0-rc0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.flatMap(a=>{let u;return a.response?.body!=null&&(u=a.response.body?._visit({json:d=>he.V48.HttpResponseBody.json({...d}),fileDownload:d=>he.V48.HttpResponseBody.fileDownload({...d}),text:d=>he.V48.HttpResponseBody.text({...d}),streaming:d=>he.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),u==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:u}}});return[r,{...i,endpoints:n}]}));return{...e,services:t}}};var H_P={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.34.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.17.2",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:"0.0.0",[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V50.types.Type._visit(r.shape,{union:i=>he.V49.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Bq(n.valueType)})),types:i.types.map(n=>NLF(n))}),enum:he.V49.types.Type.enum,object:i=>he.V49.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Bq(n.valueType)}))}),alias:i=>he.V49.types.Type.alias({aliasOf:Bq(i.aliasOf),resolvedType:LLF(i.resolvedType)}),undiscriminatedUnion:i=>he.V49.types.Type.undiscriminatedUnion(ULF(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:BLF(e.auth),headers:e.headers.map(r=>jLn(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>jLn(r)),types:t,services:od(e.services,r=>VLF(r)),errors:od(e.errors,r=>nUF(r)),webhookGroups:od(e.webhookGroups,r=>qLF(r)),websocketChannels:od(e.websocketChannels,r=>ELF(r)),pathParameters:e.pathParameters.map(r=>N6a(r)),variables:e.variables.map(r=>WLF(r))}}};function ELF(e){return{...e,headers:e.headers.map(t=>jLn(t)),queryParameters:e.queryParameters.map(t=>Jlf(t)),pathParameters:e.pathParameters.map(t=>N6a(t)),messages:e.messages.map(t=>MLF(t))}}function MLF(e){return{...e,body:ALF(e.body)}}function ALF(e){switch(e.type){case"inlinedBody":return he.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Bq(t.valueType)}))});case"reference":return he.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:Bq(e.bodyType)})}}function qLF(e){return e.map(t=>TLF(t))}function TLF(e){return{...e,headers:e.headers.map(t=>jLn(t)),payload:CLF(e.payload)}}function CLF(e){switch(e.type){case"reference":return he.V49.webhooks.WebhookPayload.reference({...e,payloadType:Bq(e.payloadType)});case"inlinedPayload":return he.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Bq(t.valueType)}))})}}function BLF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V49.auth.AuthScheme.basic(t);case"bearer":return he.V49.auth.AuthScheme.bearer(t);case"header":return he.V49.auth.AuthScheme.header(xLF(t));case"oauth":return he.V49.auth.AuthScheme.oauth(ILF(t))}})}}function xLF(e){return{...e,valueType:Bq(e.valueType)}}function ILF(e){return{...e,configuration:he.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:zLF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?RLF(e.configuration.refreshEndpoint):void 0})}}function zLF(e){return{...e,requestProperties:{clientId:Pji(e.requestProperties.clientId),clientSecret:Pji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Pji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Aei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Aei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Aei(e.responseProperties.refreshToken):void 0}}}function RLF(e){return{...e,requestProperties:{refreshToken:Pji(e.requestProperties.refreshToken)},responseProperties:{accessToken:Aei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Aei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Aei(e.responseProperties.refreshToken):void 0}}}function jLn(e){return{...e,valueType:Bq(e.valueType)}}function Bq(e){return he.V50.types.TypeReference._visit(e,{container:t=>he.V49.types.TypeReference.container($_P(t)),primitive:t=>t.v2?.type==="integer"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.string(t.v2)}):he.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:he.V49.types.TypeReference.named,unknown:he.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function $_P(e){return he.V50.types.ContainerType._visit(e,{list:t=>he.V49.types.ContainerType.list(Bq(t)),optional:t=>he.V49.types.ContainerType.optional(Bq(t)),set:t=>he.V49.types.ContainerType.set(Bq(t)),map:({keyType:t,valueType:r})=>he.V49.types.ContainerType.map({keyType:Bq(t),valueType:Bq(r)}),literal:he.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function NLF(e){return{...e,shape:FLF(e.shape)}}function FLF(e){return he.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:Bq(t.type)}),noProperties:he.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function LLF(e){return he.V50.types.ResolvedTypeReference._visit(e,{container:t=>he.V49.types.ResolvedTypeReference.container($_P(t)),named:he.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.string(t.v2)}):he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:he.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ULF(e){return{members:e.members.map(t=>({...t,type:Bq(t.type)}))}}function VLF(e){return{...e,pathParameters:e.pathParameters.map(t=>N6a(t)),headers:e.headers.map(t=>jLn(t)),endpoints:e.endpoints.map(t=>HLF(t))}}function N6a(e){return{...e,valueType:Bq(e.valueType)}}function WLF(e){return{...e,type:Bq(e.type)}}function HLF(e){return{...e,pagination:e.pagination!=null?KLF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>N6a(t)),pathParameters:e.pathParameters.map(t=>N6a(t)),sdkRequest:e.sdkRequest!=null?kLF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?rUF(e.requestBody):void 0,response:e.response!=null?$LF(e.response):void 0,headers:e.headers.map(t=>jLn(t)),queryParameters:e.queryParameters.map(t=>Jlf(t))}}function $LF(e){return{...e,body:e.body!=null?GLF(e.body):void 0}}function GLF(e){switch(e.type){case"json":return he.V49.http.HttpResponseBody.json(G_P(e.value));case"fileDownload":return he.V49.http.HttpResponseBody.fileDownload(e);case"text":return he.V49.http.HttpResponseBody.text(e);case"streaming":return he.V49.http.HttpResponseBody.streaming(Q_P(e.value));case"streamParameter":return he.V49.http.HttpResponseBody.streamParameter(JLF(e))}}function G_P(e){switch(e.type){case"response":return he.V49.http.JsonResponse.response({...e,responseBodyType:Bq(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Bq(e.responseBodyType),responseProperty:e.responseProperty!=null?Qlf(e.responseProperty):void 0})}}function Q_P(e){switch(e.type){case"json":return he.V49.http.StreamingResponse.json({...e,payload:Bq(e.payload)});case"text":return he.V49.http.StreamingResponse.text(e);case"sse":return he.V49.http.StreamingResponse.sse({...e,payload:Bq(e.payload)})}}function QLF(e){switch(e.type){case"json":return he.V49.http.NonStreamHttpResponseBody.json(G_P(e.value));case"text":return he.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function JLF(e){return{nonStreamResponse:QLF(e.nonStreamResponse),streamResponse:Q_P(e.streamResponse)}}function KLF(e){switch(e.type){case"cursor":return he.V49.http.Pagination.cursor(YLF(e));case"offset":return he.V49.http.Pagination.offset(XLF(e))}}function YLF(e){return{...e,page:Pji(e.page),next:Aei(e.next),results:Aei(e.results)}}function XLF(e){return{...e,page:Pji(e.page),results:Aei(e.results),step:e.step!=null?Pji(e.step):void 0}}function Pji(e){return{...e,property:ZLF(e.property)}}function ZLF(e){switch(e.type){case"query":return he.V49.RequestPropertyValue.query(Jlf(e));case"body":return he.V49.RequestPropertyValue.body(Qlf(e))}}function Aei(e){return{...e,property:Qlf(e.property)}}function Qlf(e){return{...e,valueType:Bq(e.valueType)}}function Jlf(e){return{...e,valueType:Bq(e.valueType)}}function kLF(e){return{...e,streamParameter:e.streamParameter!=null?Pji(e.streamParameter):void 0,shape:eUF(e.shape)}}function eUF(e){return he.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V49.http.SdkRequestShape.justRequestBody(tUF(t)),wrapper:he.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function tUF(e){switch(e.type){case"bytes":return he.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Bq(e.requestBodyType)})}}function rUF(e){return he.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Bq(r.valueType)}))}),reference:t=>he.V49.http.HttpRequestBody.reference({...t,requestBodyType:Bq(t.requestBodyType)}),fileUpload:t=>he.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Bq(r.valueType)});case"file":return he.V49.http.FileUploadRequestProperty.file(iUF(r.value))}})}),bytes:t=>he.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function iUF(e){switch(e.type){case"file":return he.V49.http.FileProperty.file(e);case"fileArray":return he.V49.http.FileProperty.fileArray(e)}}function nUF(e){return{...e,type:e.type!=null?Bq(e.type):void 0}}var Y_P={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"0.1.2",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>{let i=r.autogeneratedExamples.map(a=>J_P(a)),n=r.userProvidedExamples.map(a=>J_P(a));return{...r,examples:[...i,...n]}});return{...e,types:t,services:od(e.services,r=>hUF(r)),errors:od(e.errors,r=>OUF(r)),webhookGroups:od(e.webhookGroups,r=>sUF(r)),websocketChannels:od(e.websocketChannels,r=>aUF(r))}}};function aUF(e){return{...e,examples:e.examples.map(t=>oUF(t))}}function oUF(e){return{...e,pathParameters:e.pathParameters.map(t=>mHu(t)),headers:e.headers.map(t=>Klf(t)),queryParameters:e.queryParameters.map(t=>X_P(t)),messages:e.messages.map(t=>({...t,body:uUF(t.body)}))}}function X_P(e){return{...e,value:j4(e.value)}}function Klf(e){return{...e,value:j4(e.value)}}function mHu(e){return{...e,value:j4(e.value)}}function uUF(e){switch(e.type){case"inlinedBody":return he.V50.ExampleWebSocketMessageBody.inlinedBody(Z_P(e));case"reference":return he.V50.ExampleWebSocketMessageBody.reference(j4(e))}}function Z_P(e){return{...e,properties:e.properties.map(t=>({...t,value:j4(t.value)}))}}function sUF(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:j4(r.payload)}))}))}function J_P(e){return{...e,shape:k_P(e.shape)}}function Ylf(e){switch(e.type){case"primitive":return he.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return he.V50.ExampleTypeReferenceShape.container(cUF(e));case"unknown":return he.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:k_P(e.shape)})}}function cUF(e){switch(e.container.type){case"list":return he.V50.ExampleContainer.list(e.container.list.map(t=>j4(t)));case"set":return he.V50.ExampleContainer.set(e.container.set.map(t=>j4(t)));case"optional":return he.V50.ExampleContainer.optional(e.container.optional!=null?j4(e.container.optional):void 0);case"map":return he.V50.ExampleContainer.map(e.container.map.map(t=>({key:j4(t.key),value:j4(t.value)})));case"literal":return he.V50.ExampleContainer.literal(e.container.literal)}}function j4(e){return{...e,shape:Ylf(e.shape)}}function k_P(e){switch(e.type){case"object":return he.V50.ExampleTypeShape.object({properties:e.properties.map(t=>ehP(t))});case"alias":return he.V50.ExampleTypeShape.alias({value:{...j4(e.value)}});case"enum":return he.V50.ExampleTypeShape.enum(e);case"union":return he.V50.ExampleTypeShape.union(fUF(e));case"undiscriminatedUnion":return he.V50.ExampleTypeShape.undiscriminatedUnion(lUF(e))}}function lUF(e){return{...e,singleUnionType:j4(e.singleUnionType)}}function fUF(e){return{...e,singleUnionType:dUF(e.singleUnionType)}}function dUF(e){return{...e,shape:pUF(e.shape)}}function pUF(e){switch(e.type){case"samePropertiesAsObject":return he.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:_UF(e.object)});case"singleProperty":return he.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ylf(e.shape)});case"noProperties":return he.V50.ExampleSingleUnionTypeProperties.noProperties()}}function _UF(e){return{...e,properties:e.properties.map(t=>ehP(t))}}function ehP(e){return{...e,value:{...e.value,shape:Ylf(e.value.shape)}}}function hUF(e){return{...e,endpoints:e.endpoints.map(t=>yUF(t))}}function yUF(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:K_P(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?K_P(t.example):void 0}))}}function K_P(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>mHu(t)),servicePathParameters:e.servicePathParameters.map(t=>mHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>mHu(t)),serviceHeaders:e.serviceHeaders.map(t=>Klf(t)),endpointHeaders:e.endpointHeaders.map(t=>Klf(t)),queryParameters:e.queryParameters.map(t=>X_P(t)),request:e.request!=null?gUF(e.request):void 0,response:vUF(e.response)}}function vUF(e){switch(e.type){case"error":return he.V50.ExampleResponse.error({...e,body:e.body!=null?j4(e.body):void 0});case"ok":return he.V50.ExampleResponse.ok(bUF(e))}}function bUF(e){switch(e.value.type){case"body":return he.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?j4(e.value.value):void 0);case"stream":return he.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>j4(t)));case"sse":return he.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:j4(t.data)})))}}function gUF(e){switch(e.type){case"inlinedRequestBody":return he.V50.ExampleRequestBody.inlinedRequestBody(Z_P(e));case"reference":return he.V50.ExampleRequestBody.reference(j4(e))}}function OUF(e){return{...e,examples:e.examples.map(t=>({...t,shape:j4(t.shape)}))}}var ihP={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?PUF(e.apiVersion):void 0,auth:qUF(e.auth),headers:e.headers.map(t=>Gen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Gen(t)),types:mUF(e.types),services:od(e.services,t=>UUF(t)),webhookGroups:od(e.webhookGroups,t=>DUF(t)),websocketChannels:od(e.websocketChannels,t=>jUF(t)),errors:od(e.errors,t=>iVF(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),variables:e.variables.map(t=>VUF(t))})};function mUF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>thP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>thP(r)),shape:he.V52.types.Type._visit(t.shape,{union:r=>he.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:_E(i.valueType)})),types:r.types.map(i=>RUF(i))}),enum:he.V51.types.Type.enum,object:r=>he.V51.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:_E(i.valueType)}))}),alias:r=>he.V51.types.Type.alias({aliasOf:_E(r.aliasOf),resolvedType:FUF(r.resolvedType)}),undiscriminatedUnion:r=>he.V51.types.Type.undiscriminatedUnion(LUF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function PUF(e){return he.V51.ApiVersionScheme.header({...e,header:Gen(e.header)})}function jUF(e){return{...e,headers:e.headers.map(t=>Gen(t)),queryParameters:e.queryParameters.map(t=>klf(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),messages:e.messages.map(t=>wUF(t)),examples:e.examples.map(t=>nVF(t))}}function wUF(e){return{...e,body:SUF(e.body)}}function SUF(e){switch(e.type){case"inlinedBody":return he.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:_E(t.valueType)}))});case"reference":return he.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:_E(e.bodyType)})}}function DUF(e){return e.map(t=>EUF(t))}function EUF(e){return{...e,headers:e.headers.map(t=>Gen(t)),payload:MUF(e.payload),examples:e.examples!=null?e.examples.map(t=>AUF(t)):void 0}}function MUF(e){switch(e.type){case"reference":return he.V51.webhooks.WebhookPayload.reference({...e,payloadType:_E(e.payloadType)});case"inlinedPayload":return he.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:_E(t.valueType)}))})}}function AUF(e){return{...e,payload:w4(e.payload)}}function qUF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V51.auth.AuthScheme.basic(t);case"bearer":return he.V51.auth.AuthScheme.bearer(t);case"header":return he.V51.auth.AuthScheme.header(TUF(t));case"oauth":return he.V51.auth.AuthScheme.oauth(CUF(t))}})}}function TUF(e){return{...e,valueType:_E(e.valueType)}}function CUF(e){return{...e,configuration:he.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:BUF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?xUF(e.configuration.refreshEndpoint):void 0})}}function BUF(e){return{...e,requestProperties:{clientId:jji(e.requestProperties.clientId),clientSecret:jji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?jji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:qei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?qei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?qei(e.responseProperties.refreshToken):void 0}}}function xUF(e){return{...e,requestProperties:{refreshToken:jji(e.requestProperties.refreshToken)},responseProperties:{accessToken:qei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?qei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?qei(e.responseProperties.refreshToken):void 0}}}function Gen(e){return{...e,valueType:_E(e.valueType)}}function _E(e){return he.V52.types.TypeReference._visit(e,{container:t=>he.V51.types.TypeReference.container(ahP(t)),primitive:t=>he.V51.types.TypeReference.primitive(nhP(t)),named:he.V51.types.TypeReference.named,unknown:he.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function nhP(e){return{v1:IUF(e.v1),v2:e.v2!=null?zUF(e.v2):void 0}}function IUF(e){switch(e){case"UINT":return he.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return he.V51.types.PrimitiveTypeV1.Long}return e}function zUF(e){switch(e.type){case"integer":return he.V51.types.PrimitiveTypeV2.integer(e);case"double":return he.V51.types.PrimitiveTypeV2.double(e);case"string":return he.V51.types.PrimitiveTypeV2.string(e);case"boolean":return he.V51.types.PrimitiveTypeV2.boolean(e);case"long":return he.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return he.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:Ko(e)}}function ahP(e){return he.V52.types.ContainerType._visit(e,{list:t=>he.V51.types.ContainerType.list(_E(t)),optional:t=>he.V51.types.ContainerType.optional(_E(t)),set:t=>he.V51.types.ContainerType.set(_E(t)),map:({keyType:t,valueType:r})=>he.V51.types.ContainerType.map({keyType:_E(t),valueType:_E(r)}),literal:he.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function RUF(e){return{...e,shape:NUF(e.shape)}}function NUF(e){return he.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:_E(t.type)}),noProperties:he.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function FUF(e){return he.V52.types.ResolvedTypeReference._visit(e,{container:t=>he.V51.types.ResolvedTypeReference.container(ahP(t)),named:he.V51.types.ResolvedTypeReference.named,primitive:t=>he.V51.types.ResolvedTypeReference.primitive(nhP(t)),unknown:he.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function LUF(e){return{members:e.members.map(t=>({...t,type:_E(t.type)}))}}function UUF(e){return{...e,pathParameters:e.pathParameters.map(t=>F6a(t)),headers:e.headers.map(t=>Gen(t)),endpoints:e.endpoints.map(t=>WUF(t))}}function F6a(e){return{...e,valueType:_E(e.valueType)}}function VUF(e){return{...e,type:_E(e.type)}}function WUF(e){return{...e,pagination:e.pagination!=null?JUF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>F6a(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),sdkRequest:e.sdkRequest!=null?ZUF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?tVF(e.requestBody):void 0,response:e.response!=null?HUF(e.response):void 0,headers:e.headers.map(t=>Gen(t)),queryParameters:e.queryParameters.map(t=>klf(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:rhP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?rhP(t.example):void 0}))}}function HUF(e){return{...e,body:e.body!=null?$UF(e.body):void 0}}function $UF(e){switch(e.type){case"json":return he.V51.http.HttpResponseBody.json(ohP(e.value));case"fileDownload":return he.V51.http.HttpResponseBody.fileDownload(e);case"text":return he.V51.http.HttpResponseBody.text(e);case"streaming":return he.V51.http.HttpResponseBody.streaming(uhP(e.value));case"streamParameter":return he.V51.http.HttpResponseBody.streamParameter(QUF(e))}}function ohP(e){switch(e.type){case"response":return he.V51.http.JsonResponse.response({...e,responseBodyType:_E(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:_E(e.responseBodyType),responseProperty:e.responseProperty!=null?Zlf(e.responseProperty):void 0})}}function uhP(e){switch(e.type){case"json":return he.V51.http.StreamingResponse.json({...e,payload:_E(e.payload)});case"text":return he.V51.http.StreamingResponse.text(e);case"sse":return he.V51.http.StreamingResponse.sse({...e,payload:_E(e.payload)})}}function GUF(e){switch(e.type){case"json":return he.V51.http.NonStreamHttpResponseBody.json(ohP(e.value));case"text":return he.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function QUF(e){return{nonStreamResponse:GUF(e.nonStreamResponse),streamResponse:uhP(e.streamResponse)}}function JUF(e){switch(e.type){case"cursor":return he.V51.http.Pagination.cursor(KUF(e));case"offset":return he.V51.http.Pagination.offset(YUF(e))}}function KUF(e){return{...e,page:jji(e.page),next:qei(e.next),results:qei(e.results)}}function YUF(e){return{...e,page:jji(e.page),results:qei(e.results),step:e.step!=null?jji(e.step):void 0}}function jji(e){return{...e,property:XUF(e.property)}}function XUF(e){switch(e.type){case"query":return he.V51.RequestPropertyValue.query(klf(e));case"body":return he.V51.RequestPropertyValue.body(Zlf(e))}}function qei(e){return{...e,property:Zlf(e.property)}}function Zlf(e){return{...e,valueType:_E(e.valueType)}}function klf(e){return{...e,valueType:_E(e.valueType)}}function ZUF(e){return{...e,streamParameter:e.streamParameter!=null?jji(e.streamParameter):void 0,shape:kUF(e.shape)}}function kUF(e){return he.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V51.http.SdkRequestShape.justRequestBody(eVF(t)),wrapper:he.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function eVF(e){switch(e.type){case"bytes":return he.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:_E(e.requestBodyType)})}}function tVF(e){return he.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:_E(r.valueType)}))}),reference:t=>he.V51.http.HttpRequestBody.reference({...t,requestBodyType:_E(t.requestBodyType)}),fileUpload:t=>he.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:_E(r.valueType)});case"file":return he.V51.http.FileUploadRequestProperty.file(rVF(r.value))}})}),bytes:t=>he.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function rVF(e){switch(e.type){case"file":return he.V51.http.FileProperty.file(e);case"fileArray":return he.V51.http.FileProperty.fileArray(e)}}function iVF(e){return{...e,type:e.type!=null?_E(e.type):void 0,examples:e.examples.map(t=>({...t,shape:w4(t.shape)}))}}function nVF(e){return{...e,pathParameters:e.pathParameters.map(t=>PHu(t)),headers:e.headers.map(t=>Xlf(t)),queryParameters:e.queryParameters.map(t=>shP(t)),messages:e.messages.map(t=>({...t,body:aVF(t.body)}))}}function shP(e){return{...e,value:w4(e.value)}}function Xlf(e){return{...e,value:w4(e.value)}}function PHu(e){return{...e,value:w4(e.value)}}function aVF(e){switch(e.type){case"inlinedBody":return he.V51.ExampleWebSocketMessageBody.inlinedBody(chP(e));case"reference":return he.V51.ExampleWebSocketMessageBody.reference(w4(e))}}function chP(e){return{...e,properties:e.properties.map(t=>({...t,value:w4(t.value)}))}}function thP(e){return{...e,shape:fhP(e.shape)}}function eff(e){switch(e.type){case"primitive":return he.V51.ExampleTypeReferenceShape.primitive(oVF(e));case"container":return he.V51.ExampleTypeReferenceShape.container(uVF(e));case"unknown":return he.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:fhP(e.shape)})}}function lhP(e){switch(e.type){case"integer":return he.V51.ExamplePrimitive.integer(e.integer);case"uint":return he.V51.ExamplePrimitive.integer(e.uint);case"uint64":return he.V51.ExamplePrimitive.integer(e.uint64);case"double":return he.V51.ExamplePrimitive.double(e.double);case"long":return he.V51.ExamplePrimitive.long(e.long);case"boolean":return he.V51.ExamplePrimitive.boolean(e.boolean);case"string":return he.V51.ExamplePrimitive.string(e.string);case"date":return he.V51.ExamplePrimitive.date(e.date);case"datetime":return he.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return he.V51.ExamplePrimitive.uuid(e.uuid)}}function oVF(e){return lhP(e.primitive)}function uVF(e){switch(e.container.type){case"list":return he.V51.ExampleContainer.list({list:e.container.list.map(t=>w4(t)),itemType:_E(e.container.itemType)});case"set":return he.V51.ExampleContainer.set({set:e.container.set.map(t=>w4(t)),itemType:_E(e.container.itemType)});case"optional":return he.V51.ExampleContainer.optional({optional:e.container.optional!=null?w4(e.container.optional):void 0,valueType:_E(e.container.valueType)});case"map":return he.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:w4(t.key),value:w4(t.value)})),keyType:_E(e.container.keyType),valueType:_E(e.container.valueType)});case"literal":return he.V51.ExampleContainer.literal({literal:lhP(e.container.literal)})}}function w4(e){return{...e,shape:eff(e.shape)}}function fhP(e){switch(e.type){case"object":return he.V51.ExampleTypeShape.object({properties:e.properties.map(t=>dhP(t))});case"alias":return he.V51.ExampleTypeShape.alias({value:{...w4(e.value)}});case"enum":return he.V51.ExampleTypeShape.enum(e);case"union":return he.V51.ExampleTypeShape.union(cVF(e));case"undiscriminatedUnion":return he.V51.ExampleTypeShape.undiscriminatedUnion(sVF(e))}}function sVF(e){return{...e,singleUnionType:w4(e.singleUnionType)}}function cVF(e){return{...e,singleUnionType:lVF(e.singleUnionType)}}function lVF(e){return{...e,shape:fVF(e.shape)}}function fVF(e){switch(e.type){case"samePropertiesAsObject":return he.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:dVF(e.object)});case"singleProperty":return he.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:eff(e.shape)});case"noProperties":return he.V51.ExampleSingleUnionTypeProperties.noProperties()}}function dVF(e){return{...e,properties:e.properties.map(t=>dhP(t))}}function dhP(e){return{...e,value:{...e.value,shape:eff(e.value.shape)}}}function rhP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>PHu(t)),servicePathParameters:e.servicePathParameters.map(t=>PHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>PHu(t)),serviceHeaders:e.serviceHeaders.map(t=>Xlf(t)),endpointHeaders:e.endpointHeaders.map(t=>Xlf(t)),queryParameters:e.queryParameters.map(t=>shP(t)),request:e.request!=null?hVF(e.request):void 0,response:pVF(e.response)}}function pVF(e){switch(e.type){case"error":return he.V51.ExampleResponse.error({...e,body:e.body!=null?w4(e.body):void 0});case"ok":return he.V51.ExampleResponse.ok(_VF(e))}}function _VF(e){switch(e.value.type){case"body":return he.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?w4(e.value.value):void 0);case"stream":return he.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>w4(t)));case"sse":return he.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:w4(t.data)})))}}function hVF(e){switch(e.type){case"inlinedRequestBody":return he.V51.ExampleRequestBody.inlinedRequestBody(chP(e));case"reference":return he.V51.ExampleRequestBody.reference(w4(e))}}var hhP={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[J.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[J.TYPESCRIPT]:"0.38.0-rc0",[J.TYPESCRIPT_SDK]:"0.38.0-rc0",[J.TYPESCRIPT_EXPRESS]:"0.17.3",[J.JAVA]:$e,[J.JAVA_MODEL]:"1.3.0",[J.JAVA_SDK]:"2.5.0",[J.JAVA_SPRING]:"1.3.0",[J.PYTHON_FASTAPI]:"1.1.0-rc0",[J.PYTHON_PYDANTIC]:"1.1.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:"0.1.0",[J.STOPLIGHT]:$e,[J.POSTMAN]:"0.2.0",[J.PYTHON_SDK]:"3.3.0-rc0",[J.GO_FIBER]:"0.23.5",[J.GO_MODEL]:"0.23.5",[J.GO_SDK]:"0.28.3",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"0.5.0",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:"0.1.0"},jsonifyEarlierVersion:e=>W_.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?vVF(e.apiVersion):void 0,auth:SVF(e.auth),headers:e.headers.map(t=>Qen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Qen(t)),types:yVF(e.types),services:od(e.services,t=>zVF(t)),webhookGroups:od(e.webhookGroups,t=>mVF(t)),websocketChannels:od(e.websocketChannels,t=>bVF(t)),errors:od(e.errors,t=>ZVF(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),variables:e.variables.map(t=>RVF(t))})};function yVF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>phP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>phP(r)),shape:he.V53.types.Type._visit(t.shape,{union:r=>he.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:hE(i.valueType)})),types:r.types.map(i=>CVF(i))}),enum:he.V52.types.Type.enum,object:r=>he.V52.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:hE(i.valueType)}))}),alias:r=>he.V52.types.Type.alias({aliasOf:hE(r.aliasOf),resolvedType:xVF(r.resolvedType)}),undiscriminatedUnion:r=>he.V52.types.Type.undiscriminatedUnion(IVF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function vVF(e){return he.V52.ApiVersionScheme.header({...e,header:Qen(e.header)})}function bVF(e){return{...e,headers:e.headers.map(t=>Qen(t)),queryParameters:e.queryParameters.map(t=>iff(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),messages:e.messages.map(t=>gVF(t)),examples:e.examples.map(t=>kVF(t))}}function gVF(e){return{...e,body:OVF(e.body)}}function OVF(e){switch(e.type){case"inlinedBody":return he.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:hE(t.valueType)}))});case"reference":return he.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:hE(e.bodyType)})}}function mVF(e){return e.map(t=>PVF(t))}function PVF(e){return{...e,headers:e.headers.map(t=>Qen(t)),payload:jVF(e.payload),examples:e.examples!=null?e.examples.map(t=>wVF(t)):void 0}}function jVF(e){switch(e.type){case"reference":return he.V52.webhooks.WebhookPayload.reference({...e,payloadType:hE(e.payloadType)});case"inlinedPayload":return he.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:hE(t.valueType)}))})}}function wVF(e){return{...e,payload:S4(e.payload)}}function SVF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V52.auth.AuthScheme.basic(t);case"bearer":return he.V52.auth.AuthScheme.bearer(t);case"header":return he.V52.auth.AuthScheme.header(DVF(t));case"oauth":return he.V52.auth.AuthScheme.oauth(EVF(t))}})}}function DVF(e){return{...e,valueType:hE(e.valueType)}}function EVF(e){return{...e,configuration:he.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:MVF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?AVF(e.configuration.refreshEndpoint):void 0})}}function MVF(e){return{...e,requestProperties:{clientId:wji(e.requestProperties.clientId),clientSecret:wji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?wji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Tei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Tei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Tei(e.responseProperties.refreshToken):void 0}}}function AVF(e){return{...e,requestProperties:{refreshToken:wji(e.requestProperties.refreshToken)},responseProperties:{accessToken:Tei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Tei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Tei(e.responseProperties.refreshToken):void 0}}}function Qen(e){return{...e,valueType:hE(e.valueType)}}function hE(e){return he.V53.types.TypeReference._visit(e,{container:t=>he.V52.types.TypeReference.container(vhP(t)),primitive:t=>he.V52.types.TypeReference.primitive(yhP(t)),named:he.V52.types.TypeReference.named,unknown:he.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function yhP(e){return{v1:qVF(e.v1),v2:e.v2!=null?TVF(e.v2):void 0}}function qVF(e){switch(e){case"FLOAT":return he.V52.types.PrimitiveTypeV1.Double}return e}function TVF(e){switch(e.type){case"integer":return he.V52.types.PrimitiveTypeV2.integer(e);case"double":return he.V52.types.PrimitiveTypeV2.double(e);case"string":return he.V52.types.PrimitiveTypeV2.string(e);case"boolean":return he.V52.types.PrimitiveTypeV2.boolean(e);case"long":return he.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return he.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return he.V52.types.PrimitiveTypeV2.uint();case"uint64":return he.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:Ko(e)}}function vhP(e){return he.V53.types.ContainerType._visit(e,{list:t=>he.V52.types.ContainerType.list(hE(t)),optional:t=>he.V52.types.ContainerType.optional(hE(t)),set:t=>he.V52.types.ContainerType.set(hE(t)),map:({keyType:t,valueType:r})=>he.V52.types.ContainerType.map({keyType:hE(t),valueType:hE(r)}),literal:he.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function CVF(e){return{...e,shape:BVF(e.shape)}}function BVF(e){return he.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:hE(t.type)}),noProperties:he.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function xVF(e){return he.V53.types.ResolvedTypeReference._visit(e,{container:t=>he.V52.types.ResolvedTypeReference.container(vhP(t)),named:he.V52.types.ResolvedTypeReference.named,primitive:t=>he.V52.types.ResolvedTypeReference.primitive(yhP(t)),unknown:he.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function IVF(e){return{members:e.members.map(t=>({...t,type:hE(t.type)}))}}function zVF(e){return{...e,pathParameters:e.pathParameters.map(t=>L6a(t)),headers:e.headers.map(t=>Qen(t)),endpoints:e.endpoints.map(t=>NVF(t))}}function L6a(e){return{...e,valueType:hE(e.valueType)}}function RVF(e){return{...e,type:hE(e.type)}}function NVF(e){return{...e,pagination:e.pagination!=null?WVF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>L6a(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),sdkRequest:e.sdkRequest!=null?QVF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?YVF(e.requestBody):void 0,response:e.response!=null?FVF(e.response):void 0,headers:e.headers.map(t=>Qen(t)),queryParameters:e.queryParameters.map(t=>iff(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:_hP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?_hP(t.example):void 0}))}}function FVF(e){return{...e,body:e.body!=null?LVF(e.body):void 0}}function LVF(e){switch(e.type){case"json":return he.V52.http.HttpResponseBody.json(bhP(e.value));case"fileDownload":return he.V52.http.HttpResponseBody.fileDownload(e);case"text":return he.V52.http.HttpResponseBody.text(e);case"streaming":return he.V52.http.HttpResponseBody.streaming(ghP(e.value));case"streamParameter":return he.V52.http.HttpResponseBody.streamParameter(VVF(e))}}function bhP(e){switch(e.type){case"response":return he.V52.http.JsonResponse.response({...e,responseBodyType:hE(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:hE(e.responseBodyType),responseProperty:e.responseProperty!=null?rff(e.responseProperty):void 0})}}function ghP(e){switch(e.type){case"json":return he.V52.http.StreamingResponse.json({...e,payload:hE(e.payload)});case"text":return he.V52.http.StreamingResponse.text(e);case"sse":return he.V52.http.StreamingResponse.sse({...e,payload:hE(e.payload)})}}function UVF(e){switch(e.type){case"json":return he.V52.http.NonStreamHttpResponseBody.json(bhP(e.value));case"text":return he.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function VVF(e){return{nonStreamResponse:UVF(e.nonStreamResponse),streamResponse:ghP(e.streamResponse)}}function WVF(e){switch(e.type){case"cursor":return he.V52.http.Pagination.cursor(HVF(e));case"offset":return he.V52.http.Pagination.offset($VF(e))}}function HVF(e){return{...e,page:wji(e.page),next:Tei(e.next),results:Tei(e.results)}}function $VF(e){return{...e,page:wji(e.page),results:Tei(e.results),step:e.step!=null?wji(e.step):void 0}}function wji(e){return{...e,property:GVF(e.property)}}function GVF(e){switch(e.type){case"query":return he.V52.RequestPropertyValue.query(iff(e));case"body":return he.V52.RequestPropertyValue.body(rff(e))}}function Tei(e){return{...e,property:rff(e.property)}}function rff(e){return{...e,valueType:hE(e.valueType)}}function iff(e){return{...e,valueType:hE(e.valueType)}}function QVF(e){return{...e,streamParameter:e.streamParameter!=null?wji(e.streamParameter):void 0,shape:JVF(e.shape)}}function JVF(e){return he.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V52.http.SdkRequestShape.justRequestBody(KVF(t)),wrapper:he.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function KVF(e){switch(e.type){case"bytes":return he.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:hE(e.requestBodyType)})}}function YVF(e){return he.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:hE(r.valueType)}))}),reference:t=>he.V52.http.HttpRequestBody.reference({...t,requestBodyType:hE(t.requestBodyType)}),fileUpload:t=>he.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:hE(r.valueType)});case"file":return he.V52.http.FileUploadRequestProperty.file(XVF(r.value))}})}),bytes:t=>he.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function XVF(e){switch(e.type){case"file":return he.V52.http.FileProperty.file(e);case"fileArray":return he.V52.http.FileProperty.fileArray(e)}}function ZVF(e){return{...e,type:e.type!=null?hE(e.type):void 0,examples:e.examples.map(t=>({...t,shape:S4(t.shape)}))}}function kVF(e){return{...e,pathParameters:e.pathParameters.map(t=>jHu(t)),headers:e.headers.map(t=>tff(t)),queryParameters:e.queryParameters.map(t=>OhP(t)),messages:e.messages.map(t=>({...t,body:eWF(t.body)}))}}function OhP(e){return{...e,value:S4(e.value)}}function tff(e){return{...e,value:S4(e.value)}}function jHu(e){return{...e,value:S4(e.value)}}function eWF(e){switch(e.type){case"inlinedBody":return he.V52.ExampleWebSocketMessageBody.inlinedBody(mhP(e));case"reference":return he.V52.ExampleWebSocketMessageBody.reference(S4(e))}}function mhP(e){return{...e,properties:e.properties.map(t=>({...t,value:S4(t.value)}))}}function phP(e){return{...e,shape:jhP(e.shape)}}function nff(e){switch(e.type){case"primitive":return he.V52.ExampleTypeReferenceShape.primitive(tWF(e));case"container":return he.V52.ExampleTypeReferenceShape.container(rWF(e));case"unknown":return he.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:jhP(e.shape)})}}function PhP(e){switch(e.type){case"integer":return he.V52.ExamplePrimitive.integer(e.integer);case"uint":return he.V52.ExamplePrimitive.integer(e.uint);case"uint64":return he.V52.ExamplePrimitive.integer(e.uint64);case"float":return he.V52.ExamplePrimitive.double(e.float);case"double":return he.V52.ExamplePrimitive.double(e.double);case"long":return he.V52.ExamplePrimitive.long(e.long);case"boolean":return he.V52.ExamplePrimitive.boolean(e.boolean);case"string":return he.V52.ExamplePrimitive.string(e.string);case"date":return he.V52.ExamplePrimitive.date(e.date);case"datetime":return he.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return he.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return he.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return he.V52.ExamplePrimitive.string({original:e.bigInteger})}}function tWF(e){return PhP(e.primitive)}function rWF(e){switch(e.container.type){case"list":return he.V52.ExampleContainer.list({list:e.container.list.map(t=>S4(t)),itemType:hE(e.container.itemType)});case"set":return he.V52.ExampleContainer.set({set:e.container.set.map(t=>S4(t)),itemType:hE(e.container.itemType)});case"optional":return he.V52.ExampleContainer.optional({optional:e.container.optional!=null?S4(e.container.optional):void 0,valueType:hE(e.container.valueType)});case"map":return he.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:S4(t.key),value:S4(t.value)})),keyType:hE(e.container.keyType),valueType:hE(e.container.valueType)});case"literal":return he.V52.ExampleContainer.literal({literal:PhP(e.container.literal)})}}function S4(e){return{...e,shape:nff(e.shape)}}function jhP(e){switch(e.type){case"object":return he.V52.ExampleTypeShape.object({properties:e.properties.map(t=>whP(t))});case"alias":return he.V52.ExampleTypeShape.alias({value:{...S4(e.value)}});case"enum":return he.V52.ExampleTypeShape.enum(e);case"union":return he.V52.ExampleTypeShape.union(nWF(e));case"undiscriminatedUnion":return he.V52.ExampleTypeShape.undiscriminatedUnion(iWF(e))}}function iWF(e){return{...e,singleUnionType:S4(e.singleUnionType)}}function nWF(e){return{...e,singleUnionType:aWF(e.singleUnionType)}}function aWF(e){return{...e,shape:oWF(e.shape)}}function oWF(e){switch(e.type){case"samePropertiesAsObject":return he.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:uWF(e.object)});case"singleProperty":return he.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:nff(e.shape)});case"noProperties":return he.V52.ExampleSingleUnionTypeProperties.noProperties()}}function uWF(e){return{...e,properties:e.properties.map(t=>whP(t))}}function whP(e){return{...e,value:{...e.value,shape:nff(e.value.shape)}}}function _hP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>jHu(t)),servicePathParameters:e.servicePathParameters.map(t=>jHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>jHu(t)),serviceHeaders:e.serviceHeaders.map(t=>tff(t)),endpointHeaders:e.endpointHeaders.map(t=>tff(t)),queryParameters:e.queryParameters.map(t=>OhP(t)),request:e.request!=null?lWF(e.request):void 0,response:sWF(e.response)}}function sWF(e){switch(e.type){case"error":return he.V52.ExampleResponse.error({...e,body:e.body!=null?S4(e.body):void 0});case"ok":return he.V52.ExampleResponse.ok(cWF(e))}}function cWF(e){switch(e.value.type){case"body":return he.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?S4(e.value.value):void 0);case"stream":return he.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>S4(t)));case"sse":return he.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:S4(t.data)})))}}function lWF(e){switch(e.type){case"inlinedRequestBody":return he.V52.ExampleRequestBody.inlinedRequestBody(mhP(e));case"reference":return he.V52.ExampleRequestBody.reference(S4(e))}}var ShP={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:$e},jsonifyEarlierVersion:e=>W_.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:od(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:fWF(r.response)}))}))})};function fWF(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?he.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var MhP={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.47.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[J.TYPESCRIPT]:"0.47.0",[J.TYPESCRIPT_SDK]:"0.47.0",[J.TYPESCRIPT_EXPRESS]:"0.17.7",[J.JAVA]:$e,[J.JAVA_MODEL]:"1.7.0",[J.JAVA_SDK]:"2.16.0",[J.JAVA_SPRING]:"1.5.0",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"1.10.1",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:"0.3.2"},jsonifyEarlierVersion:e=>W_.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?pWF(e.apiVersion):void 0,auth:mWF(e.auth),headers:e.headers.map(t=>Jen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Jen(t)),types:dWF(e.types),services:od(e.services,t=>qWF(t)),webhookGroups:od(e.webhookGroups,t=>vWF(t)),websocketChannels:od(e.websocketChannels,t=>_WF(t)),errors:od(e.errors,t=>GWF(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),variables:e.variables.map(t=>TWF(t)),dynamic:e.dynamic!=null?aHF(e.dynamic):void 0})};function dWF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>DhP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>DhP(r)),shape:he.V55.types.Type._visit(t.shape,{union:r=>he.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:mP(i.valueType)})),types:r.types.map(i=>DWF(i))}),enum:he.V54.types.Type.enum,object:r=>he.V54.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:mP(i.valueType)})),extendedProperties:r.extendedProperties?.map(i=>({...i,valueType:mP(i.valueType)}))}),alias:r=>he.V54.types.Type.alias({aliasOf:mP(r.aliasOf),resolvedType:MWF(r.resolvedType)}),undiscriminatedUnion:r=>he.V54.types.Type.undiscriminatedUnion(AWF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function pWF(e){return he.V54.ApiVersionScheme.header({...e,header:Jen(e.header)})}function _WF(e){return{...e,headers:e.headers.map(t=>Jen(t)),queryParameters:e.queryParameters.map(t=>uff(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),messages:e.messages.map(t=>hWF(t)),examples:e.examples.map(t=>QWF(t))}}function hWF(e){return{...e,body:yWF(e.body)}}function yWF(e){switch(e.type){case"inlinedBody":return he.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:mP(t.valueType)}))});case"reference":return he.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:mP(e.bodyType)})}}function vWF(e){return e.map(t=>bWF(t))}function bWF(e){return{...e,headers:e.headers.map(t=>Jen(t)),payload:gWF(e.payload),examples:e.examples!=null?e.examples.map(t=>OWF(t)):void 0}}function gWF(e){switch(e.type){case"reference":return he.V54.webhooks.WebhookPayload.reference({...e,payloadType:mP(e.payloadType)});case"inlinedPayload":return he.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:mP(t.valueType)}))})}}function OWF(e){return{...e,payload:d6(e.payload)}}function mWF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V54.auth.AuthScheme.basic(t);case"bearer":return he.V54.auth.AuthScheme.bearer(t);case"header":return he.V54.auth.AuthScheme.header(PWF(t));case"oauth":return he.V54.auth.AuthScheme.oauth(jWF(t))}})}}function PWF(e){return{...e,valueType:mP(e.valueType)}}function jWF(e){return{...e,configuration:he.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:wWF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?SWF(e.configuration.refreshEndpoint):void 0})}}function wWF(e){return{...e,requestProperties:{clientId:Sji(e.requestProperties.clientId),clientSecret:Sji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Sji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:zLr(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?zLr(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?zLr(e.responseProperties.refreshToken):void 0}}}function SWF(e){return{...e,requestProperties:{refreshToken:Sji(e.requestProperties.refreshToken)},responseProperties:{accessToken:zLr(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?zLr(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?zLr(e.responseProperties.refreshToken):void 0}}}function Jen(e){return{...e,valueType:mP(e.valueType)}}function mP(e){return e.type==="container"&&e.container.type==="nullable"?bHF(e.container.nullable):e.type==="container"&&e.container.type==="optional"?vHF(e.container.optional):he.V55.types.TypeReference._visit(e,{container:t=>he.V54.types.TypeReference.container(qhP(t)),primitive:t=>he.V54.types.TypeReference.primitive(AhP(t)),named:he.V54.types.TypeReference.named,unknown:he.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function AhP(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function qhP(e){return he.V55.types.ContainerType._visit(e,{list:t=>he.V54.types.ContainerType.list(mP(t)),optional:t=>he.V54.types.ContainerType.optional(mP(t)),nullable:t=>he.V54.types.ContainerType.optional(mP(t)),set:t=>he.V54.types.ContainerType.set(mP(t)),map:({keyType:t,valueType:r})=>he.V54.types.ContainerType.map({keyType:mP(t),valueType:mP(r)}),literal:he.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function DWF(e){return{...e,shape:EWF(e.shape)}}function EWF(e){return he.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:mP(t.type)}),noProperties:he.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function MWF(e){return he.V55.types.ResolvedTypeReference._visit(e,{container:t=>he.V54.types.ResolvedTypeReference.container(qhP(t)),named:he.V54.types.ResolvedTypeReference.named,primitive:t=>he.V54.types.ResolvedTypeReference.primitive(AhP(t)),unknown:he.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function AWF(e){return{members:e.members.map(t=>({...t,type:mP(t.type)}))}}function qWF(e){return{...e,pathParameters:e.pathParameters.map(t=>U6a(t)),headers:e.headers.map(t=>Jen(t)),endpoints:e.endpoints.map(t=>CWF(t))}}function U6a(e){return{...e,valueType:mP(e.valueType)}}function TWF(e){return{...e,type:mP(e.type)}}function CWF(e){return{...e,pagination:e.pagination!=null?RWF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>U6a(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),sdkRequest:e.sdkRequest!=null?UWF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?HWF(e.requestBody):void 0,response:e.response!=null?BWF(e.response):void 0,headers:e.headers.map(t=>Jen(t)),queryParameters:e.queryParameters.map(t=>uff(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:EhP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?EhP(t.example):void 0}))}}function BWF(e){return{...e,body:e.body!=null?xWF(e.body):void 0}}function xWF(e){switch(e.type){case"json":return he.V54.http.HttpResponseBody.json(ThP(e.value));case"fileDownload":return he.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return he.V54.http.HttpResponseBody.bytes(e);case"text":return he.V54.http.HttpResponseBody.text(e);case"streaming":return he.V54.http.HttpResponseBody.streaming(ChP(e.value));case"streamParameter":return he.V54.http.HttpResponseBody.streamParameter(zWF(e));default:Ko(e)}}function ThP(e){switch(e.type){case"response":return he.V54.http.JsonResponse.response({...e,responseBodyType:mP(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:mP(e.responseBodyType),responseProperty:e.responseProperty!=null?off(e.responseProperty):void 0})}}function ChP(e){switch(e.type){case"json":return he.V54.http.StreamingResponse.json({...e,payload:mP(e.payload)});case"text":return he.V54.http.StreamingResponse.text(e);case"sse":return he.V54.http.StreamingResponse.sse({...e,payload:mP(e.payload)})}}function IWF(e){switch(e.type){case"json":return he.V54.http.NonStreamHttpResponseBody.json(ThP(e.value));case"bytes":return he.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return he.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:Ko(e)}}function zWF(e){return{nonStreamResponse:IWF(e.nonStreamResponse),streamResponse:ChP(e.streamResponse)}}function RWF(e){switch(e.type){case"cursor":return he.V54.http.Pagination.cursor(NWF(e));case"offset":return he.V54.http.Pagination.offset(FWF(e))}}function NWF(e){return{...e,page:Sji(e.page),next:zLr(e.next),results:zLr(e.results)}}function FWF(e){return{...e,page:Sji(e.page),results:zLr(e.results),step:e.step!=null?Sji(e.step):void 0,hasNextPage:e.hasNextPage!=null?zLr(e.hasNextPage):void 0}}function Sji(e){return{...e,property:LWF(e.property)}}function LWF(e){switch(e.type){case"query":return he.V54.RequestPropertyValue.query(uff(e));case"body":return he.V54.RequestPropertyValue.body(off(e))}}function zLr(e){return{...e,property:off(e.property)}}function off(e){return{...e,valueType:mP(e.valueType)}}function uff(e){return{...e,valueType:mP(e.valueType)}}function UWF(e){return{...e,streamParameter:e.streamParameter!=null?Sji(e.streamParameter):void 0,shape:VWF(e.shape)}}function VWF(e){return he.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V54.http.SdkRequestShape.justRequestBody(WWF(t)),wrapper:he.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function WWF(e){switch(e.type){case"bytes":return he.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:mP(e.requestBodyType)})}}function HWF(e){return he.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:mP(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:mP(r.valueType)}))}),reference:t=>he.V54.http.HttpRequestBody.reference({...t,requestBodyType:mP(t.requestBodyType)}),fileUpload:t=>he.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:mP(r.valueType)});case"file":return he.V54.http.FileUploadRequestProperty.file($WF(r.value))}})}),bytes:t=>he.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function $WF(e){switch(e.type){case"file":return he.V54.http.FileProperty.file(e);case"fileArray":return he.V54.http.FileProperty.fileArray(e)}}function GWF(e){return{...e,type:e.type!=null?mP(e.type):void 0,examples:e.examples.map(t=>({...t,shape:d6(t.shape)}))}}function QWF(e){return{...e,pathParameters:e.pathParameters.map(t=>wHu(t)),headers:e.headers.map(t=>aff(t)),queryParameters:e.queryParameters.map(t=>BhP(t)),messages:e.messages.map(t=>({...t,body:JWF(t.body)}))}}function BhP(e){return{...e,value:d6(e.value)}}function aff(e){return{...e,value:d6(e.value)}}function wHu(e){return{...e,value:d6(e.value)}}function JWF(e){switch(e.type){case"inlinedBody":return he.V54.ExampleWebSocketMessageBody.inlinedBody(xhP(e));case"reference":return he.V54.ExampleWebSocketMessageBody.reference(d6(e))}}function xhP(e){return{...e,properties:e.properties.map(t=>({...t,value:d6(t.value)}))}}function DhP(e){return{...e,shape:IhP(e.shape)}}function sff(e){switch(e.type){case"primitive":return he.V54.ExampleTypeReferenceShape.primitive(KWF(e));case"container":return he.V54.ExampleTypeReferenceShape.container(YWF(e));case"unknown":return he.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:IhP(e.shape)})}}function KWF(e){return e.primitive}function YWF(e){switch(e.container.type){case"list":return he.V54.ExampleContainer.list({list:e.container.list.map(t=>d6(t)),itemType:mP(e.container.itemType)});case"set":return he.V54.ExampleContainer.set({set:e.container.set.map(t=>d6(t)),itemType:mP(e.container.itemType)});case"optional":return he.V54.ExampleContainer.optional({optional:e.container.optional!=null?d6(e.container.optional):void 0,valueType:mP(e.container.valueType)});case"nullable":return he.V54.ExampleContainer.optional({optional:e.container.nullable!=null?d6(e.container.nullable):void 0,valueType:mP(e.container.valueType)});case"map":return he.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:d6(t.key),value:d6(t.value)})),keyType:mP(e.container.keyType),valueType:mP(e.container.valueType)});case"literal":return he.V54.ExampleContainer.literal({literal:e.container.literal})}}function d6(e){return{...e,shape:sff(e.shape)}}function IhP(e){switch(e.type){case"object":return he.V54.ExampleTypeShape.object({properties:e.properties.map(t=>zhP(t))});case"alias":return he.V54.ExampleTypeShape.alias({value:{...d6(e.value)}});case"enum":return he.V54.ExampleTypeShape.enum(e);case"union":return he.V54.ExampleTypeShape.union(ZWF(e));case"undiscriminatedUnion":return he.V54.ExampleTypeShape.undiscriminatedUnion(XWF(e))}}function XWF(e){return{...e,singleUnionType:d6(e.singleUnionType)}}function ZWF(e){return{...e,singleUnionType:kWF(e.singleUnionType)}}function kWF(e){return{...e,shape:eHF(e.shape)}}function eHF(e){switch(e.type){case"samePropertiesAsObject":return he.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:tHF(e.object)});case"singleProperty":return he.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:sff(e.shape)});case"noProperties":return he.V54.ExampleSingleUnionTypeProperties.noProperties()}}function tHF(e){return{...e,properties:e.properties.map(t=>zhP(t))}}function zhP(e){return{...e,value:{...e.value,shape:sff(e.value.shape)}}}function EhP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>wHu(t)),servicePathParameters:e.servicePathParameters.map(t=>wHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>wHu(t)),serviceHeaders:e.serviceHeaders.map(t=>aff(t)),endpointHeaders:e.endpointHeaders.map(t=>aff(t)),queryParameters:e.queryParameters.map(t=>BhP(t)),request:e.request!=null?nHF(e.request):void 0,response:rHF(e.response)}}function rHF(e){switch(e.type){case"error":return he.V54.ExampleResponse.error({...e,body:e.body!=null?d6(e.body):void 0});case"ok":return he.V54.ExampleResponse.ok(iHF(e))}}function iHF(e){switch(e.value.type){case"body":return he.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?d6(e.value.value):void 0);case"stream":return he.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>d6(t)));case"sse":return he.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:d6(t.data)})))}}function nHF(e){switch(e.type){case"inlinedRequestBody":return he.V54.ExampleRequestBody.inlinedRequestBody(xhP(e));case"reference":return he.V54.ExampleRequestBody.reference(d6(e))}}function aHF(e){return{...e,types:od(e.types,t=>oHF(t)),endpoints:od(e.endpoints,t=>uHF(t)),headers:e.headers?.map(t=>C7t(t))}}function oHF(e){switch(e.type){case"alias":return he.V54.dynamic.NamedType.alias({...e,typeReference:eAe(e.typeReference)});case"enum":return he.V54.dynamic.NamedType.enum(e);case"object":return he.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>C7t(t))});case"discriminatedUnion":return he.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,cHF(r)]))});case"undiscriminatedUnion":return he.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>eAe(t))});default:Ko(e)}}function uHF(e){return{...e,auth:e.auth!=null?sHF(e.auth):void 0,request:lHF(e.request)}}function sHF(e){switch(e.type){case"basic":return he.V54.dynamic.Auth.basic(e);case"bearer":return he.V54.dynamic.Auth.bearer(e);case"header":return he.V54.dynamic.Auth.header({header:C7t(e.header)})}}function eAe(e){switch(e.type){case"list":return he.V54.dynamic.TypeReference.list(eAe(e.value));case"optional":return OHF(e.value);case"nullable":return gHF(e.value);case"map":return he.V54.dynamic.TypeReference.map({...e,key:eAe(e.key),value:eAe(e.value)});case"literal":return he.V54.dynamic.TypeReference.literal(e.value);case"named":return he.V54.dynamic.TypeReference.named(e.value);case"primitive":return he.V54.dynamic.TypeReference.primitive(e.value);case"set":return he.V54.dynamic.TypeReference.set(eAe(e.value));case"unknown":return he.V54.dynamic.TypeReference.unknown();default:Ko(e)}}function cHF(e){switch(e.type){case"samePropertiesAsObject":return he.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>C7t(t))});case"singleProperty":return he.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:eAe(e.typeReference),properties:e.properties?.map(t=>C7t(t))});case"noProperties":return he.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>C7t(t))});default:Ko(e)}}function C7t(e){return{...e,typeReference:eAe(e.typeReference)}}function lHF(e){switch(e.type){case"body":return he.V54.dynamic.Request.body(fHF(e));case"inlined":return he.V54.dynamic.Request.inlined(dHF(e));default:Ko(e)}}function fHF(e){return{pathParameters:e.pathParameters?.map(t=>C7t(t)),body:e.body!=null?RhP(e.body):void 0}}function dHF(e){return{...e,pathParameters:e.pathParameters?.map(t=>C7t(t)),queryParameters:e.queryParameters?.map(t=>C7t(t)),headers:e.headers?.map(t=>C7t(t)),body:e.body!=null?pHF(e.body):void 0}}function pHF(e){switch(e.type){case"properties":return he.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>C7t(t)));case"referenced":return he.V54.dynamic.InlinedRequestBody.referenced(_HF(e));case"fileUpload":return he.V54.dynamic.InlinedRequestBody.fileUpload(hHF(e));default:Ko(e)}}function _HF(e){return{...e,bodyType:RhP(e.bodyType)}}function RhP(e){switch(e.type){case"bytes":return he.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return he.V54.dynamic.ReferencedRequestBodyType.typeReference(eAe(e.value));default:Ko(e)}}function hHF(e){return{properties:e.properties.map(t=>yHF(t))}}function yHF(e){switch(e.type){case"file":return he.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return he.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return he.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(C7t(e));default:Ko(e)}}function vHF(e){return e.type==="container"&&e.container.type==="nullable"?he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e.container.nullable))):he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e)))}function bHF(e){return e.type==="container"&&e.container.type==="optional"?mP(e):he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e)))}function gHF(e){return e.type==="optional"?eAe(e):he.V54.dynamic.TypeReference.optional(eAe(e))}function OHF(e){return e.type==="nullable"?he.V54.dynamic.TypeReference.optional(eAe(e.value)):he.V54.dynamic.TypeReference.optional(eAe(e))}var NhP={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"1.12.0",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:$e},jsonifyEarlierVersion:e=>W_.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:od(e.services,t=>mHF(t))})};function mHF(e){return{...e,endpoints:e.endpoints.map(t=>PHF(t))}}function PHF(e){return{...e,pagination:jHF(e.pagination)}}function jHF(e){if(e!=null)switch(e.type){case"cursor":return he.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return he.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:Ko(e)}}function V6a(){return SHF}var SHu=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new cff([...this.migrations,t])}},cff=class extends SHu{build(){return new lff(this.migrations)}},lff=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:i}){return this.migrate({intermediateRepresentation:t,shouldMigrate:n=>this.shouldRunMigration({migration:n,targetGenerator:i}),context:r,targetGenerator:i})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:i,targetGenerator:n}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:i,targetGenerator:n})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:i,targetGenerator:n}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>t_.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let l=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:i,targetGenerator:n});return a||i.failAndThrow(`IR ${t} does not exist`),l}migrate({intermediateRepresentation:t,shouldMigrate:r,context:i,targetGenerator:n}){let a=t,u=async()=>await t_.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let l of this.migrations){if(!r(l))break;i.logger.debug(`Migrating IR from ${l.laterVersion} to ${l.earlierVersion}`),a=l.migrateBackwards(a,{taskContext:i,targetGenerator:n}),u=()=>Promise.resolve().then(()=>l.jsonifyEarlierVersion(a))}return{ir:a,jsonify:u}}shouldRunMigration({migration:t,targetGenerator:r}){let i=t.firstGeneratorVersionToConsumeNewIR[r.name];if(i==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(i){case $e:return!0;case ii:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return Qre(i,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let i of this.migrations)if(this.shouldRunMigration({migration:i,targetGenerator:t}))r=i.earlierVersion;else break;return r}},wHF={Builder:new SHu([])},SHF=wHF.Builder.withMigration(NhP).withMigration(MhP).withMigration(ShP).withMigration(hhP).withMigration(ihP).withMigration(Y_P).withMigration(H_P).withMigration(W_P).withMigration(U_P).withMigration(L_P).withMigration(R_P).withMigration(x_P).withMigration(B_P).withMigration(T_P).withMigration(q_P).withMigration(A_P).withMigration(M_P).withMigration(E_P).withMigration(D_P).withMigration(S_P).withMigration(w_P).withMigration(j_P).withMigration(P_P).withMigration(m_P).withMigration(g_P).withMigration(v_P).withMigration(y_P).withMigration(h_P).withMigration(s_P).withMigration(u_P).withMigration(o_P).withMigration(n_P).withMigration(i_P).withMigration(mQ0).withMigration(bQ0).withMigration(vQ0).withMigration(_Q0).withMigration(dQ0).withMigration(lQ0).withMigration(cQ0).withMigration(sQ0).withMigration(aQ0).withMigration(rQ0).withMigration(tQ0).withMigration(eQ0).withMigration(ZG0).withMigration(XG0).withMigration(YG0).withMigration(GG0).withMigration(WG0).withMigration(VG0).withMigration(UG0).withMigration(EG0).withMigration(wG0).withMigration(qp_).build();function W6a({intermediateRepresentation:e,context:t,targetGenerator:r}){return V6a().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function fff({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:i}){return V6a().migrateThroughVersion({version:i,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function H6a({intermediateRepresentation:e,context:t,version:r}){return V6a().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function LhP({project:e,irFilepath:t,cliContext:r,generationLanguage:i,audiences:n,version:a,keywords:u,smartCasing:l,readme:d,directFromOpenapi:s}){await Promise.all(e.apiWorkspaces.map(async o=>{await r.runTaskForWorkspace(o,async c=>{r.logger.info(`Generating IR for workspace ${o.workspaceName??"api"}`);let b=await DHF({workspace:o,context:c,generationLanguage:i,keywords:u,smartCasing:l,disableExamples:!1,audiences:n,version:a,readme:d,directFromOpenapi:s}),g=FhP.default.resolve(t);await EHr(Wl.of(g),b),c.logger.info(`Wrote IR to ${g}`)})}))}async function DHF({workspace:e,context:t,generationLanguage:r,audiences:i,keywords:n,smartCasing:a,disableExamples:u,version:l,readme:d,directFromOpenapi:s}){let o;if(s&&e instanceof y7)o=await e.getIntermediateRepresentation({context:t});else{let c=await e.toFernWorkspace({context:t});o=await tSn({workspace:c,context:t,generationLanguage:r,audiences:i,keywords:n,smartCasing:a,disableExamples:u,readme:d,includeDynamicExamples:!1})}return l==null?t_.IntermediateRepresentation.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}):H6a({intermediateRepresentation:o,version:l,context:t})}var UhP=require("fs/promises"),VhP=vi(require("path"),1);async function WhP({project:e,outputFilepath:t,cliContext:r}){await Promise.all(e.apiWorkspaces.map(async i=>{await r.runTaskForWorkspace(i,async n=>{let a=await Z_a(i,n),u=VhP.default.resolve(t);await(0,UhP.writeFile)(u,await qHr(a,{pretty:!0})),n.logger.info(`Wrote FDR API definition to ${u}`)})}))}var HhP=require("fs/promises"),$hP=vi(require("path"),1);async function GhP({project:e,irFilepath:t,cliContext:r,sdkLanguage:i}){await Promise.all(e.apiWorkspaces.map(async n=>{await r.runTaskForWorkspace(n,async a=>{if(n instanceof gfi){a.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(n instanceof y7))return;let u=new e5t(n.absoluteFilePath),l=await $Ie({context:a,specs:n.specs}),d=TIi({context:a,documents:await u.loadDocuments({context:a,specs:l})}),s=$hP.default.resolve(t),o=await ev.OpenApiIntermediateRepresentation.jsonOrThrow(d,{skipValidation:!0});await(0,HhP.writeFile)(s,await qHr(o,{pretty:!0})),a.logger.info(`Wrote IR to ${s}`)})}))}var DHu=require("fs/promises");async function JhP({project:e,includeModels:t,cliContext:r}){await Promise.all(e.apiWorkspaces.map(async i=>{await r.runTaskForWorkspace(i,async n=>{i instanceof y7?await MHF({workspace:i,context:n,includeModels:t}):n.logger.warn("Skipping fern workspace definition generation")})}))}async function EHF(e,t){let r=null;try{let i=(await(0,DHu.readFile)(e,"utf8")).toString();try{r=JSON.parse(i)}catch{r=rp.load(i,{json:!0})}}catch{return t.failAndThrow(`Failed to read OpenAPI overrides from file ${e}`)}return r}async function MHF({workspace:e,includeModels:t,context:r}){let i=new e5t(e.absoluteFilePath),n=await $Ie({context:r,specs:e.specs});for(let a of n){let u=TIi({context:r,documents:await i.loadDocuments({context:r,specs:[a]})}),l={};a.absoluteFilepathToOverrides!==void 0&&(l=await EHF(a.absoluteFilepathToOverrides,r));let d="path"in l?l.path:{};for(let c of u.endpoints){let b=Tla(c);c.path in d||(d[c.path]={});let g=d[c.path];if(g!=null&&g[c.method]==null){let O=b.file.split("/").map(w=>w.replace(".yml","")).filter(w=>w!=="__package__"),m={};O.length>0&&(m["x-fern-sdk-group-name"]=O),m["x-fern-sdk-method-name"]=b.endpointId,g[c.method.toLowerCase()]=m}else l==null&&r.logger.warn(`Endpoint ${c.path} ${c.method} is defined multiple times`)}let s="path"in l?l.path:{};if(t){QhP(s,u.groupedSchemas.rootSchemas);for(let[c,b]of Object.entries(u.groupedSchemas.namespacedSchemas))QhP(s,b)}let o={schemas:s};await(0,DHu.writeFile)(Xu(fp(a.absoluteFilepath),Xa.of("openapi-overrides.yml")),rp.dump({paths:d,components:o}))}}function QhP(e,t){for(let[r,i]of Object.entries(t)){if(r in e)continue;let n={};n["x-fern-type-name"]="nameOverride"in i?i.nameOverride??r:r,e[r]=n}}var EHu="api",KhP="group";var YhP=".preview",XhP="approved-output-directories",ZhP=".fern";var nyP=require("fs/promises");var eyP=require("fs/promises");var khP=require("os");function $6a(){return Xu(Wl.of((0,khP.homedir)()),Xa.of(ZhP),Xa.of(XhP))}async function tyP(){let e=$6a();if(!await Cf(e))return[];let r=await(0,eyP.readFile)(e,{encoding:"utf-8"});return JSON.parse(r)}var MHu=require("fs/promises"),ryP=vi(require("path"),1);async function iyP(e){await(0,MHu.mkdir)(ryP.default.dirname($6a()),{recursive:!0}),await(0,MHu.writeFile)($6a(),JSON.stringify(e,null,2))}async function ayP(e,t,r){if(!e||zfs()||r)return{shouldProceed:!0};let i=await tyP();return i?.includes(e)?{shouldProceed:!0}:await Cf(e)?(await(0,nyP.readdir)(e)).length===0?{shouldProceed:!0}:await t.confirmPrompt(`Directory ${e} contains existing files that may be overwritten. Continue?`,!1)?(await iyP([...i??[],e]),{shouldProceed:!0}):{shouldProceed:!1}:{shouldProceed:!0}}var DmP=vi(Cg(),1),y6t=vi(PmP(),1),sAe=vi(xq(),1);var Uji=vi(require("path"),1),ltn="/fern",ftn=Uji.default.join(ltn,"output"),qdf=Uji.default.join(ltn,"config.json"),Y$u=Uji.default.join(ltn,"ir.json"),d2a=Uji.default.join(ltn,"snippet.json"),p2a=Uji.default.join(ltn,"snippet-templates.json"),RlV=Uji.default.join(ltn,"generators"),jmP=Uji.default.join(ltn,"sources");var WZF="0.0.1";function wmP(e){return e!=null?DmP.GithubPublishInfo._visit(e,{npm:t=>y6t.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.token??"")}),maven:t=>y6t.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>y6t.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.password??"")}),rubygems:t=>y6t.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??"")}),postman:t=>y6t.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>y6t.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??"")}),_other:()=>{}}):void 0}function EmP({generatorInvocation:e,customConfig:t,workspaceName:r,organization:i,outputVersion:n=WZF,absolutePathToSnippet:a,absolutePathToSnippetTemplates:u,writeUnitTests:l,generateOauthClients:d,generatePaginatedClients:s}){let o=[],c=e.outputMode._visit({publish:b=>({...SmP(n,b),publishingMetadata:e.publishMetadata}),publishV2:b=>({...SmP(n,b),publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:y6t.FernGeneratorExec.OutputMode.downloadFiles(),path:ftn,publishingMetadata:e.publishMetadata}),github:b=>{let g={mode:y6t.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${b.owner}/${b.repo}`,version:n,publishInfo:wmP(b.publishInfo),installationToken:void 0}),path:ftn,publishingMetadata:e.publishMetadata};return a!==void 0&&(o.push(`${a}:${d2a}`),g.snippetFilepath=d2a),u!==void 0&&(o.push(`${u}:${p2a}`),g.snippetTemplateFilepath=p2a),g},githubV2:b=>{let g=b._visit({commitAndRelease:m=>`https://github.com/${m.owner}/${m.repo}`,push:m=>`https://github.com/${m.owner}/${m.repo}`,pullRequest:m=>`https://github.com/${m.owner}/${m.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),O={mode:y6t.FernGeneratorExec.OutputMode.github({repoUrl:g,version:n,publishInfo:wmP(b.publishInfo)}),path:ftn,publishingMetadata:e.publishMetadata};return a!==void 0&&(o.push(`${a}:${d2a}`),O.snippetFilepath=d2a),u!==void 0&&(o.push(`${u}:${p2a}`),O.snippetTemplateFilepath=p2a),O},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{binds:o,config:{irFilepath:Y$u,output:c,publish:void 0,customConfig:t,workspaceName:r,organization:i,environment:y6t.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:l,generateOauthClients:d,generatePaginatedClients:s}}}function SmP(e,t){let r;return"registryOverrides"in t?r=t.registryOverrides.maven??t.registryOverrides.npm:r!=null&&(r=t._visit({mavenOverride:i=>i,npmOverride:i=>i,pypiOverride:i=>i,rubyGemsOverride:i=>i,postman:i=>i,nugetOverride:i=>i,_other:()=>{}})),{mode:y6t.FernGeneratorExec.OutputMode.publish({registries:{maven:{group:"",password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??""},npm:{registryUrl:r?.registryUrl??"",scope:"",token:r?.token??""}},publishTarget:void 0,registriesV2:{maven:{password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??"",coordinate:r?.coordinate??"",signature:r?.signature},npm:{registryUrl:r?.registryUrl??"",token:r?.token??"",packageName:r?.packageName??""},pypi:{packageName:r?.coordinate??"",password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??"",pypiMetadata:r?.pypiMetadata},rubygems:{registryUrl:r?.registryUrl??"",apiKey:r?.apiKey??"",packageName:r?.packageName??""},nuget:{registryUrl:r?.registryUrl??"",apiKey:r?.apiKey??"",packageName:r?.packageName??""}},version:e}),path:ftn}}async function MmP({workspace:e,audiences:t,generatorInvocation:r,context:i,irVersionOverride:n,version:a,packageName:u,sourceConfig:l,includeOptionalRequestPropertyExamples:d}){let s=_2({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:u,context:i,sourceResolver:new d2(i,e),includeDynamicExamples:!0});l!=null&&(s.sourceConfig=l),i.logger.debug("Generated IR");let o=n!=null?await H6a({intermediateRepresentation:s,context:i,version:n}):await W6a({intermediateRepresentation:s,context:i,targetGenerator:{name:r.name,version:r.version}});return{latest:s,migrated:o}}var BmP=require("fs/promises"),oUn=vi(fte(),1);var AmP=require("fs/promises"),qmP=vi(fte(),1);async function Tdf({logger:e,imageName:t,args:r=[],binds:i=[],writeLogsToFile:n=!0,removeAfterCompletion:a=!1}){let u=()=>HZF({logger:e,imageName:t,args:r,binds:i,removeAfterCompletion:a,writeLogsToFile:n});try{await u()}catch(l){if(l instanceof Error&&l.message.includes("No such image"))await $ZF(t),await u();else throw l}}async function HZF({logger:e,imageName:t,args:r,binds:i,removeAfterCompletion:n,writeLogsToFile:a}){let u=["run","--user","root",...i.flatMap(c=>["-v",c]),n?"--rm":"",t,...r].filter(Boolean),{stdout:l,stderr:d,exitCode:s}=await eG(e,"docker",u,{reject:!1,all:!0,doNotPipeOutput:!0}),o=l+d;if(a){let c=await qmP.default.file();await(0,AmP.writeFile)(c.path,o),e.info(`Generator logs here: ${c.path}`)}if(s!==0)throw new Error(`Docker exited with code ${s}.
|
|
1995
|
+
fix here: ${u}:${n.start.line}:${n.start.column}`,[i,u]}function QkD(e){return Ufi.ApiDefinitionV1ToLatest.from(e,{useJavaScriptAsTypeScript:!1,alwaysEnableJavaScriptFetch:!1,usesApplicationJsonInFormDataValue:!1}).migrate()}async function JkD(e){let t=[];return Ufi.Transformer.descriptions(r=>(typeof r=="string"&&t.push(r),r)).apiDefinition(e),t}var Mks={name:"validate-version-file",create:()=>({versionFile:async({path:e,content:t})=>{let r=await INo({value:t});return r.type==="success"?[]:[{severity:"fatal",message:`${r.message}`}]}})};var mp_=[xZs,IZs,Mks,wd_,aRi,gks,zZs,RZs,Sd_,Oks];function Pp_(e){if(!e)return mp_;let t=new Set(e);return mp_.filter(r=>!t.has(r.name))}async function qha(e,t,r,i,n,a){let u=n?[aRi]:Pp_(a);return KkD({workspace:e,rules:u,context:t,fernWorkspaces:r,ossWorkspaces:i})}async function KkD({workspace:e,rules:t,context:r,fernWorkspaces:i,ossWorkspaces:n}){let a=[],u=await Promise.all(t.map(d=>d.create({workspace:e,fernWorkspaces:i,ossWorkspaces:n,logger:r.logger}))),l=gd_({relativeFilepath:Xa.of(G2t),allRuleVisitors:u,addViolations:d=>{a.push(...d)}});return await jd_({contents:e.config,visitor:l,absoluteFilepathToConfiguration:Xu(e.absoluteFilePath,Xa.of(G2t)),absolutePathToFernFolder:e.absoluteFilePath,context:r,fernWorkspaces:i}),a}async function Aks({workspace:e,fernWorkspaces:t,ossWorkspaces:r,context:i,logWarnings:n,errorOnBrokenLinks:a,logSummary:u=!0,excludeRules:l}){let d=performance.now(),s=await qha(e,i,t,r,!1,l),o=performance.now()-d,{hasErrors:c}=Z1n({violations:s,context:i,logWarnings:n,logSummary:u,logBreadcrumbs:!1,elapsedMillis:o});return a&&(c=c||s.some(b=>b.name==="valid-markdown-links")),{hasErrors:c}}async function tFo({workspace:e,fernWorkspaces:t,ossWorkspaces:r,context:i,logWarnings:n,errorOnBrokenLinks:a,excludeRules:u}){let{hasErrors:l}=await Aks({workspace:e,context:i,logWarnings:n,fernWorkspaces:t,ossWorkspaces:r,errorOnBrokenLinks:a,excludeRules:u});l&&i.failAndThrow()}async function jp_({loadProject:e,cliContext:t,port:r,bundlePath:i,brokenLinks:n}){let a=await e(),u=a.docsWorkspaces;u!=null&&(await t.instrumentPostHogEvent({orgId:a.config.organization,command:"fern docs dev"}),await t.runTaskForWorkspace(u,async l=>{l.logger.info(`Starting server on port ${r}`),await _Xs({initialProject:a,reloadProject:e,validateProject:async d=>{let s=d.docsWorkspaces;if(s==null)return;let o=await Promise.all(d.apiWorkspaces.map(async b=>b.toFernWorkspace({context:l}))),c=n?[]:["valid-markdown-links"];await Aks({workspace:s,context:l,logWarnings:!0,logSummary:!1,fernWorkspaces:o,ossWorkspaces:await vie(d),excludeRules:c});for(let b of o)await t.runTaskForWorkspace(b,async g=>{await EZs({workspace:b,context:g,logWarnings:!1,logSummary:!1})})},context:l,port:r,bundlePath:i})}))}async function wp_({project:e,cliContext:t,shouldFix:r}){await Promise.all(e.apiWorkspaces.map(async i=>{i instanceof y7||await t.runTaskForWorkspace(i,async n=>{await JAs({workspace:await i.toFernWorkspace({context:n}),context:n,shouldFix:r})})}))}var Sp_=vi(require("path"),1);async function tSn({workspace:e,context:t,generationLanguage:r,keywords:i,smartCasing:n,disableExamples:a,audiences:u,readme:l,includeDynamicExamples:d}){return await vXt({workspace:e,context:t,logWarnings:!1}),_2({workspace:e,generationLanguage:r,keywords:i,smartCasing:n,exampleGeneration:{disabled:a},audiences:u,readme:l,version:void 0,packageName:void 0,context:t,sourceResolver:new d2(t,e),includeDynamicExamples:d})}async function Dp_({project:e,irFilepath:t,cliContext:r,generationLanguage:i,audiences:n,version:a,keywords:u,smartCasing:l,includeDynamicExamples:d}){await Promise.all(e.apiWorkspaces.map(async s=>{await r.runTaskForWorkspace(s,async o=>{r.logger.info(`Generating IR for workspace ${s.workspaceName??"api"}`);let c=await s.toFernWorkspace({context:o}),b=await tSn({workspace:c,context:o,generationLanguage:i,keywords:u,smartCasing:l,disableExamples:!1,audiences:n,readme:void 0,includeDynamicExamples:d});if(b.dynamic==null)throw new Error("Internal error; dynamic IR was not generated");let g=Sp_.default.resolve(t);await EHr(Wl.of(g),b.dynamic),o.logger.info(`Wrote IR to ${g}`)})}))}var Ep_=require("fs/promises"),Mp_=vi(require("path"),1);async function Ap_({project:e,outputFilepath:t,cliContext:r,audiences:i}){await Promise.all(e.apiWorkspaces.map(async n=>{await r.runTaskForWorkspace(n,async a=>{let u=await n.toFernWorkspace({context:a}),l=await tSn({workspace:u,context:a,generationLanguage:void 0,audiences:i,keywords:void 0,smartCasing:!1,disableExamples:!1,readme:void 0,includeDynamicExamples:!1}),d=SSe({ir:l,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0}}),s=Mp_.default.resolve(t);await(0,Ep_.writeFile)(s,await qHr(d,{pretty:!0})),a.logger.info(`Wrote FDR API definition to ${s}`)})}))}var FhP=vi(require("path"),1);var $e=Symbol(),ii=Symbol();var qp_={laterVersion:"v2",earlierVersion:"v1",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.246",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types,services:e.services,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,errors:e.errors.map(t=>({name:t.name,docs:t.docs,discriminantValue:{originalValue:t.discriminantValueV4.name.unsafeName.originalValue,camelCase:t.discriminantValueV4.name.unsafeName.camelCase,pascalCase:t.discriminantValueV4.name.unsafeName.pascalCase,snakeCase:t.discriminantValueV4.name.unsafeName.snakeCase,screamingSnakeCase:t.discriminantValueV4.name.unsafeName.screamingSnakeCase,wireValue:t.discriminantValueV4.wireValue},discriminantValueV2:t.discriminantValueV2,discriminantValueV3:t.discriminantValueV3,discriminantValueV4:t.discriminantValueV4,type:t.type,typeV2:t.typeV2,typeV3:t.typeV3,http:t.http,statusCode:t.statusCode}))})};var he={};Io(he,{V1:()=>acB,V10:()=>ocB,V11:()=>ucB,V12:()=>scB,V13:()=>ccB,V14:()=>lcB,V15:()=>fcB,V16:()=>dcB,V17:()=>pcB,V18:()=>_cB,V19:()=>hcB,V2:()=>ycB,V20:()=>vcB,V21:()=>bcB,V22:()=>gcB,V23:()=>W$0.FernIrV23,V24:()=>H$0.FernIrV24,V25:()=>$$0.FernIrV25,V26:()=>G$0.FernIrV26,V27:()=>Q$0.FernIrV27,V28:()=>J$0.FernIrV28,V29:()=>K$0.FernIrV29,V3:()=>OcB,V30:()=>Y$0.FernIrV30,V31:()=>X$0.FernIrV31,V32:()=>Z$0.FernIrV32,V33:()=>k$0.FernIrV33,V34:()=>eG0.FernIrV34,V35:()=>tG0.FernIrV35,V36:()=>rG0.FernIrV36,V37:()=>iG0.FernIrV37,V38:()=>nG0.FernIrV38,V39:()=>aG0.FernIrV39,V4:()=>mcB,V40:()=>oG0.FernIrV40,V41:()=>uG0.FernIrV41,V42:()=>sG0.FernIrV42,V43:()=>cG0.FernIrV43,V44:()=>lG0.FernIrV44,V45:()=>fG0.FernIrV45,V46:()=>dG0.FernIrV46,V47:()=>pG0.FernIrV47,V48:()=>_G0.FernIrV48,V49:()=>hG0.FernIrV49,V5:()=>PcB,V50:()=>yG0.FernIrV50,V51:()=>vG0.FernIrV51,V52:()=>bG0.FernIrV52,V53:()=>gG0.FernIrV53,V54:()=>OG0.FernIrV54,V55:()=>mG0.FernIrV55,V56:()=>Tc,V6:()=>jcB,V7:()=>wcB,V8:()=>ScB,V9:()=>DcB});var acB=vi(S0_(),1),ocB=vi(Gw_(),1),ucB=vi(yq_(),1),scB=vi(pR_(),1),ccB=vi(l4_(),1),lcB=vi(uW_(),1),fcB=vi(nY_(),1),dcB=vi(yih(),1),pcB=vi(Mlh(),1),_cB=vi(Lvh(),1),hcB=vi(twh(),1),ycB=vi(YMh(),1),vcB=vi(Dzh(),1),bcB=vi(a4h(),1),gcB=vi(NWh(),1),W$0=vi(iJh(),1),H$0=vi(LZh(),1),$$0=vi(Miy(),1),G$0=vi(gsy(),1),Q$0=vi(_py(),1),J$0=vi(lby(),1),K$0=vi(oPy(),1),OcB=vi(KEy(),1),Y$0=vi(XCy(),1),X$0=vi(kRy(),1),Z$0=vi(l2y(),1),k$0=vi(A0c(),1),eG0=vi(BGy(),1),tG0=vi(MZy(),1),rG0=vi(jnv(),1),iG0=vi(Olv(),1),nG0=vi(Oyv(),1),aG0=vi(Rmv(),1),mcB=vi(IEv(),1),oG0=vi(ZBv(),1),uG0=vi(v3v(),1),sG0=vi(L5v(),1),cG0=vi(f$v(),1),lG0=vi(RXv(),1),fG0=vi(wnb(),1),dG0=vi(vfb(),1),pG0=vi(_bb(),1),_G0=vi(fwb(),1),hG0=vi(fqb(),1),PcB=vi(YIb(),1),yG0=vi(a2b(),1),vG0=vi(wVb(),1),bG0=vi(JKb(),1),gG0=vi(Pu0(),1),OG0=vi(n00(),1),mG0=vi(GM0(),1),jcB=vi(eI0(),1),wcB=vi(s70(),1),ScB=vi(y90(),1),DcB=vi(V$0(),1);function PG0({inlinedRequest:e,allTypes:t}){let r=new Set,i=t.reduce((n,a)=>({...n,[WTc(a.name)]:a}),{});for(let n of e.extends)jG0({typeName:n,typeNameToDeclaration:i,referencedTypes:r});for(let n of e.properties)EMn({reference:n.valueType,typeNameToDeclaration:i,referencedTypes:r});return[...r].reduce((n,a)=>{let u=i[a];if(u==null)throw new Error("Cannot find declaration for ID: "+a);return[...n,u.name]},[])}function EMn({reference:e,typeNameToDeclaration:t,referencedTypes:r}){he.V2.types.TypeReference._visit(e,{primitive:Qo,container:i=>{EcB({container:i,typeNameToDeclaration:t,referencedTypes:r})},named:i=>{jG0({typeName:i,typeNameToDeclaration:t,referencedTypes:r})},unknown:Qo,void:Qo,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function EcB({container:e,typeNameToDeclaration:t,referencedTypes:r}){he.V2.types.ContainerType._visit(e,{list:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},set:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},optional:i=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r})},map:({keyType:i,valueType:n})=>{EMn({reference:i,typeNameToDeclaration:t,referencedTypes:r}),EMn({reference:n,typeNameToDeclaration:t,referencedTypes:r})},literal:Qo,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function jG0({typeName:e,typeNameToDeclaration:t,referencedTypes:r}){let i=WTc(e);r.add(i);let n=t[i];if(n==null)throw new Error("Cannot locate type: "+i);for(let a of n.referencedTypes)r.add(WTc(a))}function WTc(e){return[...e.fernFilepathV2.map(t=>t.unsafeName.originalValue),e.nameV3.unsafeName.originalValue].join(".")}var wG0={laterVersion:"v3",earlierVersion:"v2",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.249",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-3-g97d4964",[J.JAVA_SDK]:"0.0.134-3-g97d4964",[J.JAVA_SPRING]:"0.0.134-3-g97d4964",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=[...e.types];return{apiName:e.apiName,auth:e.auth,headers:e.headers,types:t,errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{websocket:e.services.websocket,http:e.services.http.map(r=>({availability:r.availability,docs:r.docs,name:r.name,basePath:r.basePath,basePathV2:r.basePathV2,headers:r.headers,pathParameters:r.pathParameters,endpoints:r.endpoints.map(i=>McB(r,i,e.types,n=>{t.push(n)}))}))}}}};function McB(e,t,r,i){return{docs:t.docs,availability:t.availability,id:t.id,name:t.name,nameV2:t.nameV2,method:t.method,headers:t.headers,path:t.path,pathParameters:t.pathParameters,queryParameters:t.queryParameters,request:AcB(t,e,r,i),response:t.response,errors:t.errors,errorsV2:t.errorsV2,auth:t.auth}}function AcB(e,t,r,i){let n=e.requestBody;return n==null?{docs:void 0,type:he.V2.types.TypeReference.void(),typeV2:void 0}:he.V3.services.http.HttpRequestBody._visit(n,{reference:a=>({docs:a.docs,type:a.requestBodyType,typeV2:a.requestBodyType}),inlinedRequestBody:a=>{let u={fernFilepath:t.name.fernFilepath,fernFilepathV2:t.name.fernFilepathV2,name:a.name.unsafeName.originalValue,nameV2:{originalValue:a.name.unsafeName.originalValue,camelCase:a.name.unsafeName.camelCase,pascalCase:a.name.unsafeName.pascalCase,snakeCase:a.name.unsafeName.snakeCase,screamingSnakeCase:a.name.unsafeName.screamingSnakeCase},nameV3:a.name},l=he.V2.types.Type.object({extends:a.extends,properties:a.properties.map(s=>({availability:e.availability,docs:s.docs,name:{originalValue:s.name.name.unsafeName.originalValue,camelCase:s.name.name.unsafeName.camelCase,pascalCase:s.name.name.unsafeName.pascalCase,snakeCase:s.name.name.unsafeName.snakeCase,screamingSnakeCase:s.name.name.unsafeName.screamingSnakeCase,wireValue:s.name.wireValue},nameV2:s.name,valueType:s.valueType}))});i({docs:void 0,availability:e.availability,name:u,shape:l,referencedTypes:PG0({inlinedRequest:a,allTypes:r}),examples:[]});let d=he.V2.types.TypeReference.named(u);return{docs:void 0,type:d,typeV2:d}},_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+n.type)}})}var EG0={laterVersion:"v4",earlierVersion:"v3",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:"0.0.11-4-g1c29f6c",[J.POSTMAN]:"0.0.32-rc0",[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({apiName:e.apiName,auth:e.auth,headers:e.headers,types:e.types.map(t=>({docs:t.docs,availability:t.availability,name:t.name,shape:t.shape,examples:t.examples.map(r=>MG0(r.shape)),referencedTypes:t.referencedTypes})),errors:e.errors,constants:e.constants,constantsV2:e.constantsV2,defaultEnvironment:e.defaultEnvironment,environments:e.environments,errorDiscriminant:e.errorDiscriminant,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,services:{...e.services,http:e.services.http.map(t=>({...t,endpoints:t.endpoints.map(r=>({...r,examples:r.examples.map(i=>xcB(i))}))}))}})};function MG0(e){return he.V4.types.ExampleTypeShape._visit(e,{object:t=>he.V3.types.ExampleType.object(qcB(t)),union:t=>he.V3.types.ExampleType.union(CcB(t)),alias:t=>he.V3.types.ExampleType.alias(BcB(t)),enum:he.V3.types.ExampleType.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function qcB(e){return{properties:e.properties.map(t=>({wireKey:t.wireKey,value:vZ(t.value),originalTypeDeclaration:t.originalTypeDeclaration}))}}function vZ(e){return he.V4.types.ExampleTypeReferenceShape._visit(e.shape,{primitive:he.V3.types.ExampleTypeReference.primitive,container:t=>he.V3.types.ExampleTypeReference.container(TcB(t)),named:t=>he.V3.types.ExampleTypeReference.named(AG0(t)),unknown:he.V3.types.ExampleTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReference: "+e.shape.type)}})}function TcB(e){return he.V4.types.ExampleContainer._visit(e,{list:t=>he.V3.types.ExampleContainer.list(t.map(vZ)),set:t=>he.V3.types.ExampleContainer.set(t.map(vZ)),optional:t=>he.V3.types.ExampleContainer.optional(t!=null?vZ(t):void 0),map:t=>he.V3.types.ExampleContainer.map(t.map(r=>({key:vZ(r.key),value:vZ(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function AG0(e){return{typeName:e.typeName,shape:MG0(e.shape)}}function CcB(e){return{wireDiscriminantValue:e.wireDiscriminantValue,properties:he.V4.types.ExampleSingleUnionTypeProperties._visit(e.properties,{samePropertiesAsObject:t=>he.V3.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject(AG0(t)),singleProperty:t=>he.V3.types.ExampleSingleUnionTypeProperties.singleProperty(vZ(t)),noProperties:()=>he.V3.types.ExampleSingleUnionTypeProperties.noProperties(),_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.properties.type)}})}}function BcB(e){return{value:vZ(e.value)}}function xcB(e){return{servicePathParameters:e.servicePathParameters.map(t=>SG0(t)),endpointPathParameters:e.servicePathParameters.map(t=>SG0(t)),serviceHeaders:e.serviceHeaders.map(t=>DG0(t)),endpointHeaders:e.endpointHeaders.map(t=>DG0(t)),queryParameters:e.queryParameters.map(t=>IcB(t)),request:e.request!=null?zcB(e.request):void 0,response:NcB(e.response)}}function SG0(e){return{key:e.key,value:vZ(e.value)}}function DG0(e){return{key:e.wireKey,value:vZ(e.value)}}function IcB(e){return{key:e.wireKey,value:vZ(e.value)}}function zcB(e){return he.V4.services.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V3.services.http.ExampleRequestBody.inlinedRequestBody({properties:t.properties.map(r=>RcB(r))}),reference:t=>he.V3.services.http.ExampleRequestBody.reference(vZ(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function RcB(e){return{wireKey:e.wireKey,value:vZ(e.value),originalTypeDeclaration:e.originalTypeDeclaration}}function NcB(e){return he.V4.services.http.ExampleResponse._visit(e,{ok:t=>he.V3.services.http.ExampleResponse.ok({body:t.body!=null?vZ(t.body):void 0}),error:t=>he.V3.services.http.ExampleResponse.error({error:t.error,body:t.body!=null?vZ(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var s5o=class{errors;constructor(t){this.errors=t.errors.reduce((r,i)=>({...r,[qG0(i.name)]:i}),{})}getDeclaration(t){let r=qG0(t),i=this.errors[r];if(i==null)throw new Error("Error does not exist: "+r);return i}};function qG0(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function iLt(e){return{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}function WDe(e){return{...iLt(e.name),wireValue:e.wireValue}}function D2(e){return{safeName:{originalValue:e.originalName,camelCase:e.camelCase.safeName,pascalCase:e.pascalCase.safeName,snakeCase:e.snakeCase.safeName,screamingSnakeCase:e.screamingSnakeCase.safeName},unsafeName:{originalValue:e.originalName,camelCase:e.camelCase.unsafeName,pascalCase:e.pascalCase.unsafeName,snakeCase:e.snakeCase.unsafeName,screamingSnakeCase:e.screamingSnakeCase.unsafeName}}}function E2(e){return{wireValue:e.wireValue,name:D2(e.name)}}function q9i(e){return e.map(t=>iLt(t))}function T9i(e){return e.map(t=>D2(t))}function Y5(e){return{fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath),name:e.name.originalName,nameV2:iLt(e.name),nameV3:D2(e.name)}}function _z(e){return he.V5.types.TypeReference._visit(e,{named:t=>he.V4.types.TypeReference.named(Y5(t)),container:t=>he.V4.types.TypeReference.container(MMn(t)),primitive:t=>he.V4.types.TypeReference.primitive(t),unknown:he.V4.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+e._type)}})}function MMn(e){return he.V5.types.ContainerType._visit(e,{list:t=>he.V4.types.ContainerType.list(_z(t)),set:t=>he.V4.types.ContainerType.set(_z(t)),map:({keyType:t,valueType:r})=>he.V4.types.ContainerType.map({keyType:_z(t),valueType:_z(r)}),optional:t=>he.V4.types.ContainerType.optional(_z(t)),literal:t=>he.V5.types.Literal._visit(t,{string:r=>he.V4.types.ContainerType.literal(he.V4.types.Literal.string(r)),_unknown:()=>{throw new Error("Unknown Literal: "+t.type)}}),_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}var c5o=class{types;constructor(t){this.types=t.types.reduce((r,i)=>({...r,[TG0(i.name)]:i}),{})}resolveTypeReference(t){return he.V5.types.TypeReference._visit(t,{container:r=>he.V4.types.ResolvedTypeReference.container(MMn(r)),named:r=>{let i=this.getTypeDeclaration(r);return i.shape._type==="alias"?this.resolveTypeReference(i.shape.aliasOf):he.V4.types.ResolvedTypeReference.named({name:Y5(r),shape:FcB(i.shape._type)})},primitive:he.V4.types.ResolvedTypeReference.primitive,unknown:he.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown TypeReference: "+t._type)}})}getTypeDeclaration(t){let r=TG0(t),i=this.types[r];if(i==null)throw new Error("Type does not exist: "+i);return i}};function TG0(e){return`${e.fernFilepath.join("/")}:${e.name.originalName}`}function FcB(e){switch(e){case"object":return he.V4.types.ShapeType.Object;case"union":return he.V4.types.ShapeType.Union;case"enum":return he.V4.types.ShapeType.Enum;default:Ko(e)}}function C9i(e){return{name:WDe(e.name),nameV2:E2(e.name),valueType:_z(e.valueType),availability:e.availability,docs:e.docs}}function CG0(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>LcB(t))}}function LcB(e){return he.V5.auth.AuthScheme._visit(e,{basic:he.V4.auth.AuthScheme.basic,bearer:he.V4.auth.AuthScheme.bearer,header:t=>he.V4.auth.AuthScheme.header(C9i(t)),_unknown:()=>{throw new Error("Unknown AuthScheme: "+e._type)}})}function BG0(e){return{docs:e.docs,id:e.id,url:e.url,name:D2(e.name)}}function xG0({errorDeclaration:e,errorDiscriminationStrategy:t,typeReferenceResolver:r}){let i=e.type!=null?he.V4.types.Type.alias({aliasOf:_z(e.type),resolvedType:r.resolveTypeReference(e.type)}):void 0;return{docs:e.docs,name:{name:e.name.name.originalName,nameV2:iLt(e.name.name),nameV3:D2(e.name.name),fernFilepath:q9i(e.name.fernFilepath),fernFilepathV2:T9i(e.name.fernFilepath)},discriminantValueV2:E2(e.discriminantValue),discriminantValueV3:he.V5.ir.ErrorDiscriminationStrategy._visit(t,{statusCode:he.V4.errors.ErrorDeclarationDiscriminantValue.statusCode,property:n=>he.V4.errors.ErrorDeclarationDiscriminantValue.property(E2(n.contentProperty)),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+t.type)}}),discriminantValueV4:E2(e.discriminantValue),type:i??he.V4.types.Type.alias({aliasOf:he.V4.types.TypeReference.void(),resolvedType:he.V4.types.ResolvedTypeReference.void()}),typeV2:i,typeV3:e.type!=null?_z(e.type):e.type,http:{statusCode:e.statusCode},statusCode:e.statusCode}}function bZ(e){return{jsonExample:e.jsonExample,shape:IG0(e.shape)}}function IG0(e){return he.V5.types.ExampleTypeReferenceShape._visit(e,{primitive:he.V4.types.ExampleTypeReferenceShape.primitive,container:t=>he.V4.types.ExampleTypeReferenceShape.container(VcB(t)),unknown:he.V4.types.ExampleTypeReferenceShape.unknown,named:t=>he.V4.types.ExampleTypeReferenceShape.named(UcB(t)),_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function UcB(e){return{typeName:Y5(e.typeName),shape:l5o(e.shape)}}function VcB(e){return he.V5.types.ExampleContainer._visit(e,{list:t=>he.V4.types.ExampleContainer.list(t.map(r=>bZ(r))),set:t=>he.V4.types.ExampleContainer.set(t.map(r=>bZ(r))),optional:t=>he.V4.types.ExampleContainer.optional(t!=null?bZ(t):void 0),map:t=>he.V4.types.ExampleContainer.map(t.map(r=>({key:bZ(r.key),value:bZ(r.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+e.type)}})}function l5o(e){return he.V5.types.ExampleTypeShape._visit(e,{alias:t=>he.V4.types.ExampleTypeShape.alias({value:bZ(t.value)}),object:t=>he.V4.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:bZ(r.value),originalTypeDeclaration:Y5(r.originalTypeDeclaration)}))}),union:t=>he.V4.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:he.V5.types.ExampleSingleUnionTypeProperties._visit(t.properties,{samePropertiesAsObject:r=>he.V4.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:Y5(r.typeName),shape:l5o(r.shape)}),singleProperty:r=>he.V4.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:r.jsonExample,shape:IG0(r.shape)}),noProperties:he.V4.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+t.properties.type)}})}),enum:t=>he.V4.types.ExampleTypeShape.enum({wireValue:t.wireValue}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function NG0({service:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,displayName:e.displayName,name:WcB(e.name),basePath:HcB(e.basePath),basePathV2:e.basePath,endpoints:e.endpoints.map(r=>$cB({endpoint:r,errorResolver:t})),headers:e.headers.map(r=>C9i(r)),pathParameters:e.pathParameters.map(r=>FG0(r))}}function WcB(e){return{name:e.name.pascalCase.unsafeName,fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath)}}function HcB(e){return e.parts.reduce((t,r)=>t+`{${r.pathParameter}}`+r.tail,e.head)}function $cB({endpoint:e,errorResolver:t}){return{docs:e.docs,availability:e.availability,id:e.name.originalName,name:iLt(e.name),nameV2:D2(e.name),displayName:e.displayName,method:e.method,headers:e.headers.map(r=>C9i(r)),path:e.path,pathParameters:e.pathParameters.map(r=>FG0(r)),queryParameters:e.queryParameters.map(r=>GcB(r)),requestBody:e.requestBody!=null?QcB(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?JcB(e.sdkRequest):void 0,response:KcB(e.response),errors:e.errors.map(r=>YcB(r)),errorsV2:XcB({responseErrors:e.errors,errorResolver:t}),auth:e.auth,examples:e.examples.map(r=>elB(r))}}function FG0(e){return{docs:e.docs,availability:e.availability,name:iLt(e.name),nameV2:D2(e.name),valueType:_z(e.valueType)}}function GcB(e){return{docs:e.docs,availability:e.availability,name:WDe(e.name),nameV2:E2(e.name),valueType:_z(e.valueType),allowMultiple:e.allowMultiple}}function QcB(e){return he.V5.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V4.services.http.HttpRequestBody.inlinedRequestBody({name:D2(t.name),extends:t.extends.map(r=>Y5(r)),properties:t.properties.map(r=>({docs:r.docs,name:E2(r.name),valueType:_z(r.valueType)}))}),reference:t=>he.V4.services.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:_z(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.type)}})}function JcB(e){return{requestParameterName:D2(e.requestParameterName),shape:he.V5.http.SdkRequestShape._visit(e.shape,{justRequestBody:t=>he.V4.services.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:_z(t.requestBodyType)}),wrapper:t=>he.V4.services.http.SdkRequestShape.wrapper({wrapperName:D2(t.wrapperName),bodyKey:D2(t.bodyKey)}),_unknown:()=>{throw new Error("Unknown SdkRequestShape type: "+e.shape.type)}})}}function KcB(e){let t=e.type!=null?_z(e.type):void 0;return{docs:e.docs,type:t??he.V4.types.TypeReference.void(),typeV2:t}}function YcB(e){return{docs:e.docs,error:HTc(e.error)}}function XcB({responseErrors:e,errorResolver:t}){return{discriminant:{originalValue:"errorName",camelCase:"errorName",snakeCase:"error_name",pascalCase:"ErrorName",screamingSnakeCase:"ERROR_NAME",wireValue:"errorName"},types:e.map(r=>ZcB({responseError:r,errorResolver:t}))}}function ZcB({responseError:e,errorResolver:t}){let r=t.getDeclaration(e.error);return{docs:e.docs,discriminantValue:WDe(r.discriminantValue),shape:kcB({responseError:e,declaration:r})}}function kcB({responseError:e,declaration:t}){return t.type==null?he.V4.services.commons.ResponseErrorShape.noProperties():he.V4.services.commons.ResponseErrorShape.singleProperty({name:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"},error:HTc(e.error)})}function HTc(e){return{name:e.name.originalName,nameV2:iLt(e.name),nameV3:D2(e.name),fernFilepath:q9i(e.fernFilepath),fernFilepathV2:T9i(e.fernFilepath)}}function elB(e){return{docs:e.docs,name:e.name?.originalName,servicePathParameters:e.servicePathParameters.map(t=>zG0(t)),endpointPathParameters:e.endpointPathParameters.map(t=>zG0(t)),serviceHeaders:e.serviceHeaders.map(t=>RG0(t)),endpointHeaders:e.endpointHeaders.map(t=>RG0(t)),queryParameters:e.queryParameters.map(t=>tlB(t)),request:e.request!=null?rlB(e.request):void 0,response:nlB(e.response)}}function zG0(e){return{key:e.key,value:bZ(e.value)}}function RG0(e){return{wireKey:e.wireKey,value:bZ(e.value)}}function tlB(e){return{wireKey:e.wireKey,value:bZ(e.value)}}function rlB(e){return he.V5.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V4.services.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>ilB(r))}),reference:t=>he.V4.services.http.ExampleRequestBody.reference(bZ(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function ilB(e){return{wireKey:e.wireKey,value:bZ(e.value),originalTypeDeclaration:e.originalTypeDeclaration!=null?Y5(e.originalTypeDeclaration):void 0}}function nlB(e){return he.V5.http.ExampleResponse._visit(e,{ok:t=>he.V4.services.http.ExampleResponse.ok({body:t.body!=null?bZ(t.body):void 0}),error:t=>he.V4.services.http.ExampleResponse.error({error:HTc(t.error),body:t.body!=null?bZ(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function LG0(e){return{docs:e.docs,availability:e.availability,name:Y5(e.name),shape:alB(e.shape),examples:e.examples.map(t=>olB(t)),referencedTypes:e.referencedTypes.map(t=>Y5(t))}}function alB(e){return he.V5.types.Type._visit(e,{alias:({aliasOf:t,resolvedType:r})=>he.V4.types.Type.alias({aliasOf:_z(t),resolvedType:ulB(r)}),enum:t=>he.V4.types.Type.enum({values:t.values.map(r=>({docs:r.docs,availability:r.availability,name:WDe(r.name),nameV2:E2(r.name),value:r.name.wireValue}))}),object:t=>he.V4.types.Type.object({extends:t.extends.map(r=>Y5(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:WDe(r.name),nameV2:E2(r.name),valueType:_z(r.valueType)}))}),union:t=>he.V4.types.Type.union({discriminant:t.discriminant.wireValue,discriminantV2:WDe(t.discriminant),discriminantV3:E2(t.discriminant),types:t.types.map(r=>({docs:r.docs,discriminantValue:WDe(r.discriminantValue),discriminantValueV2:E2(r.discriminantValue),valueType:he.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>he.V4.types.TypeReference.named(Y5(i)),singleProperty:i=>_z(i.type),noProperties:he.V4.types.TypeReference.void,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}}),shape:he.V5.types.SingleUnionTypeProperties._visit(r.shape,{samePropertiesAsObject:i=>he.V4.types.SingleUnionTypeProperties.samePropertiesAsObject(Y5(i)),singleProperty:i=>he.V4.types.SingleUnionTypeProperties.singleProperty({name:WDe(i.name),nameV2:E2(i.name),type:_z(i.type)}),noProperties:he.V4.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+r.shape._type)}})}))}),_unknown:()=>{throw new Error("Unknown shape: "+e._type)}})}function olB(e){return{docs:e.docs,jsonExample:e.jsonExample,name:e.name?.originalName,shape:l5o(e.shape)}}function ulB(e){return he.V5.types.ResolvedTypeReference._visit(e,{named:t=>he.V4.types.ResolvedTypeReference.named({name:Y5(t.name),shape:slB(t.shape)}),container:t=>he.V4.types.ResolvedTypeReference.container(MMn(t)),primitive:he.V4.types.ResolvedTypeReference.primitive,unknown:he.V4.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function slB(e){return he.V5.types.ShapeType._visit(e,{enum:()=>he.V5.types.ShapeType.Enum,object:()=>he.V5.types.ShapeType.Object,union:()=>he.V5.types.ShapeType.Union,_unknown:()=>{throw new Error("Unknown ShapeType: "+e)}})}var UG0={laterVersion:"v5",earlierVersion:"v4",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.257-2-g46fe4ff",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.33-9-gf683b5e",[J.PYTHON_PYDANTIC]:"0.0.33-9-gf683b5e",[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.STOPLIGHT]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=new c5o(e),r=new s5o(e);return{apiName:e.apiName.originalName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:CG0(e.auth),headers:e.headers.map(i=>C9i(i)),types:e.types.map(i=>LG0(i)),services:{http:e.services.map(i=>NG0({service:i,errorResolver:r})),websocket:[]},errors:e.errors.map(i=>xG0({errorDeclaration:i,errorDiscriminationStrategy:e.errorDiscriminationStrategy,typeReferenceResolver:t})),constants:{errorDiscriminant:"_error",errorInstanceIdKey:"_errorInstanceId",unknownErrorDiscriminantValue:"_unknown"},constantsV2:{errors:{errorInstanceIdKey:WDe(e.constants.errorInstanceIdKey),errorDiscriminant:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR",wireValue:"error"},errorContentKey:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT",wireValue:"content"}},errorsV2:{errorInstanceIdKey:E2(e.constants.errorInstanceIdKey),errorDiscriminant:{name:{unsafeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"},safeName:{originalValue:"error",camelCase:"error",snakeCase:"error",pascalCase:"Error",screamingSnakeCase:"ERROR"}},wireValue:"error"},errorContentKey:{name:{unsafeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"},safeName:{originalValue:"content",camelCase:"content",snakeCase:"content",pascalCase:"Content",screamingSnakeCase:"CONTENT"}},wireValue:"content"}}},defaultEnvironment:e.defaultEnvironment,environments:e.environments.map(i=>BG0(i)),errorDiscriminant:e.errorDiscriminationStrategy.type==="property"?D2(e.errorDiscriminationStrategy.discriminant.name):void 0,errorDiscriminationStrategy:he.V5.ir.ErrorDiscriminationStrategy._visit(e.errorDiscriminationStrategy,{statusCode:he.V4.ir.ErrorDiscriminationStrategy.statusCode,property:i=>he.V4.ir.ErrorDiscriminationStrategy.property({discriminant:E2(i.discriminant),contentProperty:E2(i.contentProperty)}),_unknown:()=>{throw new Error("Unknown ErrorDiscriminationStrategy: "+e.errorDiscriminationStrategy.type)}}),sdkConfig:e.sdkConfig}}};var VG0={laterVersion:"v6",earlierVersion:"v5",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.257-4-ge56e5d2",[J.TYPESCRIPT_EXPRESS]:"0.0.264",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.35-1-g071a04a",[J.PYTHON_PYDANTIC]:"0.0.35-1-g071a04a",[J.OPENAPI]:"0.0.16-1-ga2c0ada",[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,defaultEnvironment:e.environments?.defaultEnvironment,environments:e.environments!=null?he.V6.environment.Environments._visit(e.environments.environments,{singleBaseUrl:i=>i.environments,multipleBaseUrls:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying multiple URLs for a single environment. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a multiple URls for a single environment."),_unknown:()=>{throw new Error("Unknown Environments: "+e.environments?.environments.type)}}):[]})};var WG0={laterVersion:"v7",earlierVersion:"v6",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.268",[J.TYPESCRIPT_EXPRESS]:"0.0.268",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.OPENAPI_PYTHON_CLIENT]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:e.services.map(t=>{let r=t.name.fernFilepath[t.name.fernFilepath.length-1],i=r!=null?`${r.pascalCase.safeName}Service`:"Service",n=r!=null?`${r.camelCase.unsafeName}Service`:"Service",a=r!=null?`${r.snakeCase.unsafeName}_service`:"service",u=a.toUpperCase(),l=q3(n);return{...t,name:{name:{originalName:i,camelCase:{safeName:n,unsafeName:n},snakeCase:{safeName:a,unsafeName:a},screamingSnakeCase:{safeName:u,unsafeName:u},pascalCase:{safeName:l,unsafeName:l}},fernFilepath:t.name.fernFilepath}}})})};var GG0={laterVersion:"v8",earlierVersion:"v7",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.0.273-5-g1b00245b",[J.TYPESCRIPT_EXPRESS]:"0.0.273-5-g1b00245b",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.45-1-g8bb600f",[J.PYTHON_PYDANTIC]:"0.0.45-1-g8bb600f",[J.OPENAPI_PYTHON_CLIENT]:"0.0.0",[J.OPENAPI]:"0.0.20-1-gbbeb9bd",[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,auth:clB(e.auth),headers:e.headers.map(t=>f5o(t)),types:e.types.map(t=>llB(t)),errors:e.errors.map(t=>vlB(t)),services:e.services.map(t=>blB(t))})};function $Tc(e){return e.allParts}function clB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V7.auth.AuthScheme.header(f5o(t)))}}function f5o(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:XG(e.valueType)}}function XG(e){return he.V8.types.TypeReference._visit(e,{container:t=>he.V7.types.TypeReference.container(QG0(t)),named:t=>he.V7.types.TypeReference.named(nLt(t)),primitive:he.V7.types.TypeReference.primitive,unknown:he.V7.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function QG0(e){return he.V8.types.ContainerType._visit(e,{list:t=>he.V7.types.ContainerType.list(XG(t)),optional:t=>he.V7.types.ContainerType.optional(XG(t)),set:t=>he.V7.types.ContainerType.set(XG(t)),map:({keyType:t,valueType:r})=>he.V7.types.ContainerType.map({keyType:XG(t),valueType:XG(r)}),literal:he.V7.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function nLt(e){return{name:e.name,fernFilepath:$Tc(e.fernFilepath)}}function llB(e){return{docs:e.docs,availability:e.availability,name:nLt(e.name),shape:flB(e.shape),examples:e.examples.map(t=>hlB(t)),referencedTypes:e.referencedTypes.map(t=>nLt(t))}}function flB(e){return he.V8.types.Type._visit(e,{alias:t=>he.V7.types.Type.alias({aliasOf:XG(t.aliasOf),resolvedType:dlB(t.resolvedType)}),enum:he.V7.types.Type.enum,object:t=>he.V7.types.Type.object({extends:t.extends.map(r=>nLt(r)),properties:t.properties.map(r=>({docs:r.docs,availability:r.availability,name:r.name,valueType:XG(r.valueType)}))}),union:t=>he.V7.types.Type.union({discriminant:t.discriminant,types:t.types.map(r=>plB(r))}),_unknown:()=>{throw new Error("Unknown Type shape: "+e._type)}})}function dlB(e){return he.V8.types.ResolvedTypeReference._visit(e,{container:t=>he.V7.types.ResolvedTypeReference.container(QG0(t)),named:t=>he.V7.types.ResolvedTypeReference.named({name:nLt(t.name),shape:t.shape}),primitive:he.V7.types.ResolvedTypeReference.primitive,unknown:he.V7.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function plB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:_lB(e.shape)}}function _lB(e){return he.V8.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V7.types.SingleUnionTypeProperties.samePropertiesAsObject(nLt(t)),singleProperty:t=>he.V7.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:XG(t.type)}),noProperties:he.V7.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function hlB(e){return{jsonExample:e.jsonExample,docs:e.docs,name:e.name,shape:GTc(e.shape)}}function GTc(e){return he.V8.types.ExampleTypeShape._visit(e,{alias:t=>he.V7.types.ExampleTypeShape.alias({value:eae(t.value)}),enum:he.V7.types.ExampleTypeShape.enum,object:t=>he.V7.types.ExampleTypeShape.object({properties:t.properties.map(r=>({wireKey:r.wireKey,value:eae(r.value),originalTypeDeclaration:nLt(r.originalTypeDeclaration)}))}),union:t=>he.V7.types.ExampleTypeShape.union({wireDiscriminantValue:t.wireDiscriminantValue,properties:ylB(t.properties)}),_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function eae(e){return{jsonExample:e.jsonExample,shape:JG0(e.shape)}}function JG0(e){return he.V8.types.ExampleTypeReferenceShape._visit(e,{named:t=>he.V7.types.ExampleTypeReferenceShape.named({typeName:nLt(t.typeName),shape:GTc(t.shape)}),container:t=>he.V7.types.ExampleTypeReferenceShape.container(he.V8.types.ExampleContainer._visit(t,{list:r=>he.V7.types.ExampleContainer.list(r.map(i=>eae(i))),set:r=>he.V7.types.ExampleContainer.set(r.map(i=>eae(i))),optional:r=>he.V7.types.ExampleContainer.optional(r!=null?eae(r):void 0),map:r=>he.V7.types.ExampleContainer.map(r.map(i=>({key:eae(i.key),value:eae(i.value)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+t.type)}})),primitive:he.V7.types.ExampleTypeReferenceShape.primitive,unknown:he.V7.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function ylB(e){return he.V8.types.ExampleSingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V7.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:nLt(t.typeName),shape:GTc(t.shape)}),singleProperty:t=>he.V7.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:t.jsonExample,shape:JG0(t.shape)}),noProperties:he.V7.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+e.type)}})}function vlB(e){return{docs:e.docs,name:QTc(e.name),discriminantValue:e.discriminantValue,type:e.type!=null?XG(e.type):void 0,statusCode:e.statusCode}}function QTc(e){return{name:e.name,fernFilepath:$Tc(e.fernFilepath)}}function blB(e){return{docs:e.docs,availability:e.availability,name:{fernFilepath:$Tc(e.name.fernFilepath)},displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>KG0(t)),headers:e.headers.map(t=>f5o(t)),endpoints:e.endpoints.map(t=>glB(t))}}function KG0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:XG(e.valueType)}}function glB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors.map(t=>OlB(t)),auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>KG0(t)),sdkRequest:e.sdkRequest!=null?PlB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?wlB(e.requestBody):void 0,response:SlB(e.response),headers:e.headers.map(t=>f5o(t)),queryParameters:e.queryParameters.map(t=>mlB(t)),examples:e.examples.map(t=>DlB(t))}}function OlB(e){return{docs:e.docs,error:QTc(e.error)}}function mlB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:XG(e.valueType),allowMultiple:e.allowMultiple}}function PlB(e){return{requestParameterName:e.requestParameterName,shape:jlB(e.shape)}}function jlB(e){return he.V8.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V7.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:XG(t.requestBodyType)}),wrapper:he.V7.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function wlB(e){return he.V8.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V7.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends.map(r=>nLt(r)),properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:XG(r.valueType)}))}),reference:t=>he.V7.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:XG(t.requestBodyType)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function SlB(e){return{docs:e.docs,type:e.type!=null?XG(e.type):void 0}}function DlB(e){return{name:e.name,docs:e.docs,servicePathParameters:e.servicePathParameters.map(t=>HG0(t)),endpointPathParameters:e.endpointPathParameters.map(t=>HG0(t)),queryParameters:e.queryParameters.map(t=>ElB(t)),serviceHeaders:e.serviceHeaders.map(t=>$G0(t)),endpointHeaders:e.endpointHeaders.map(t=>$G0(t)),request:e.request!=null?MlB(e.request):void 0,response:AlB(e.response)}}function HG0(e){return{key:e.key,value:eae(e.value)}}function ElB(e){return{wireKey:e.wireKey,value:eae(e.value)}}function $G0(e){return{wireKey:e.wireKey,value:eae(e.value)}}function MlB(e){return he.V8.http.ExampleRequestBody._visit(e,{inlinedRequestBody:t=>he.V7.http.ExampleRequestBody.inlinedRequestBody({jsonExample:t.jsonExample,properties:t.properties.map(r=>({wireKey:r.wireKey,value:eae(r.value),originalTypeDeclaration:r.originalTypeDeclaration!=null?nLt(r.originalTypeDeclaration):void 0}))}),reference:t=>he.V7.http.ExampleRequestBody.reference(eae(t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function AlB(e){return he.V8.http.ExampleResponse._visit(e,{ok:t=>he.V7.http.ExampleResponse.ok({body:t.body!=null?eae(t.body):void 0}),error:t=>he.V7.http.ExampleResponse.error({error:QTc(t.error),body:t.body!=null?eae(t.body):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}var YG0={laterVersion:"v9",earlierVersion:"v8",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.3.0-2-g85e8aa08",[J.TYPESCRIPT_EXPRESS]:"0.3.0-2-g85e8aa08",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-4-gef1ec4f",[J.JAVA_SDK]:"0.0.134-4-gef1ec4f",[J.JAVA_SPRING]:"0.0.134-4-gef1ec4f",[J.PYTHON_FASTAPI]:"0.0.51-1-g977dd1f",[J.PYTHON_PYDANTIC]:"0.0.51-1-g977dd1f",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:ii,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))n.shape._type==="union"&&n.shape.baseProperties.length>0&&t.failWithoutThrowing(r!=null?`Type ${n.name.name.originalName} uses base-properties. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a union with base-properties.");return t.getResult()===dC.Failure&&t.failAndThrow(),{...e,types:Object.values(e.types),errors:Object.values(e.errors),services:Object.values(e.services)}}};var XG0={laterVersion:"v10",earlierVersion:"v9",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:ii,[J.OPENAPI]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.services,r=>({docs:void 0,...r}));for(let r of Object.values(e.subpackages))if(r.docs!=null&&r.service!=null){let i=t[r.service];if(i==null)throw new Error("Service does not exist: "+r.service);i.docs=r.docs}return{...e,services:t}}};var ZG0={laterVersion:"v11",earlierVersion:"v10",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.0-rc0-1-g83a12940",[J.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-1-g83a12940",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.0.134-15-ge1ac358",[J.JAVA_SDK]:"0.0.134-15-ge1ac358",[J.JAVA_SPRING]:"0.0.134-15-ge1ac358",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:ii,[J.OPENAPI]:$e,[J.POSTMAN]:"0.0.40-1-g9aa2117",[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,auth:qlB(e.auth,t)})};function qlB(e,t){return{...e,schemes:e.schemes.map(r=>TlB(r,t))}}function TlB(e,{taskContext:t,targetGenerator:r}){return he.V11.auth.AuthScheme._visit(e,{bearer:he.V10.auth.AuthScheme.bearer,basic:he.V10.auth.AuthScheme.basic,header:i=>i.prefix!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying an auth header prefix. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an auth header prefix."):he.V10.auth.AuthScheme.header({docs:i.docs,availability:{status:he.V10.commons.AvailabilityStatus.GeneralAvailability,message:void 0},name:{name:i.name,wireValue:i.header},valueType:i.valueType}),_unknown:()=>{throw new Error("Unknown auth scheme: "+e._type)}})}var eQ0={laterVersion:"v12",earlierVersion:"v11",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.0-rc0-6-g80f89f98",[J.TYPESCRIPT_EXPRESS]:"0.5.0-rc0-6-g80f89f98",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.1.0-1-gdb5c636",[J.JAVA_SDK]:"0.1.0-1-gdb5c636",[J.JAVA_SPRING]:"0.1.0-1-gdb5c636",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.STOPLIGHT]:"0.0.23-8-g479c860",[J.OPENAPI]:"0.0.22-1-g1c86b58",[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{let i=od(e.types,n=>({...n,shape:he.V12.types.Type._visit(n.shape,{union:he.V11.types.Type.union,enum:he.V11.types.Type.enum,object:he.V11.types.Type.object,alias:a=>he.V11.types.Type.alias({aliasOf:a.aliasOf,resolvedType:he.V12.types.ResolvedTypeReference._visit(a.resolvedType,{container:he.V11.types.ResolvedTypeReference.container,primitive:he.V11.types.ResolvedTypeReference.primitive,named:u=>u.shape==="UNDISCRIMINATED_UNION"?t.failAndThrow(kG0({taskContext:t,targetGenerator:r})):he.V11.types.ResolvedTypeReference.named({shape:u.shape,name:u.name}),unknown:he.V11.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Encountered unknown alias")}})}),undiscriminatedUnion:()=>t.failAndThrow(kG0({taskContext:t,targetGenerator:r})),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,types:i,services:od(e.services,n=>ClB(n,{taskContext:t,targetGenerator:r}))}}};function kG0(e){return e.targetGenerator!=null?`Generator ${e.targetGenerator.name}@${e.targetGenerator.version} does not support undiscriminated unions If you'd like to use this feature, please upgrade ${e.targetGenerator.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains an undiscriminated union."}function ClB(e,t){return{...e,endpoints:e.endpoints.map(r=>BlB(r,t))}}function BlB(e,{taskContext:t,targetGenerator:r}){return e.streamingResponse!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a streaming response."):{...e,requestBody:e.requestBody!=null?he.V12.http.HttpRequestBody._visit(e.requestBody,{inlinedRequestBody:he.V11.http.HttpRequestBody.inlinedRequestBody,reference:he.V11.http.HttpRequestBody.reference,fileUpload:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support file upload requests. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a file upload request."),_unknown:()=>{throw new Error("Unknown HttpRequestBody type: "+e.requestBody?.type)}}):void 0,response:e.response!=null?{docs:e.response.docs,type:e.response.responseBodyType}:{docs:void 0,type:void 0}}}var tQ0={laterVersion:"v13",earlierVersion:"v12",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,types:od(e.types,t=>t.shape._type!=="undiscriminatedUnion"?{...t,shape:t.shape}:{...t,shape:he.V12.types.Type.undiscriminatedUnion({docs:void 0,members:t.shape.members})}),auth:{...e.auth,schemes:e.auth.schemes.map(t=>t._type!=="header"?t:{...t,name:t.name.name,header:t.name.wireValue})}})};var rQ0={laterVersion:"v14",earlierVersion:"v13",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:ii,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V14.types.Type._visit(r.shape,{union:i=>he.V13.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:MF(n.valueType)})),types:i.types.map(n=>zlB(n))}),enum:he.V13.types.Type.enum,object:i=>he.V13.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:MF(n.valueType)}))}),alias:i=>he.V13.types.Type.alias({aliasOf:MF(i.aliasOf),resolvedType:NlB(i.resolvedType)}),undiscriminatedUnion:i=>he.V13.types.Type.undiscriminatedUnion(FlB(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:xlB(e.auth),headers:e.headers.map(r=>YTc(r)),types:t,services:od(e.services,r=>LlB(r)),errors:od(e.errors,r=>QlB(r))}}};function xlB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V13.auth.AuthScheme.header(IlB(t)))}}function IlB(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:MF(e.valueType)}}function YTc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:MF(e.valueType)}}function MF(e){return he.V14.types.TypeReference._visit(e,{container:t=>he.V13.types.TypeReference.container(iQ0(t)),primitive:t=>t==="DATE"?he.V13.types.TypeReference.primitive(he.V13.types.PrimitiveType.String):he.V13.types.TypeReference.primitive(t),named:he.V13.types.TypeReference.named,unknown:he.V13.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function iQ0(e){return he.V14.types.ContainerType._visit(e,{list:t=>he.V13.types.ContainerType.list(MF(t)),optional:t=>he.V13.types.ContainerType.optional(MF(t)),set:t=>he.V13.types.ContainerType.set(MF(t)),map:({keyType:t,valueType:r})=>he.V13.types.ContainerType.map({keyType:MF(t),valueType:MF(r)}),literal:he.V13.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function zlB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:RlB(e.shape)}}function RlB(e){return he.V14.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V13.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V13.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:MF(t.type)}),noProperties:he.V13.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function NlB(e){return he.V14.types.ResolvedTypeReference._visit(e,{container:t=>he.V13.types.ResolvedTypeReference.container(iQ0(t)),named:he.V13.types.ResolvedTypeReference.named,primitive:t=>t==="DATE"?he.V13.types.ResolvedTypeReference.primitive(he.V13.types.PrimitiveType.String):he.V13.types.ResolvedTypeReference.primitive(t),unknown:he.V13.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function FlB(e){return{members:e.members.map(t=>({...t,type:MF(t.type)}))}}function LlB(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>nQ0(t)),headers:e.headers.map(t=>YTc(t)),endpoints:e.endpoints.map(t=>UlB(t))}}function nQ0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:MF(e.valueType)}}function UlB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>nQ0(t)),sdkRequest:e.sdkRequest!=null?WlB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?$lB(e.requestBody):void 0,response:e.response!=null?JTc(e.response):void 0,headers:e.headers.map(t=>YTc(t)),queryParameters:e.queryParameters.map(t=>VlB(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?KTc(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?GlB(e.sdkResponse):void 0}}function VlB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:MF(e.valueType),allowMultiple:e.allowMultiple}}function WlB(e){return{requestParameterName:e.requestParameterName,shape:HlB(e.shape)}}function HlB(e){return he.V14.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V13.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:MF(t.requestBodyType)}),wrapper:he.V13.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function $lB(e){return he.V14.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V13.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:MF(r.valueType)}))}),reference:t=>he.V13.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:MF(t.requestBodyType)}),fileUpload:t=>he.V13.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:MF(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function JTc(e){return{docs:e.docs,responseBodyType:MF(e.responseBodyType)}}function KTc(e){return{dataEventType:MF(e.dataEventType),terminator:e.terminator}}function GlB(e){return he.V14.http.SdkResponse._visit(e,{streaming:t=>he.V13.http.SdkResponse.streaming(KTc(t)),nonStreaming:t=>he.V13.http.SdkResponse.nonStreaming(JTc(t)),maybeStreaming:t=>he.V13.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:JTc(t.nonStreaming),streaming:KTc(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function QlB(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?MF(e.type):void 0,statusCode:e.statusCode}}var aQ0={laterVersion:"v15",earlierVersion:"v14",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.0.52-3-gd9df38df",[J.PYTHON_PYDANTIC]:"0.0.52-3-gd9df38df",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.0.52-3-gd9df38df",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V15.types.Type._visit(r.shape,{union:i=>he.V14.types.Type.union({discriminant:i.discriminant,baseProperties:i.baseProperties.map(n=>({...n,valueType:AF(n.valueType)})),types:i.types.map(n=>YlB(n))}),enum:he.V14.types.Type.enum,object:i=>he.V14.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:AF(n.valueType)}))}),alias:i=>he.V14.types.Type.alias({aliasOf:AF(i.aliasOf),resolvedType:ZlB(i.resolvedType)}),undiscriminatedUnion:i=>he.V14.types.Type.undiscriminatedUnion(klB(i)),_unknown:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:JlB(e.auth),headers:e.headers.map(r=>kTc(r)),types:t,services:od(e.services,r=>efB(r)),errors:od(e.errors,r=>ufB(r))}}};function JlB(e){return{docs:e.docs,requirement:e.requirement,schemes:e.schemes.map(t=>t._type!=="header"?t:he.V14.auth.AuthScheme.header(KlB(t)))}}function KlB(e){return{docs:e.docs,prefix:e.prefix,name:e.name,valueType:AF(e.valueType)}}function kTc(e){return{docs:e.docs,availability:e.availability,name:e.name,valueType:AF(e.valueType)}}function AF(e){return he.V15.types.TypeReference._visit(e,{container:t=>he.V14.types.TypeReference.container(oQ0(t)),primitive:t=>t==="BASE_64"?he.V14.types.TypeReference.primitive(he.V14.types.PrimitiveType.String):he.V14.types.TypeReference.primitive(t),named:he.V14.types.TypeReference.named,unknown:he.V14.types.TypeReference.unknown,_unknown:()=>{throw new Error("Unknown type reference: "+e._type)}})}function oQ0(e){return he.V15.types.ContainerType._visit(e,{list:t=>he.V14.types.ContainerType.list(AF(t)),optional:t=>he.V14.types.ContainerType.optional(AF(t)),set:t=>he.V14.types.ContainerType.set(AF(t)),map:({keyType:t,valueType:r})=>he.V14.types.ContainerType.map({keyType:AF(t),valueType:AF(r)}),literal:he.V14.types.ContainerType.literal,_unknown:()=>{throw new Error("Unknown ContainerType: "+e._type)}})}function YlB(e){return{docs:e.docs,discriminantValue:e.discriminantValue,shape:XlB(e.shape)}}function XlB(e){return he.V15.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V14.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V14.types.SingleUnionTypeProperties.singleProperty({name:t.name,type:AF(t.type)}),noProperties:he.V14.types.SingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown SingleUnionTypeProperties: "+e._type)}})}function ZlB(e){return he.V15.types.ResolvedTypeReference._visit(e,{container:t=>he.V14.types.ResolvedTypeReference.container(oQ0(t)),named:he.V14.types.ResolvedTypeReference.named,primitive:t=>t==="BASE_64"?he.V14.types.ResolvedTypeReference.primitive(he.V14.types.PrimitiveType.String):he.V14.types.ResolvedTypeReference.primitive(t),unknown:he.V14.types.ResolvedTypeReference.unknown,_unknown:()=>{throw new Error("Unknown ResolvedTypeReference: "+e._type)}})}function klB(e){return{members:e.members.map(t=>({...t,type:AF(t.type)}))}}function efB(e){return{availability:e.availability,name:e.name,displayName:e.displayName,basePath:e.basePath,baseUrl:e.baseUrl,pathParameters:e.pathParameters.map(t=>uQ0(t)),headers:e.headers.map(t=>kTc(t)),endpoints:e.endpoints.map(t=>tfB(t))}}function uQ0(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:AF(e.valueType)}}function tfB(e){return{docs:e.docs,availability:e.availability,name:e.name,displayName:e.displayName,errors:e.errors,auth:e.auth,method:e.method,path:e.path,pathParameters:e.pathParameters.map(t=>uQ0(t)),sdkRequest:e.sdkRequest!=null?ifB(e.sdkRequest):void 0,requestBody:e.requestBody!=null?afB(e.requestBody):void 0,response:e.response!=null?XTc(e.response):void 0,headers:e.headers.map(t=>kTc(t)),queryParameters:e.queryParameters.map(t=>rfB(t)),examples:e.examples,streamingResponse:e.streamingResponse!=null?ZTc(e.streamingResponse):void 0,sdkResponse:e.sdkResponse!=null?ofB(e.sdkResponse):void 0}}function rfB(e){return{availability:e.availability,docs:e.docs,name:e.name,valueType:AF(e.valueType),allowMultiple:e.allowMultiple}}function ifB(e){return{requestParameterName:e.requestParameterName,shape:nfB(e.shape)}}function nfB(e){return he.V15.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V14.http.SdkRequestShape.justRequestBody({docs:t.docs,requestBodyType:AF(t.requestBodyType)}),wrapper:he.V14.http.SdkRequestShape.wrapper,_unknown:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function afB(e){return he.V15.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V14.http.HttpRequestBody.inlinedRequestBody({name:t.name,extends:t.extends,properties:t.properties.map(r=>({docs:r.docs,name:r.name,valueType:AF(r.valueType)}))}),reference:t=>he.V14.http.HttpRequestBody.reference({docs:t.docs,requestBodyType:AF(t.requestBodyType)}),fileUpload:t=>he.V14.http.HttpRequestBody.fileUpload({name:t.name,properties:t.properties.map(r=>r.type==="bodyProperty"?{...r,valueType:AF(r.valueType)}:r)}),_unknown:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function XTc(e){return{docs:e.docs,responseBodyType:AF(e.responseBodyType)}}function ZTc(e){return{dataEventType:AF(e.dataEventType),terminator:e.terminator}}function ofB(e){return he.V15.http.SdkResponse._visit(e,{streaming:t=>he.V14.http.SdkResponse.streaming(ZTc(t)),nonStreaming:t=>he.V14.http.SdkResponse.nonStreaming(XTc(t)),maybeStreaming:t=>he.V14.http.SdkResponse.maybeStreaming({condition:t.condition,nonStreaming:XTc(t.nonStreaming),streaming:ZTc(t.streaming)}),_unknown:()=>{throw new Error("Encountered unknown sdk response")}})}function ufB(e){return{docs:e.docs,name:e.name,discriminantValue:e.discriminantValue,type:e.type!=null?AF(e.type):void 0,statusCode:e.statusCode}}var sQ0={laterVersion:"v16",earlierVersion:"v15",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.4-1-g4e69d312",[J.TYPESCRIPT_EXPRESS]:"0.5.4-1-g4e69d312",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.3.8-rc6-1-gcf4b372",[J.JAVA_SDK]:"0.3.8-rc6-1-gcf4b372",[J.JAVA_SPRING]:"0.3.8-rc6-1-gcf4b372",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>e.basePath!=null?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support specifying a base-path in api.yml. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains a root base-path."):{...e,services:od(e.services,i=>({...i,pathParameters:eCc(i.pathParameters),endpoints:i.endpoints.map(n=>({...n,allPathParameters:eCc(n.allPathParameters),pathParameters:eCc(n.pathParameters)}))}))}};function eCc(e){return e.map(t=>sfB(t))}function sfB(e){return{...e,availability:{status:he.V15.commons.AvailabilityStatus.GeneralAvailability,message:void 0}}}var cQ0={laterVersion:"v17",earlierVersion:"v16",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>{for(let[i,n]of Object.entries(e.types))if(n.shape._type==="union"&&n.shape.extends.length>0)return t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support union types with extensions. See ${i} in file ${n.name.fernFilepath.allParts.join("/")}. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains union types with extensions.");return{...e}}};var lQ0={laterVersion:"v18",earlierVersion:"v17",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.14-1-ga6817141",[J.TYPESCRIPT_EXPRESS]:"0.5.14-1-ga6817141",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.3.0-3-ge125e311",[J.PYTHON_PYDANTIC]:"0.3.0-3-ge125e311",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.3.0-3-ge125e311",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,{taskContext:t,targetGenerator:r})=>({...e,services:od(e.services,i=>{let n=i.endpoints[0]?.baseUrl;return i.endpoints.some(a=>a.baseUrl!==n)?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support endpoint-level server URLs. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains endpoint-level server URLs."):{...i,baseUrl:n}})})};var dQ0={laterVersion:"v19",earlierVersion:"v18",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:ii,[J.TYPESCRIPT_BROWSER_SDK]:ii,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.19-1-gef223230",[J.TYPESCRIPT_EXPRESS]:"0.5.19-1-gef223230",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.3.4-rc0-9-ge815162f",[J.PYTHON_PYDANTIC]:"0.3.4-rc0-9-ge815162f",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:"0.0.44-1-gbf4b0f3",[J.PYTHON_SDK]:"0.3.4-rc0-9-ge815162f",[J.GO_FIBER]:ii,[J.GO_MODEL]:ii,[J.GO_SDK]:ii,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>cfB(r,t)),types:od(e.types,r=>hfB(r,t))})};function cfB(e,t){return{...e,endpoints:e.endpoints.map(r=>lfB(r,t))}}function lfB(e,t){return{...e,examples:e.examples.map(r=>ffB(r,t))}}function ffB(e,t){return{docs:e.docs,name:e.name,url:e.url,rootPathParameters:e.rootPathParameters.map(r=>tCc(r,t)),servicePathParameters:e.servicePathParameters.map(r=>tCc(r,t)),endpointPathParameters:e.endpointPathParameters.map(r=>tCc(r,t)),serviceHeaders:e.serviceHeaders.map(r=>fQ0(r,t)),endpointHeaders:e.endpointHeaders.map(r=>fQ0(r,t)),queryParameters:e.queryParameters.map(r=>dfB(r,t)),request:e.request!=null?pfB(e.request,t):void 0,response:_fB(e.response,t)}}function tCc(e,t){return{key:e.key,value:tae(e.value,t)}}function fQ0(e,t){return{wireKey:e.wireKey,value:tae(e.value,t)}}function dfB(e,t){return{wireKey:e.wireKey,value:tae(e.value,t)}}function pfB(e,t){return he.V19.http.ExampleRequestBody._visit(e,{inlinedRequestBody:r=>he.V18.http.ExampleRequestBody.inlinedRequestBody({jsonExample:r.jsonExample,properties:r.properties.map(i=>({wireKey:i.wireKey,value:tae(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),reference:r=>he.V18.http.ExampleRequestBody.reference(tae(r,t)),_unknown:()=>{throw new Error("Unknown ExampleRequestBody: "+e.type)}})}function _fB(e,t){return he.V19.http.ExampleResponse._visit(e,{ok:r=>he.V18.http.ExampleResponse.ok({body:r.body!=null?tae(r.body,t):void 0}),error:r=>he.V18.http.ExampleResponse.error({error:r.error,body:r.body!=null?tae(r.body,t):void 0}),_unknown:()=>{throw new Error("Unknown ExampleResponse: "+e.type)}})}function hfB(e,t){return{...e,examples:e.examples.map(r=>yfB(r,t))}}function yfB(e,t){return{...e,shape:rCc(e.shape,t)}}function rCc(e,t){return he.V19.types.ExampleTypeShape._visit(e,{alias:r=>he.V18.types.ExampleTypeShape.alias({value:tae(r.value,t)}),object:r=>he.V18.types.ExampleTypeShape.object({properties:r.properties.map(i=>({wireKey:i.wireKey,value:tae(i.value,t),originalTypeDeclaration:i.originalTypeDeclaration}))}),union:r=>he.V18.types.ExampleTypeShape.union({wireDiscriminantValue:r.wireDiscriminantValue,properties:he.V19.types.ExampleSingleUnionTypeProperties._visit(r.properties,{singleProperty:i=>he.V18.types.ExampleSingleUnionTypeProperties.singleProperty({jsonExample:i.jsonExample,shape:pQ0(i.shape,t)}),samePropertiesAsObject:i=>he.V18.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:i.typeName,shape:rCc(i.shape,t)}),noProperties:he.V18.types.ExampleSingleUnionTypeProperties.noProperties,_unknown:()=>{throw new Error("Unknown ExampleSingleUnionTypeProperties: "+r.properties.type)}})}),enum:he.V18.types.ExampleTypeShape.enum,_unknown:()=>{throw new Error("Unknown ExampleTypeShape: "+e.type)}})}function tae(e,t){return{jsonExample:e.jsonExample,shape:pQ0(e.shape,t)}}function pQ0(e,t){return he.V19.types.ExampleTypeReferenceShape._visit(e,{primitive:r=>he.V18.types.ExampleTypeReferenceShape.primitive(vfB(r,t)),named:r=>he.V18.types.ExampleTypeReferenceShape.named({typeName:r.typeName,shape:rCc(r.shape,t)}),container:r=>he.V18.types.ExampleTypeReferenceShape.container(he.V19.types.ExampleContainer._visit(r,{list:i=>he.V18.types.ExampleContainer.list(i.map(n=>tae(n,t))),set:i=>he.V18.types.ExampleContainer.set(i.map(n=>tae(n,t))),optional:i=>he.V18.types.ExampleContainer.optional(i!=null?tae(i,t):void 0),map:i=>he.V18.types.ExampleContainer.map(i.map(n=>({key:tae(n.key,t),value:tae(n.value,t)}))),_unknown:()=>{throw new Error("Unknown ExampleContainer: "+r.type)}})),unknown:he.V18.types.ExampleTypeReferenceShape.unknown,_unknown:()=>{throw new Error("Unknown ExampleTypeReferenceShape: "+e.type)}})}function vfB(e,{taskContext:t,targetGenerator:r}){return e.type==="date"?t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support examples for dates. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains date examples."):e}var _Q0={laterVersion:"v20",earlierVersion:"v19",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.5.26-rc0-3-gdfabd674",[J.TYPESCRIPT_BROWSER_SDK]:"0.5.26-rc0-3-gdfabd674",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.5.20-3-g2505487f",[J.TYPESCRIPT_EXPRESS]:"0.5.20-3-g2505487f",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.3.10-rc2-1-g1c0d853",[J.JAVA_SDK]:"0.3.10-rc2-1-g1c0d853",[J.JAVA_SPRING]:"0.3.10-rc2-1-g1c0d853",[J.PYTHON_FASTAPI]:"0.3.6-rc1-2-g6050f7f8",[J.PYTHON_PYDANTIC]:"0.3.6-rc1-2-g6050f7f8",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.3.6-rc1-2-g6050f7f8",[J.GO_FIBER]:ii,[J.GO_MODEL]:"0.0.0",[J.GO_SDK]:"0.0.0",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>bfB(r,t))})};function bfB(e,t){return{...e,endpoints:e.endpoints.map(r=>gfB(r,t))}}function gfB(e,t){return{...e,response:e.response!=null?hQ0(e.response,t):void 0,sdkResponse:e.sdkResponse!=null?OfB(e.sdkResponse,t):void 0}}function hQ0(e,t){return he.V20.http.HttpResponse._visit(e,{fileDownload:()=>yQ0(t),json:r=>r,_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.type)}})}function OfB(e,t){return he.V20.http.SdkResponse._visit(e,{fileDownload:()=>yQ0(t),streaming:he.V19.http.SdkResponse.streaming,maybeStreaming:r=>he.V19.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:r.streaming,nonStreaming:hQ0(r.nonStreaming,t)}),json:he.V19.http.SdkResponse.nonStreaming,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}function yQ0({targetGenerator:e,taskContext:t}){return t.failAndThrow(e!=null?`Generator ${e.name}@${e.version} does not support file download. If you'd like to use this feature, please upgrade ${e.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains file download.")}var vQ0={laterVersion:"v21",earlierVersion:"v20",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:ii,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>({...e,services:od(e.services,r=>mfB(r,t))})};function mfB(e,t){return{...e,endpoints:e.endpoints.map(r=>PfB(r,t))}}function PfB(e,t){return{...e,streamingResponse:e.streamingResponse!=null?iCc(e.streamingResponse,t):void 0,sdkResponse:e.sdkResponse!=null?jfB(e.sdkResponse,t):void 0}}function iCc(e,{taskContext:t,targetGenerator:r}){return{dataEventType:he.V21.http.StreamingResponseChunkType._visit(e.dataEventType,{json:i=>i,text:()=>t.failAndThrow(r!=null?`Generator ${r.name}@${r.version} does not support streaming text responses. If you'd like to use this feature, please upgrade ${r.name} to a compatible version.`:"Cannot backwards-migrate IR because this IR contains streaming text responses."),_unknown:()=>{throw new Error("Unknown StreamingResponseChunkType: "+e.dataEventType.type)}}),terminator:e.terminator}}function jfB(e,t){return he.V21.http.SdkResponse._visit(e,{fileDownload:he.V20.http.SdkResponse.fileDownload,streaming:r=>he.V20.http.SdkResponse.streaming(iCc(r,t)),maybeStreaming:r=>he.V20.http.SdkResponse.maybeStreaming({condition:r.condition,streaming:iCc(r.streaming,t),nonStreaming:r.nonStreaming}),json:he.V20.http.SdkResponse.json,_unknown:()=>{throw new Error("Unknown SdkResponse: "+e.type)}})}var bQ0={laterVersion:"v22",earlierVersion:"v21",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.5.0-3-gac7ce7c",[J.GO_MODEL]:"0.0.14-8-g2fa39f7",[J.GO_SDK]:"0.0.14-8-g2fa39f7",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:e=>({...e,services:od(e.services,t=>wfB(t))})};function wfB(e){return{...e,endpoints:e.endpoints.map(t=>SfB(t))}}function SfB(e){return{...e,...e.response!=null?he.V22.http.HttpResponse._visit(e.response,{json:t=>({response:he.V21.http.HttpResponse.json(t),streamingResponse:void 0,sdkResponse:he.V21.http.SdkResponse.json(t)}),fileDownload:t=>({response:he.V21.http.HttpResponse.fileDownload(t),streamingResponse:void 0,sdkResponse:he.V21.http.SdkResponse.fileDownload(t)}),streaming:t=>({response:void 0,streamingResponse:t,sdkResponse:he.V21.http.SdkResponse.streaming(t)}),_unknown:()=>{throw new Error("Unknown HttpResponse: "+e.response?.type)}}):{response:void 0,streamingResponse:void 0,sdkResponse:void 0}}}var mQ0={laterVersion:"v23",earlierVersion:"v22",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.7.4-rc3-4-g6cf92f81",[J.TYPESCRIPT_BROWSER_SDK]:"0.7.4-rc3-4-g6cf92f81",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.7.4-rc3-4-g6cf92f81",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:"0.0.28-3-g112d3dd",[J.STOPLIGHT]:"0.0.28-3-g112d3dd",[J.POSTMAN]:"0.0.44-4-gddab2ae",[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>e,migrateBackwards:(e,t)=>{let r=[],i={};for(let[n,a]of Object.entries(e.services)){let u=[];for(let l of a.endpoints){let d=DfB(l);d==null?r.push(l):u.push(d)}i[n]={...a,endpoints:u,headers:a.headers.map(l=>aCc(l)),pathParameters:a.pathParameters.map(l=>d5o(l))}}return r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(n=>n.name.originalName).join(", ")} will be skipped.`)),{...e,auth:{...e.auth,schemes:e.auth.schemes.map(n=>MfB(n))},headers:e.headers.map(n=>aCc(n)),types:od(e.types,n=>AfB(n)),services:i,errors:od(e.errors,n=>IfB(n)),subpackages:e.subpackages,pathParameters:e.pathParameters.map(n=>d5o(n)),variables:e.variables.map(n=>zfB(n))}}};function DfB(e){let t;if(!(e.requestBody!=null&&(t=EfB(e.requestBody),t==null)))return{...e,headers:e.headers.map(r=>aCc(r)),pathParameters:e.pathParameters.map(r=>d5o(r)),allPathParameters:e.allPathParameters.map(r=>d5o(r)),queryParameters:e.queryParameters.map(r=>RfB(r)),requestBody:t,sdkRequest:e.sdkRequest!=null?{requestParameterName:e.sdkRequest.requestParameterName,shape:NfB(e.sdkRequest.shape)}:void 0,response:e.response!=null?FfB(e.response):void 0,examples:e.examples.map(r=>LfB(r))}}function EfB(e){switch(e.type){case"bytes":return;case"fileUpload":return he.V22.http.HttpRequestBody.fileUpload({...e,properties:e.properties.map(t=>VfB(t))});case"inlinedRequestBody":return he.V22.http.HttpRequestBody.inlinedRequestBody({...e,properties:e.properties.map(t=>WfB(t))});case"reference":return he.V22.http.HttpRequestBody.reference({...e,requestBodyType:qF(e.requestBodyType)});default:Ko(e)}}function aCc(e){return{...e,valueType:qF(e.valueType)}}function MfB(e){return e._visit({bearer:he.V22.auth.AuthScheme.bearer,basic:he.V22.auth.AuthScheme.basic,header:t=>he.V22.auth.AuthScheme.header({...t,valueType:qF(t.valueType)}),_other:()=>{throw new Error("Unknown auth scheme: "+e.type)}})}function AfB(e){return{...e,shape:qfB(e.shape),examples:e.examples.map(t=>TfB(t))}}function qfB(e){return e._visit({alias:t=>he.V22.types.Type.alias({...t,aliasOf:qF(t.aliasOf),resolvedType:BfB(t.resolvedType)}),enum:he.V22.types.Type.enum,object:t=>he.V22.types.Type.object({...t,properties:t.properties.map(r=>gQ0(r))}),union:t=>he.V22.types.Type.union({...t,baseProperties:t.baseProperties.map(r=>gQ0(r)),types:t.types.map(r=>({...r,shape:xfB(r.shape)}))}),undiscriminatedUnion:t=>he.V22.types.Type.undiscriminatedUnion({...t,members:t.members.map(r=>({...r,type:qF(r.type)}))}),_other:()=>{throw new Error("Unknown type shape: "+e.type)}})}function TfB(e){return{...e,shape:oCc(e.shape)}}function oCc(e){return e._visit({alias:t=>he.V22.types.ExampleTypeShape.alias({...t,value:HDe(t.value)}),enum:he.V22.types.ExampleTypeShape.enum,object:t=>he.V22.types.ExampleTypeShape.object({...t,properties:t.properties.map(r=>({...r,value:HDe(r.value)}))}),union:t=>he.V22.types.ExampleTypeShape.union({...t,properties:CfB(t.properties)}),_other:()=>{throw new Error("Unknown example type shape: "+e.type)}})}function HDe(e){return{...e,shape:uCc(e.shape)}}function uCc(e){return e._visit({primitive:t=>he.V22.types.ExampleTypeReferenceShape.primitive(t._visit({integer:he.V22.types.ExamplePrimitive.integer,double:he.V22.types.ExamplePrimitive.double,string:he.V22.types.ExamplePrimitive.string,boolean:he.V22.types.ExamplePrimitive.boolean,long:he.V22.types.ExamplePrimitive.long,datetime:r=>he.V22.types.ExamplePrimitive.datetime(r.toISOString()),date:he.V22.types.ExamplePrimitive.date,uuid:he.V22.types.ExamplePrimitive.uuid,_other:()=>{throw new Error("Unknown example primitive: "+t.type)}})),named:t=>he.V22.types.ExampleTypeReferenceShape.named({...t,shape:oCc(t.shape)}),container:t=>he.V22.types.ExampleTypeReferenceShape.container(t._visit({list:r=>he.V22.types.ExampleContainer.list(r.map(i=>HDe(i))),set:r=>he.V22.types.ExampleContainer.set(r.map(i=>HDe(i))),optional:r=>he.V22.types.ExampleContainer.optional(r!=null?HDe(r):void 0),map:r=>he.V22.types.ExampleContainer.map(r.map(i=>({key:HDe(i.key),value:HDe(i.value)}))),_other:()=>{throw new Error("Unknown example container: "+t.type)}})),unknown:he.V22.types.ExampleTypeReferenceShape.unknown,_other:()=>{throw new Error("Unknown example type reference shape: "+e.type)}})}function CfB(e){return e._visit({singleProperty:t=>he.V22.types.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:uCc(t.shape)}),noProperties:he.V22.types.ExampleSingleUnionTypeProperties.noProperties,samePropertiesAsObject:t=>he.V22.types.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,shape:oCc(t.shape)}),_other:()=>{throw new Error("Unknown example single union type properties: "+e.type)}})}function qF(e){return e._visit({container:t=>he.V22.types.TypeReference.container(PQ0(t)),primitive:he.V22.types.TypeReference.primitive,named:he.V22.types.TypeReference.named,unknown:he.V22.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function PQ0(e){return e._visit({list:t=>he.V22.types.ContainerType.list(qF(t)),set:t=>he.V22.types.ContainerType.set(qF(t)),optional:t=>he.V22.types.ContainerType.optional(qF(t)),map:t=>he.V22.types.ContainerType.map({keyType:qF(t.keyType),valueType:qF(t.valueType)}),literal:he.V22.types.ContainerType.literal,_other:()=>{throw new Error("Unknown container type: "+e.type)}})}function BfB(e){return e._visit({container:t=>he.V22.types.ResolvedTypeReference.container(PQ0(t)),primitive:he.V22.types.ResolvedTypeReference.primitive,named:he.V22.types.ResolvedTypeReference.named,unknown:he.V22.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown resolved type reference: "+e.type)}})}function gQ0(e){return{...e,valueType:qF(e.valueType)}}function xfB(e){return e._visit({noProperties:he.V22.types.SingleUnionTypeProperties.noProperties,singleProperty:t=>he.V22.types.SingleUnionTypeProperties.singleProperty({...t,type:qF(t.type)}),samePropertiesAsObject:he.V22.types.SingleUnionTypeProperties.samePropertiesAsObject,_other:()=>{throw new Error("Unknown single union type properties: "+e.propertiesType)}})}function IfB(e){return{...e,type:e.type!=null?qF(e.type):void 0}}function zfB(e){return{...e,type:qF(e.type)}}function d5o(e){return{...e,valueType:qF(e.valueType)}}function RfB(e){return{...e,valueType:qF(e.valueType)}}function NfB(e){return e._visit({justRequestBody:t=>he.V22.http.SdkRequestShape.justRequestBody({...t,requestBodyType:qF(t.requestBodyType)}),wrapper:he.V22.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SDK request shape: "+e.type)}})}function FfB(e){return e._visit({json:t=>he.V22.http.HttpResponse.json({...t,responseBodyType:qF(t.responseBodyType)}),fileDownload:he.V22.http.HttpResponse.fileDownload,streaming:t=>he.V22.http.HttpResponse.streaming({...t,dataEventType:t.dataEventType._visit({json:r=>he.V22.http.StreamingResponseChunkType.json(qF(r)),text:he.V22.http.StreamingResponseChunkType.text,_other:()=>{throw new Error("Unknown streaming data event type: "+t.dataEventType.type)}})}),_other:()=>{throw new Error("Unknown response: "+e.type)}})}function LfB(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>nCc(t)),servicePathParameters:e.servicePathParameters.map(t=>nCc(t)),endpointPathParameters:e.endpointPathParameters.map(t=>nCc(t)),serviceHeaders:e.serviceHeaders.map(t=>OQ0(t)),endpointHeaders:e.endpointHeaders.map(t=>OQ0(t)),queryParameters:e.queryParameters.map(t=>UfB(t)),request:e.request!=null?e.request._visit({inlinedRequestBody:t=>he.V22.http.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,value:HDe(r.value)}))}),reference:t=>he.V22.http.ExampleRequestBody.reference({...t,shape:uCc(t.shape)}),_other:()=>{throw new Error("Unknown example request body: "+e.request?.type)}}):void 0,response:e.response._visit({ok:t=>he.V22.http.ExampleResponse.ok({...t,body:t.body!=null?HDe(t.body):void 0}),error:t=>he.V22.http.ExampleResponse.error({...t,body:t.body!=null?HDe(t.body):void 0}),_other:()=>{throw new Error("Unknown example response: "+e.response.type)}})}}function nCc(e){return{...e,value:HDe(e.value)}}function UfB(e){return{...e,value:HDe(e.value)}}function OQ0(e){return{...e,value:HDe(e.value)}}function VfB(e){return e._visit({file:he.V22.http.FileUploadRequestProperty.file,bodyProperty:t=>he.V22.http.FileUploadRequestProperty.bodyProperty({...t,valueType:qF(t.valueType)}),_other:()=>{throw new Error("Unknown file upload request body property: "+e.type)}})}function WfB(e){return{...e,valueType:qF(e.valueType)}}var W_={};Io(W_,{V23:()=>W8F,V24:()=>H8F,V25:()=>$8F,V26:()=>G8F,V27:()=>Q8F,V28:()=>J8F,V29:()=>K8F,V30:()=>Y8F,V31:()=>X8F,V32:()=>Z8F,V33:()=>k8F,V34:()=>e5F,V35:()=>t5F,V36:()=>r5F,V37:()=>i5F,V38:()=>n5F,V39:()=>a5F,V40:()=>o5F,V41:()=>u5F,V42:()=>s5F,V43:()=>c5F,V44:()=>l5F,V45:()=>f5F,V46:()=>d5F,V47:()=>p5F,V48:()=>_5F,V49:()=>h5F,V50:()=>y5F,V51:()=>v5F,V52:()=>b5F,V53:()=>g5F,V54:()=>O5F,V55:()=>m5F,V56:()=>t_});var W8F=vi(Eo(),1),H8F=vi(so(),1),$8F=vi(Za(),1),G8F=vi(Ja(),1),Q8F=vi(Ua(),1),J8F=vi(Va(),1),K8F=vi(Wa(),1),Y8F=vi(Ia(),1),X8F=vi(xa(),1),Z8F=vi(Oa(),1),k8F=vi(Wn(),1),e5F=vi(Vn(),1),t5F=vi(Tn(),1),r5F=vi(Cn(),1),i5F=vi(qn(),1),n5F=vi(Dn(),1),a5F=vi(ln(),1),o5F=vi(fn(),1),u5F=vi(sn(),1),s5F=vi(tn(),1),c5F=vi(en(),1),l5F=vi(Zi(),1),f5F=vi($i(),1),d5F=vi(Li(),1),p5F=vi(Fi(),1),_5F=vi(Ri(),1),h5F=vi(xi(),1),y5F=vi(Ai(),1),v5F=vi(Ei(),1),b5F=vi(gi(),1),g5F=vi(Gt(),1),O5F=vi(kh(),1),m5F=vi(Ih(),1);var i_P={laterVersion:"v24",earlierVersion:"v23",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V23.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e})};var n_P={laterVersion:"v25",earlierVersion:"v24",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:"0.4.9-1-ge0997b3",[J.JAVA_SDK]:"0.4.9-1-ge0997b3",[J.JAVA_SPRING]:"0.4.9-1-ge0997b3",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V24.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:(e,t)=>{let r=[],i=[],n={};for(let[a,u]of Object.entries(e.services)){let l=[];for(let d of u.endpoints){let s;if(d.sdkRequest!=null&&(s=P5F(d.sdkRequest),s==null)){r.push(d);continue}if(d.response!=null){let o=d.response._visit({fileDownload:c=>he.V24.HttpResponse.fileDownload(c),json:c=>he.V24.HttpResponse.json(c),streaming:c=>he.V24.HttpResponse.streaming(c),text:()=>(i.push(d),he.V24.HttpResponse.json({docs:void 0,responseBodyType:he.V24.TypeReference.unknown()})),_other:()=>{throw new Error("Encountered unknown response type")}});l.push({...d,sdkRequest:s,response:o})}else l.push({...d,sdkRequest:s,response:void 0})}n[a]={...u,endpoints:l}}return i.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support text/plain responses. `),i.length===1&&i[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${i[0].name.originalName} response type will be casted to unknown.`):t.taskContext.logger.warn(`Therefore, endpoints ${i.map(a=>a.name.originalName).join(", ")} response types will be casted to unknown.`)),r.length>0&&(t.taskContext.logger.warn(`Generator ${t.targetGenerator?.name}@${t.targetGenerator?.version} does not support bytes requests. `),r.length===1&&r[0]!=null?t.taskContext.logger.warn(`Therefore, endpoint ${r[0].name.originalName} will be skipped.`):t.taskContext.logger.warn(`Therefore, endpoints ${r.map(a=>a.name.originalName).join(", ")} will be skipped.`)),{...e,services:n}}};function P5F(e){let t=e.shape;if(t.type==="wrapper")return{shape:he.V24.SdkRequestShape.wrapper({...t}),requestParameterName:e.requestParameterName};if(t.value.type==="typeReference")return{shape:he.V24.SdkRequestShape.justRequestBody({...t.value}),requestParameterName:e.requestParameterName}}var o_P={laterVersion:"v26",earlierVersion:"v25",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.5.0-rc2-16-g4177fafd",[J.PYTHON_PYDANTIC]:"0.5.0-rc2-16-g4177fafd",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.5.0-rc2-16-g4177fafd",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V25.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,E5F(r)])),headers:e.headers.map(t=>yHu(t)),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,r.map(i=>j5F(i))])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,w5F(r)]))})};function j5F(e){return{...e,headers:e.headers.map(t=>yHu(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function w5F(e){return{...e,endpoints:e.endpoints.map(t=>S5F(t)),headers:e.headers.map(t=>yHu(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function S5F(e){return{...e,headers:e.headers.map(t=>yHu(t)),queryParameters:e.queryParameters.map(t=>D5F(t)),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function yHu(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function D5F(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function E5F(e){return{...e,shape:e.shape._visit({union:t=>he.V25.Type.union({...t,baseProperties:t.baseProperties.map(r=>a_P(r))}),object:t=>he.V25.Type.object({...t,properties:t.properties.map(r=>a_P(r))}),enum:t=>he.V25.Type.enum({...t,values:t.values.map(r=>M5F(r))}),alias:t=>he.V25.Type.alias(t),undiscriminatedUnion:t=>he.V25.Type.undiscriminatedUnion(t),_other:()=>{throw new Error("Encountered unknown shape")}}),availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function a_P(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}function M5F(e){return{...e,availability:e.availability==null?{status:he.V25.AvailabilityStatus.GeneralAvailability,message:void 0}:e.availability}}var u_P={laterVersion:"v27",earlierVersion:"v26",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.6.1-3-g94ee67a",[J.GO_MODEL]:"0.6.1-3-g94ee67a",[J.GO_SDK]:"0.6.1-3-g94ee67a",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V26.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,A5F(r)]))})};function A5F(e){return{...e,endpoints:e.endpoints.map(t=>q5F(t))}}function q5F(e){return{...e,response:e.response!=null?T5F(e.response):void 0}}function T5F(e){if(e.type!=="json")return e;let t=e.value;return t.type==="response"?he.V26.HttpResponse.json(t):he.V26.HttpResponse.json({docs:t.docs,responseBodyType:t.responseBodyType})}var s_P={laterVersion:"v28",earlierVersion:"v27",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.1-1-g0f40bf18",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.1-1-g0f40bf18",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.1-1-g0f40bf18",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.9.0-2-g6b0be0e",[J.GO_MODEL]:"0.9.0-2-g6b0be0e",[J.GO_SDK]:"0.9.0-2-g6b0be0e",[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V27.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip"}),migrateBackwards:e=>({...e,auth:o9F(e.auth),headers:bHu(e.headers),types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,f9F(r)])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,U5F(r)])),webhookGroups:Object.fromEntries(Object.entries(e.webhookGroups).map(([t,r])=>[t,I5F(r)])),errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,x5F(r)])),pathParameters:vHu(e.pathParameters),variables:C5F(e.variables)})};function C5F(e){return e.map(t=>B5F(t))}function B5F(e){return{...e,type:WR(e.type)}}function x5F(e){return{...e,type:e.type!=null?WR(e.type):void 0}}function I5F(e){return e.map(t=>z5F(t))}function z5F(e){return{...e,headers:bHu(e.headers),payload:R5F(e.payload)}}function R5F(e){switch(e.type){case"inlinedPayload":return he.V27.WebhookPayload.inlinedPayload(N5F(e));case"reference":return he.V27.WebhookPayload.reference({...e,payloadType:WR(e.payloadType)})}}function N5F(e){return{...e,properties:F5F(e.properties)}}function F5F(e){return e.map(t=>L5F(t))}function L5F(e){return{...e,valueType:WR(e.valueType)}}function U5F(e){return{...e,endpoints:V5F(e.endpoints),headers:bHu(e.headers),pathParameters:vHu(e.pathParameters)}}function V5F(e){return e.map(t=>W5F(t))}function W5F(e){return{...e,headers:bHu(e.headers),pathParameters:vHu(e.pathParameters),allPathParameters:vHu(e.allPathParameters),queryParameters:n9F(e.queryParameters),requestBody:e.requestBody!=null?X5F(e.requestBody):void 0,sdkRequest:e.sdkRequest!=null?J5F(e.sdkRequest):void 0,response:e.response!=null?H5F(e.response):void 0}}function H5F(e){switch(e.type){case"json":return he.V27.HttpResponse.json(Q5F(e.value));case"fileDownload":return he.V27.HttpResponse.fileDownload(e);case"text":return he.V27.HttpResponse.text(e);case"streaming":return he.V27.HttpResponse.streaming($5F(e));default:Ko(e)}}function $5F(e){return{...e,dataEventType:G5F(e.dataEventType)}}function G5F(e){switch(e.type){case"json":return he.V27.StreamingResponseChunkType.json(WR(e.json));case"text":return he.V27.StreamingResponseChunkType.text();default:Ko(e)}}function Q5F(e){switch(e.type){case"response":return he.V27.JsonResponse.response({...e,responseBodyType:WR(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V27.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:WR(e.responseBodyType),responseProperty:e.responseProperty!=null?d_P(e.responseProperty):void 0});default:Ko(e)}}function J5F(e){return{...e,shape:K5F(e.shape)}}function K5F(e){switch(e.type){case"justRequestBody":return he.V27.SdkRequestShape.justRequestBody(Y5F(e.value));case"wrapper":return he.V27.SdkRequestShape.wrapper(e);default:Ko(e)}}function Y5F(e){switch(e.type){case"typeReference":return he.V27.SdkRequestBodyType.typeReference(c_P(e));case"bytes":return he.V27.SdkRequestBodyType.bytes(e);default:Ko(e)}}function X5F(e){switch(e.type){case"inlinedRequestBody":return he.V27.HttpRequestBody.inlinedRequestBody(t9F(e));case"reference":return he.V27.HttpRequestBody.reference(c_P(e));case"fileUpload":return he.V27.HttpRequestBody.fileUpload(Z5F(e));case"bytes":return he.V27.HttpRequestBody.bytes(e);default:Ko(e)}}function Z5F(e){return{...e,properties:k5F(e.properties)}}function k5F(e){return e.map(t=>e9F(t))}function e9F(e){switch(e.type){case"file":return he.V27.FileUploadRequestProperty.file(e);case"bodyProperty":return he.V27.FileUploadRequestProperty.bodyProperty(l_P(e));default:Ko(e)}}function c_P(e){return{...e,requestBodyType:WR(e.requestBodyType)}}function t9F(e){return{...e,properties:r9F(e.properties)}}function r9F(e){return e.map(t=>l_P(t))}function l_P(e){return{...e,valueType:WR(e.valueType)}}function vHu(e){return e.map(t=>i9F(t))}function i9F(e){return{...e,valueType:WR(e.valueType)}}function n9F(e){return e.map(t=>a9F(t))}function a9F(e){return{...e,valueType:WR(e.valueType)}}function o9F(e){return{...e,schemes:u9F(e.schemes)}}function u9F(e){return e.map(t=>s9F(t))}function s9F(e){switch(e.type){case"basic":return he.V27.AuthScheme.basic(e);case"bearer":return he.V27.AuthScheme.bearer(e);case"header":return c9F(e);default:Ko(e)}}function c9F(e){return he.V27.AuthScheme.header({...e,valueType:WR(e.valueType)})}function bHu(e){return e.map(t=>l9F(t))}function l9F(e){return{...e,valueType:WR(e.valueType)}}function f9F(e){return{...e,shape:d9F(e.shape)}}function d9F(e){switch(e.type){case"alias":return he.V27.Type.alias(p9F(e));case"enum":return he.V27.Type.enum(e);case"object":return he.V27.Type.object(_9F(e));case"union":return he.V27.Type.union(h9F(e));case"undiscriminatedUnion":return he.V27.Type.undiscriminatedUnion(y9F(e));default:Ko(e)}}function p9F(e){return{aliasOf:WR(e.aliasOf),resolvedType:O9F(e.resolvedType)}}function _9F(e){return{...e,properties:f_P(e.properties)}}function h9F(e){return{...e,types:v9F(e.types),baseProperties:f_P(e.baseProperties)}}function y9F(e){return{members:g9F(e.members)}}function f_P(e){return e.map(t=>d_P(t))}function d_P(e){return{...e,valueType:WR(e.valueType)}}function v9F(e){return e.map(t=>({...t,shape:b9F(t.shape)}))}function b9F(e){switch(e.propertiesType){case"samePropertiesAsObject":return he.V27.SingleUnionTypeProperties.samePropertiesAsObject(e);case"singleProperty":return he.V27.SingleUnionTypeProperties.singleProperty({name:e.name,type:WR(e.type)});case"noProperties":return he.V27.SingleUnionTypeProperties.noProperties();default:Ko(e)}}function g9F(e){return e.map(t=>({...t,type:WR(t.type)}))}function O9F(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?he.V27.ResolvedTypeReference.primitive(he.V27.PrimitiveType.Boolean):he.V27.ResolvedTypeReference.container(he.V27.ContainerType.literal(he.V27.Literal.string(e.container.literal.string))):he.V27.ResolvedTypeReference.container(p_P(e.container));case"named":return he.V27.ResolvedTypeReference.named(e);case"primitive":return he.V27.ResolvedTypeReference.primitive(e.primitive);case"unknown":return he.V27.ResolvedTypeReference.unknown();default:Ko(e)}}function WR(e){switch(e.type){case"container":return e.container.type==="literal"?e.container.literal.type==="boolean"?he.V27.TypeReference.primitive(he.V27.PrimitiveType.Boolean):he.V27.TypeReference.container(he.V27.ContainerType.literal(he.V27.Literal.string(e.container.literal.string))):he.V27.TypeReference.container(p_P(e.container));case"named":return he.V27.TypeReference.named(e);case"primitive":return he.V27.TypeReference.primitive(e.primitive);case"unknown":return he.V27.TypeReference.unknown();default:Ko(e)}}function p_P(e){switch(e.type){case"list":return he.V27.ContainerType.list(WR(e.list));case"map":return he.V27.ContainerType.map({keyType:WR(e.keyType),valueType:WR(e.valueType)});case"optional":return he.V27.ContainerType.optional(WR(e.optional));case"set":return he.V27.ContainerType.set(WR(e.set));case"literal":if(e.literal.type==="boolean")throw new Error("Internal error; failed to transform boolean literal between IR versions");return he.V27.ContainerType.literal(he.V27.Literal.string(e.literal.string));default:Ko(e)}}var h_P={laterVersion:"v29",earlierVersion:"v28",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.6-1-g3d8d8591",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.6-1-g3d8d8591",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.6-1-g3d8d8591",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.5.14-1-ge4bcd98",[J.JAVA_SDK]:"0.5.14-1-ge4bcd98",[J.JAVA_SPRING]:"0.5.14-1-ge4bcd98",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V28.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.keys(e.types).map(t=>[t,m9F({typeId:t,allTypes:e.types})]))})};function m9F({typeId:e,allTypes:t}){let r=__P({typeId:e,allTypes:t});return{availability:r.availability,docs:r.docs,name:r.name,shape:r.shape,examples:r.examples,referencedTypes:Array.from(r.referencedTypes).map(i=>{let n=__P({typeId:i,allTypes:t});return{typeId:i,fernFilepath:n.name.fernFilepath,name:n.name.name}})}}function __P({typeId:e,allTypes:t}){let r=t[e];if(r==null)throw new Error(`Type definition for type id ${e} is undefined`);return r}var y_P={laterVersion:"v30",earlierVersion:"v29",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.6.5-1-g0ef31b7a",[J.PYTHON_PYDANTIC]:"0.6.5-1-g0ef31b7a",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.6.5-1-g0ef31b7a",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V29.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new Llf(e);return{...e,types:t.convertTypes(e.types),services:t.convertServices(e.services)}}},Llf=class{ir;constructor(t){this.ir=t}convertTypes(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertType(i)]))}convertServices(t){return Object.fromEntries(Object.entries(t).map(([r,i])=>[r,this.convertService(i)]))}convertService(t){return{...t,endpoints:this.convertEndpoints(t.endpoints)}}convertEndpoints(t){return t.map(r=>({...r,examples:this.convertExampleEndpointCalls(r.examples)}))}convertExampleEndpointCalls(t){return t.map(r=>({...r,rootPathParameters:this.convertExamplePathParameters(r.rootPathParameters),servicePathParameters:this.convertExamplePathParameters(r.servicePathParameters),endpointPathParameters:this.convertExamplePathParameters(r.endpointPathParameters),serviceHeaders:this.convertExampleHeaders(r.serviceHeaders),endpointHeaders:this.convertExampleHeaders(r.endpointHeaders),queryParameters:this.convertExampleQueryParameters(r.queryParameters),request:r.request!=null?this.convertExampleRequestBody(r.request):void 0,response:this.convertExampleResponse(r.response)}))}convertExamplePathParameters(t){return t.map(r=>({key:r.name.originalName,value:this.convertExampleTypeReference(r.value)}))}convertExampleHeaders(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleQueryParameters(t){return t.map(r=>({wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}convertExampleRequestBody(t){switch(t.type){case"inlinedRequestBody":return he.V29.ExampleRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))});case"reference":return he.V29.ExampleRequestBody.reference(this.convertExampleTypeReference(t));default:Ko(t)}}convertExampleResponse(t){switch(t.type){case"ok":return he.V29.ExampleResponse.ok({body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});case"error":return he.V29.ExampleResponse.error({...t,body:t.body!=null?this.convertExampleTypeReference(t.body):void 0});default:Ko(t)}}convertType(t){return{...t,examples:this.convertExampleTypes(t.examples)}}convertExampleTypes(t){return t.map(r=>this.convertExampleType(r))}convertExampleType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeReferences(t){return t.map(r=>this.convertExampleTypeReference(r))}convertExampleTypeReference(t){return{...t,shape:this.convertExampleTypeReferenceShape(t.shape)}}convertExampleTypeReferenceShape(t){switch(t.type){case"primitive":return he.V29.ExampleTypeReferenceShape.primitive(this.convertExamplePrimitive(t.primitive));case"container":return he.V29.ExampleTypeReferenceShape.container(this.convertExampleContainer(t.container));case"named":return he.V29.ExampleTypeReferenceShape.named(this.convertExampleNamedType(t));case"unknown":return he.V29.ExampleTypeReferenceShape.unknown(t);default:Ko(t)}}convertExamplePrimitive(t){switch(t.type){case"integer":return he.V29.ExamplePrimitive.integer(t.integer);case"double":return he.V29.ExamplePrimitive.double(t.double);case"string":return he.V29.ExamplePrimitive.string(t.string.original);case"boolean":return he.V29.ExamplePrimitive.boolean(t.boolean);case"long":return he.V29.ExamplePrimitive.long(t.long);case"datetime":return he.V29.ExamplePrimitive.datetime(t.datetime);case"date":return he.V29.ExamplePrimitive.date(t.date);case"uuid":return he.V29.ExamplePrimitive.uuid(t.uuid);default:Ko(t)}}convertExampleContainer(t){switch(t.type){case"list":return he.V29.ExampleContainer.list(this.convertExampleTypeReferences(t.list));case"set":return he.V29.ExampleContainer.set(this.convertExampleTypeReferences(t.set));case"optional":return he.V29.ExampleContainer.optional(t.optional!=null?this.convertExampleTypeReference(t.optional):void 0);case"map":return he.V29.ExampleContainer.map(this.convertKeyValuePairs(t.map));default:Ko(t)}}convertKeyValuePairs(t){return t.map(r=>({key:this.convertExampleTypeReference(r.key),value:this.convertExampleTypeReference(r.value)}))}convertExampleNamedType(t){return{...t,shape:this.convertExampleTypeShape(t.shape)}}convertExampleTypeShape(t){switch(t.type){case"alias":return he.V29.ExampleTypeShape.alias({value:this.convertExampleTypeReference(t.value)});case"enum":return he.V29.ExampleTypeShape.enum({wireValue:t.value.wireValue});case"object":return he.V29.ExampleTypeShape.object(this.convertExampleObjectType(t));case"union":return he.V29.ExampleTypeShape.union(this.convertExampleUnionType(t));default:Ko(t)}}convertExampleObjectType(t){return{properties:t.properties.map(r=>({...r,wireKey:r.name.wireValue,value:this.convertExampleTypeReference(r.value)}))}}convertExampleUnionType(t){return{wireDiscriminantValue:t.singleUnionType.wireDiscriminantValue.wireValue,properties:this.convertExampleSingleUnionTypeProperties(t.singleUnionType.shape)}}convertExampleSingleUnionTypeProperties(t){switch(t.type){case"samePropertiesAsObject":{let r=this.ir.types[t.typeId]?.name;if(r==null)throw new Error(`Internal error; type ID ${t.typeId} does not exist in the IR`);return he.V29.ExampleSingleUnionTypeProperties.samePropertiesAsObject({typeName:r,shape:this.convertExampleTypeShape(he.V30.ExampleTypeShape.object({properties:t.object.properties}))})}case"singleProperty":return he.V29.ExampleSingleUnionTypeProperties.singleProperty({...t,shape:this.convertExampleTypeReferenceShape(t.shape)});case"noProperties":return he.V29.ExampleSingleUnionTypeProperties.noProperties();default:Ko(t)}}};var v_P={laterVersion:"v31",earlierVersion:"v30",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.8.8",[J.TYPESCRIPT_BROWSER_SDK]:"0.8.8",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.8.8",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.7.0-rc0",[J.JAVA_SDK]:"0.7.0-rc0",[J.JAVA_SPRING]:"0.7.0-rc0",[J.PYTHON_FASTAPI]:"0.7.5-1-gb54fb677",[J.PYTHON_PYDANTIC]:"0.7.5-1-gb54fb677",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.7.5-1-gb54fb677",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:ii,[J.RUBY_SDK]:ii,[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V30.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({apiName:e.apiName,apiDisplayName:e.apiDisplayName,apiDocs:e.apiDocs,auth:e.auth,headers:e.headers,types:e.types,webhookGroups:e.webhookGroups,errors:e.errors,subpackages:e.subpackages,rootPackage:e.rootPackage,constants:e.constants,environments:e.environments,basePath:e.basePath,pathParameters:e.pathParameters,errorDiscriminationStrategy:e.errorDiscriminationStrategy,sdkConfig:e.sdkConfig,variables:e.variables,serviceTypeReferenceInfo:e.serviceTypeReferenceInfo,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{availability:r.availability,name:r.name,displayName:r.displayName,basePath:r.basePath,endpoints:r.endpoints.map(i=>({id:i.id,docs:i.docs,availability:i.availability,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,examples:i.examples})),headers:r.headers,pathParameters:r.pathParameters}]))})};var g_P={laterVersion:"v32",earlierVersion:"v31",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.9.4-2-g139cf36",[J.GO_MODEL]:"0.9.4-2-g139cf36",[J.GO_SDK]:"0.9.4-2-g139cf36",[J.RUBY_MODEL]:"0.0.0",[J.RUBY_SDK]:"0.0.0",[J.CSHARP_MODEL]:ii,[J.CSHARP_SDK]:ii,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V31.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:E9F(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(P9F)}]))})};function $en({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function P9F(e){return{...e,examples:$en({examples:e.examples,convert:j9F})}}function j9F(e){let t;if(e.request!=null&&(t=w9F(e.request),t==null))return;let r=S9F(e.response);if(r!=null)return{...e,rootPathParameters:$en({examples:e.rootPathParameters,convert:Ulf}),endpointPathParameters:$en({examples:e.endpointPathParameters,convert:Ulf}),servicePathParameters:$en({examples:e.servicePathParameters,convert:Ulf}),endpointHeaders:$en({examples:e.endpointHeaders,convert:b_P}),serviceHeaders:$en({examples:e.serviceHeaders,convert:b_P}),queryParameters:$en({examples:e.queryParameters,convert:D9F}),request:t,response:r}}function w9F(e){switch(e.type){case"inlinedRequestBody":{let t=[];for(let r of e.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleRequestBody.inlinedRequestBody({...e,properties:t})}case"reference":{let t=Vlf(e.shape);return t==null?void 0:he.V31.ExampleRequestBody.reference({...e,shape:t})}default:Ko(e)}}function S9F(e){switch(e.type){case"ok":{if(e.body==null)return he.V31.ExampleResponse.ok({body:void 0});let t=VPe(e.body);return t==null?void 0:he.V31.ExampleResponse.ok({body:t})}case"error":{if(e.body==null)return he.V31.ExampleResponse.error({...e,body:void 0});let t=VPe(e.body);return t==null?void 0:he.V31.ExampleResponse.error({...e,body:t})}}}function Ulf(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function b_P(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function D9F(e){let t=VPe(e.value);if(t!=null)return{...e,value:t}}function E9F(e){let t=[];for(let r of e){let i=M9F(r);i!=null&&t.push(i)}return t}function M9F(e){let t=O_P(e.shape);if(t!=null)return{...e,shape:t}}function O_P(e){switch(e.type){case"enum":return he.V31.ExampleTypeShape.enum(e);case"alias":{let t=VPe(e.value);return t==null?void 0:he.V31.ExampleTypeShape.alias({value:t})}case"object":{let t=[];for(let r of e.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleTypeShape.object({properties:t})}case"union":{let t=A9F(e.singleUnionType);return t==null?void 0:he.V31.ExampleTypeShape.union({...e,singleUnionType:t})}case"undiscriminatedUnion":return;default:Ko(e)}}function VPe(e){let t=Vlf(e.shape);if(t!=null)return{shape:t,jsonExample:e.jsonExample}}function A9F(e){let t=q9F(e.shape);if(t!=null)return{...e,shape:t}}function q9F(e){switch(e.type){case"noProperties":return he.V31.ExampleSingleUnionTypeProperties.noProperties();case"singleProperty":{let t=Vlf(e.shape);return t==null?void 0:he.V31.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:t})}case"samePropertiesAsObject":{let t=[];for(let r of e.object.properties){let i=VPe(r.value);i!=null&&t.push({...r,value:i})}return he.V31.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:{properties:t}})}default:Ko(e)}}function Vlf(e){switch(e.type){case"container":{let t=T9F(e.container);return t==null?void 0:he.V31.ExampleTypeReferenceShape.container(t)}case"named":{let t=O_P(e.shape);return t==null?void 0:he.V31.ExampleTypeReferenceShape.named({...e,shape:t})}case"primitive":return he.V31.ExampleTypeReferenceShape.primitive(e.primitive);case"unknown":return he.V31.ExampleTypeReferenceShape.unknown(e.unknown);default:Ko(e)}}function T9F(e){switch(e.type){case"list":{let t=[];for(let r of e.list){let i=VPe(r);i!=null&&t.push(i)}return he.V31.ExampleContainer.list(t)}case"set":{let t=[];for(let r of e.set){let i=VPe(r);i!=null&&t.push(i)}return he.V31.ExampleContainer.set(t)}case"map":{let t=[];for(let r of e.map){let i=VPe(r.key),n=VPe(r.value);i!=null&&n!=null&&t.push({key:i,value:n})}return he.V31.ExampleContainer.map(t)}case"optional":{if(e.optional==null)return he.V31.ExampleContainer.optional();let t=VPe(e.optional);return t==null?he.V31.ExampleContainer.optional():he.V31.ExampleContainer.optional(t)}default:Ko(e)}}var m_P={laterVersion:"v33",earlierVersion:"v32",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.12.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.12.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.13.0-3-g8c56a41",[J.GO_MODEL]:"0.13.0-3-g8c56a41",[J.GO_SDK]:"0.13.0-3-g8c56a41",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:"0.0.0",[J.CSHARP_SDK]:"0.0.0",[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V32.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=new Wlf(e);return{...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>t.convertEndpoint(n))}]))}}},Wlf=class{ir;constructor(t){this.ir=t}convertEndpoint(t){return{...t,queryParameters:t.queryParameters.map(r=>this.isTypeReferenceObject(r.valueType)?{...r,valueType:he.V33.TypeReference.container(he.V33.ContainerType.optional(he.V33.TypeReference.primitive("STRING")))}:r),examples:C9F({examples:t.examples,convert:B9F})}}isTypeReferenceObject(t){switch(t.type){case"container":return this.isContainerObject(t.container);case"named":return this.isNamedTypeObject(t);case"primitive":return!1;case"unknown":return!0;default:Ko(t)}}isContainerObject(t){switch(t.type){case"map":case"list":case"set":return!0;case"optional":return this.isTypeReferenceObject(t.optional);case"literal":return!1;default:Ko(t)}}isNamedTypeObject(t){let r=this.ir.types[t.typeId];if(r==null)return!0;switch(r.shape.type){case"alias":return this.isTypeReferenceObject(r.shape.aliasOf);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:Ko(r.shape)}}};function C9F({examples:e,convert:t}){let r=[];for(let i of e){let n=t(i);n!=null&&r.push(n)}return r}function B9F(e){return{...e,queryParameters:e.queryParameters.filter(t=>!Hlf(t.value))}}function Hlf(e){switch(e.shape.type){case"container":return x9F(e.shape.container);case"named":return I9F(e.shape);case"primitive":return!1;case"unknown":return!0;default:Ko(e.shape)}}function x9F(e){switch(e.type){case"map":case"list":case"set":return!0;case"optional":return e.optional!=null&&Hlf(e.optional);default:Ko(e)}}function I9F(e){switch(e.shape.type){case"alias":return Hlf(e.shape.value);case"enum":return!1;case"object":case"union":case"undiscriminatedUnion":return!0;default:Ko(e.shape)}}var mLn=vi(A0c(),1);var P_P={laterVersion:"v34",earlierVersion:"v33",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.10.4",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V33.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,requestBody:n.requestBody?._visit({inlinedRequestBody:a=>mLn.FernIrV33.HttpRequestBody.inlinedRequestBody(a),reference:a=>mLn.FernIrV33.HttpRequestBody.reference(a),fileUpload:a=>mLn.FernIrV33.HttpRequestBody.fileUpload({...a,properties:a.properties.map(u=>(u.type==="file"&&u.value.type==="fileArray"&&t.taskContext.logger.warn(`${n.method} ${n.fullPath.head} accepts a list of files however the ${t.targetGenerator?.name}@${t.targetGenerator?.version} only supports accepting a single file. File an [issue](https://github.com/fern-api/fern/issues) to add request for file arrays in ${t.targetGenerator?.name}@${t.targetGenerator?.version}!`),u.type==="file"?mLn.FernIrV33.FileUploadRequestProperty.file({...u.value}):u))}),bytes:a=>mLn.FernIrV33.HttpRequestBody.bytes(a),_other:a=>{}})}))}]))})};var j_P={laterVersion:"v35",earlierVersion:"v34",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.18.0",[J.GO_MODEL]:"0.18.0",[J.GO_SDK]:"0.18.0",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V34.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({docs:i.docs,availability:i.availability,id:i.id,name:i.name,displayName:i.displayName,method:i.method,headers:i.headers,baseUrl:i.baseUrl,path:i.path,fullPath:i.fullPath,pathParameters:i.pathParameters,allPathParameters:i.allPathParameters,queryParameters:i.queryParameters,requestBody:i.requestBody,sdkRequest:i.sdkRequest,response:i.response,errors:i.errors,auth:i.auth,idempotent:i.idempotent,examples:i.examples}))}]))})};var w_P={laterVersion:"v36",earlierVersion:"v35",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.11.6",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V35.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var S_P={laterVersion:"v37",earlierVersion:"v36",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.13.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.13.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:"0.13.0",[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"0.12.0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V36.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.filter(a=>a.exampleType==="userProvided")}))}]))})};var D_P={laterVersion:"v38",earlierVersion:"v37",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.15.0-rc0",[J.TYPESCRIPT_BROWSER_SDK]:"0.15.0-rc0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.12.0-rc0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.9.0-rc0",[J.PYTHON_PYDANTIC]:"0.9.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"1.2.0-rc0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V37.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?._visit({fileDownload:a=>he.V37.HttpResponse.fileDownload(a),json:a=>he.V37.HttpResponse.json(a),streaming:a=>a._visit({json:u=>he.V37.HttpResponse.streaming({dataEventType:he.V37.StreamingResponseChunkType.json(u.payload),docs:u.docs,terminator:u.terminator}),sse:()=>{},text:u=>he.V37.HttpResponse.streaming({dataEventType:he.V37.StreamingResponseChunkType.text(),docs:u.docs,terminator:void 0}),_other:()=>{}}),text:a=>he.V37.HttpResponse.text(a),_other:()=>{}})}))}]))})};var E_P={laterVersion:"v39",earlierVersion:"v38",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.9.0-rc1",[J.PYTHON_PYDANTIC]:"0.9.0-rc1",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"1.4.0-rc1",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:"0.7.0-rc0",[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V38.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>z9F(r))}})};function z9F(e){switch(e.type){case"basic":return he.V38.AuthScheme.basic(e);case"bearer":return he.V38.AuthScheme.bearer(e);case"header":return he.V38.AuthScheme.header(e);case"oauth":return he.V38.AuthScheme.bearer({docs:e.docs,token:{originalName:"token",camelCase:{unsafeName:"token",safeName:"token"},pascalCase:{unsafeName:"Token",safeName:"Token"},snakeCase:{unsafeName:"token",safeName:"token"},screamingSnakeCase:{unsafeName:"TOKEN",safeName:"TOKEN"}},tokenEnvVar:void 0});default:Ko(e)}}var M_P={laterVersion:"v40",earlierVersion:"v39",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:"0.20.0",[J.GO_MODEL]:"0.20.0",[J.GO_SDK]:"0.20.0",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V39.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e})};var A_P={laterVersion:"v41",earlierVersion:"v40",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V40.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,errors:Object.fromEntries(Object.entries(e.errors).map(([r,i])=>[r,{name:i.name,discriminantValue:i.discriminantValue,type:i.type,statusCode:i.statusCode,docs:i.docs}]))})};var q_P={laterVersion:"v42",earlierVersion:"v41",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:"0.8.0-rc0",[J.JAVA_SDK]:"0.9.0-rc0",[J.JAVA_SPRING]:"0.8.0-rc0",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V41.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,auth:{...e.auth,schemes:e.auth.schemes.map(r=>R9F(r))}})};function R9F(e){switch(e.type){case"basic":return he.V41.AuthScheme.basic(e);case"bearer":return he.V41.AuthScheme.bearer(e);case"header":return he.V41.AuthScheme.header(e);case"oauth":return he.V41.AuthScheme.oauth(N9F(e));default:Ko(e)}}function N9F(e){switch(e.configuration.type){case"clientCredentials":return{...e,configuration:he.V41.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:{...e.configuration.tokenEndpoint,endpointReference:e.configuration.tokenEndpoint.endpointReference.endpointId},refreshEndpoint:e.configuration.refreshEndpoint!=null?{...e.configuration.refreshEndpoint,endpointReference:e.configuration.refreshEndpoint?.endpointReference.endpointId}:void 0})};default:Ko(e.configuration.type)}}var T_P={laterVersion:"v43",earlierVersion:"v42",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.17.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.17.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.13.0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V42.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,response:n.response?.body}))}]))})};var B_P={laterVersion:"v44",earlierVersion:"v43",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V43.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:(e,t)=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([r,i])=>[r,{...i,endpoints:i.endpoints.map(n=>({...n,examples:n.examples.map(a=>F9F({example:a})).filter(u0)}))}]))})};function F9F({example:e}){return e._visit({userProvided:t=>he.V43.HttpEndpointExample.userProvided(C_P({example:t})),generated:t=>he.V43.HttpEndpointExample.generated(C_P({example:t})),_other:()=>{}})}function C_P({example:e}){return{...e,response:L9F({example:e.response})}}function L9F({example:e}){switch(e.type){case"ok":return U9F({example:e.value});case"error":return he.V43.ExampleResponse.error(e);default:Ko(e)}}function U9F({example:e}){switch(e.type){case"body":return he.V43.ExampleResponse.ok({body:e.value});case"sse":return he.V43.ExampleResponse.ok({body:void 0});case"stream":return he.V43.ExampleResponse.ok({body:void 0});default:Ko(e)}}var x_P={laterVersion:"v45",earlierVersion:"v44",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V44.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V45.types.Type._visit(r.shape,{union:i=>he.V44.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Cq(n.valueType)})),types:i.types.map(n=>k9F(n))}),enum:he.V44.types.Type.enum,object:i=>he.V44.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Cq(n.valueType)}))}),alias:i=>he.V44.types.Type.alias({aliasOf:Cq(i.aliasOf),resolvedType:tLF(i.resolvedType)}),undiscriminatedUnion:i=>he.V44.types.Type.undiscriminatedUnion(rLF(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:J9F(e.auth),headers:e.headers.map(r=>PLn(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>PLn(r)),types:t,services:od(e.services,r=>iLF(r)),errors:od(e.errors,r=>gLF(r)),webhookGroups:od(e.webhookGroups,r=>$9F(r)),websocketChannels:od(e.websocketChannels,r=>V9F(r)),pathParameters:e.pathParameters.map(r=>z6a(r)),variables:e.variables.map(r=>nLF(r))}}};function V9F(e){return{...e,headers:e.headers.map(t=>PLn(t)),queryParameters:e.queryParameters.map(t=>R6a(t)),pathParameters:e.pathParameters.map(t=>z6a(t)),messages:e.messages.map(t=>W9F(t))}}function W9F(e){return{...e,body:H9F(e.body)}}function H9F(e){switch(e.type){case"inlinedBody":return he.V44.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Cq(t.valueType)}))});case"reference":return he.V44.websocket.WebSocketMessageBody.reference({...e,bodyType:Cq(e.bodyType)})}}function $9F(e){return e.map(t=>G9F(t))}function G9F(e){return{...e,headers:e.headers.map(t=>PLn(t)),payload:Q9F(e.payload)}}function Q9F(e){switch(e.type){case"reference":return he.V44.webhooks.WebhookPayload.reference({...e,payloadType:Cq(e.payloadType)});case"inlinedPayload":return he.V44.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Cq(t.valueType)}))})}}function J9F(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V44.auth.AuthScheme.basic(t);case"bearer":return he.V44.auth.AuthScheme.bearer(t);case"header":return he.V44.auth.AuthScheme.header(K9F(t));case"oauth":return he.V44.auth.AuthScheme.oauth(Y9F(t))}})}}function K9F(e){return{...e,valueType:Cq(e.valueType)}}function Y9F(e){return{...e,configuration:he.V44.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:X9F(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?Z9F(e.configuration.refreshEndpoint):void 0})}}function X9F(e){return{...e,requestProperties:{clientId:gHu(e.requestProperties.clientId),clientSecret:gHu(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?gHu(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Mei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Mei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Mei(e.responseProperties.refreshToken):void 0}}}function Z9F(e){return{...e,requestProperties:{refreshToken:gHu(e.requestProperties.refreshToken)},responseProperties:{accessToken:Mei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Mei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Mei(e.responseProperties.refreshToken):void 0}}}function PLn(e){return{...e,valueType:Cq(e.valueType)}}function Cq(e){return he.V45.types.TypeReference._visit(e,{container:t=>he.V44.types.TypeReference.container(I_P(t)),primitive:t=>t.v1==="BIG_INTEGER"?he.V44.types.TypeReference.primitive(he.V44.types.PrimitiveType.String):he.V44.types.TypeReference.primitive(t.v1),named:he.V44.types.TypeReference.named,unknown:he.V44.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function I_P(e){return he.V45.types.ContainerType._visit(e,{list:t=>he.V44.types.ContainerType.list(Cq(t)),optional:t=>he.V44.types.ContainerType.optional(Cq(t)),set:t=>he.V44.types.ContainerType.set(Cq(t)),map:({keyType:t,valueType:r})=>he.V44.types.ContainerType.map({keyType:Cq(t),valueType:Cq(r)}),literal:he.V44.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function k9F(e){return{...e,shape:eLF(e.shape)}}function eLF(e){return he.V45.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V44.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V44.types.SingleUnionTypeProperties.singleProperty({...t,type:Cq(t.type)}),noProperties:he.V44.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function tLF(e){return he.V45.types.ResolvedTypeReference._visit(e,{container:t=>he.V44.types.ResolvedTypeReference.container(I_P(t)),named:he.V44.types.ResolvedTypeReference.named,primitive:t=>t.v1==="BIG_INTEGER"?he.V44.types.ResolvedTypeReference.primitive(he.V44.types.PrimitiveType.String):he.V44.types.ResolvedTypeReference.primitive(t.v1),unknown:he.V44.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function rLF(e){return{members:e.members.map(t=>({...t,type:Cq(t.type)}))}}function iLF(e){return{...e,pathParameters:e.pathParameters.map(t=>z6a(t)),headers:e.headers.map(t=>PLn(t)),endpoints:e.endpoints.map(t=>aLF(t))}}function z6a(e){return{...e,valueType:Cq(e.valueType)}}function nLF(e){return{...e,type:Cq(e.type)}}function aLF(e){return{...e,pagination:e.pagination!=null?lLF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>z6a(t)),pathParameters:e.pathParameters.map(t=>z6a(t)),sdkRequest:e.sdkRequest!=null?_LF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?vLF(e.requestBody):void 0,response:e.response!=null?oLF(e.response):void 0,headers:e.headers.map(t=>PLn(t)),queryParameters:e.queryParameters.map(t=>R6a(t))}}function oLF(e){return{...e,body:e.body!=null?uLF(e.body):void 0}}function uLF(e){switch(e.type){case"json":return he.V44.http.HttpResponseBody.json(sLF(e.value));case"fileDownload":return he.V44.http.HttpResponseBody.fileDownload(e);case"text":return he.V44.http.HttpResponseBody.text(e);case"streaming":return he.V44.http.HttpResponseBody.streaming(cLF(e.value))}}function sLF(e){switch(e.type){case"response":return he.V44.http.JsonResponse.response({...e,responseBodyType:Cq(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V44.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Cq(e.responseBodyType),responseProperty:e.responseProperty!=null?$lf(e.responseProperty):void 0})}}function cLF(e){switch(e.type){case"json":return he.V44.http.StreamingResponse.json({...e,payload:Cq(e.payload)});case"text":return he.V44.http.StreamingResponse.text(e);case"sse":return he.V44.http.StreamingResponse.sse({...e,payload:Cq(e.payload)})}}function lLF(e){switch(e.type){case"cursor":return he.V44.http.Pagination.cursor(fLF(e));case"offset":return he.V44.http.Pagination.offset(dLF(e))}}function fLF(e){return{...e,page:R6a(e.page),next:Mei(e.next),results:Mei(e.results)}}function dLF(e){return{...e,page:R6a(e.page),results:Mei(e.results)}}function gHu(e){return{...e,property:pLF(e.property)}}function pLF(e){switch(e.type){case"query":return he.V44.RequestPropertyValue.query(R6a(e));case"body":return he.V44.RequestPropertyValue.body($lf(e))}}function Mei(e){return{...e,property:$lf(e.property)}}function $lf(e){return{...e,valueType:Cq(e.valueType)}}function R6a(e){return{...e,valueType:Cq(e.valueType)}}function _LF(e){return{...e,shape:hLF(e.shape)}}function hLF(e){return he.V45.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V44.http.SdkRequestShape.justRequestBody(yLF(t)),wrapper:he.V44.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function yLF(e){switch(e.type){case"bytes":return he.V44.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V44.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Cq(e.requestBodyType)})}}function vLF(e){return he.V45.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V44.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Cq(r.valueType)}))}),reference:t=>he.V44.http.HttpRequestBody.reference({...t,requestBodyType:Cq(t.requestBodyType)}),fileUpload:t=>he.V44.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V44.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Cq(r.valueType)});case"file":return he.V44.http.FileUploadRequestProperty.file(bLF(r.value))}})}),bytes:t=>he.V44.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function bLF(e){switch(e.type){case"file":return he.V44.http.FileProperty.file(e);case"fileArray":return he.V44.http.FileProperty.fileArray(e)}}function gLF(e){return{...e,type:e.type!=null?Cq(e.type):void 0}}var R_P={laterVersion:"v46",earlierVersion:"v45",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.21.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.21.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.16.0",[J.JAVA]:$e,[J.JAVA_MODEL]:"0.9.0",[J.JAVA_SDK]:"0.10.0",[J.JAVA_SPRING]:"0.9.0",[J.PYTHON_FASTAPI]:"0.10.1",[J.PYTHON_PYDANTIC]:"0.9.1",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"2.9.9",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V45.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,{...r,examples:OLF(r.examples)}])),services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>[t,{...r,endpoints:r.endpoints.map(i=>({...i,examples:mLF(i.examples)}))}])),websocketChannels:e.websocketChannels!=null?Object.fromEntries(Object.entries(e.websocketChannels).map(([t,r])=>[t,{...r,examples:PLF(r.examples)}])):void 0,errors:Object.fromEntries(Object.entries(e.errors).map(([t,r])=>[t,{...r,examples:r.examples.map(i=>({...i,shape:r3(i.shape)}))}]))})};function r3(e){return e.shape._visit({container:t=>({...e,shape:t._visit({list:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.list(r.map(i=>r3(i)))),set:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.set(r.map(i=>r3(i)))),map:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.map(r.map(i=>({key:r3(i.key),value:r3(i.value)})))),optional:r=>he.V45.ExampleTypeReferenceShape.container(he.V45.ExampleContainer.optional(r!=null?r3(r):void 0)),literal:r=>he.V45.ExampleTypeReferenceShape.primitive(r._visit({string:i=>he.V45.ExamplePrimitive.string(i),integer:i=>he.V45.ExamplePrimitive.integer(i),double:i=>he.V45.ExamplePrimitive.double(i),long:i=>he.V45.ExamplePrimitive.long(i),boolean:i=>he.V45.ExamplePrimitive.boolean(i),datetime:i=>he.V45.ExamplePrimitive.datetime(i),date:i=>he.V45.ExamplePrimitive.date(i),uuid:i=>he.V45.ExamplePrimitive.uuid(i),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}})}),named:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.named({...t,shape:N_P(t.shape)})}),primitive:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.primitive(t._visit({string:r=>he.V45.ExamplePrimitive.string(r),integer:r=>he.V45.ExamplePrimitive.integer(r),double:r=>he.V45.ExamplePrimitive.double(r),long:r=>he.V45.ExamplePrimitive.long(r),boolean:r=>he.V45.ExamplePrimitive.boolean(r),datetime:r=>he.V45.ExamplePrimitive.datetime(r),date:r=>he.V45.ExamplePrimitive.date(r),uuid:r=>he.V45.ExamplePrimitive.uuid(r),_other:r=>{throw new Error(`Unexpected value: ${JSON.stringify(r)}`)}}))}),unknown:t=>({...e,shape:he.V45.ExampleTypeReferenceShape.unknown(t)}),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}function z_P(e){return{...e,properties:e.properties.map(t=>({...t,value:r3(t.value)}))}}function N_P(e){return e.type==="alias"?he.V45.ExampleTypeShape.alias({value:r3(e.value)}):e.type==="object"?he.V45.ExampleTypeShape.object(z_P(e)):e.type==="union"?he.V45.ExampleTypeShape.union({...e,singleUnionType:{...e.singleUnionType,shape:e.singleUnionType.shape._visit({samePropertiesAsObject:t=>he.V45.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...t,object:z_P(t.object)}),singleProperty:t=>he.V45.ExampleSingleUnionTypeProperties.singleProperty(r3(t)),noProperties:()=>he.V45.ExampleSingleUnionTypeProperties.noProperties(),_other:t=>{throw new Error(`Unexpected value: ${JSON.stringify(t)}`)}})}}):e.type==="undiscriminatedUnion"?he.V45.ExampleTypeShape.undiscriminatedUnion({...e,singleUnionType:r3(e.singleUnionType)}):he.V45.ExampleTypeShape.enum(e)}function OLF(e){return e.map(t=>({...t,shape:N_P(t.shape)}))}function OHu(e){return e.map(t=>({...t,value:r3(t.value)}))}function Glf(e){return e.map(t=>({...t,value:r3(t.value)}))}function F_P(e){return e.map(t=>({...t,value:r3(t.value)}))}function mLF(e){return e.map(t=>{let r={...t,rootPathParameters:OHu(t.rootPathParameters),servicePathParameters:OHu(t.servicePathParameters),endpointPathParameters:OHu(t.endpointPathParameters),serviceHeaders:Glf(t.serviceHeaders),endpointHeaders:Glf(t.endpointHeaders),queryParameters:F_P(t.queryParameters),request:t.request?._visit({inlinedRequestBody:i=>he.V45.ExampleRequestBody.inlinedRequestBody({...i,properties:i.properties.map(n=>({...n,value:r3(n.value)}))}),reference:i=>he.V45.ExampleRequestBody.reference(r3(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}}),response:t.response._visit({ok:i=>he.V45.ExampleResponse.ok(i._visit({body:n=>he.V45.ExampleEndpointSuccessResponse.body(n!=null?r3(n):void 0),stream:n=>he.V45.ExampleEndpointSuccessResponse.stream(n.map(r3)),sse:n=>he.V45.ExampleEndpointSuccessResponse.sse(n.map(a=>({...a,data:r3(a.data)}))),_other:n=>{throw new Error(`Unexpected value: ${JSON.stringify(n)}`)}})),error:i=>he.V45.ExampleResponse.error({...i,body:i.body!=null?r3(i.body):void 0}),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})};return t._visit({userProvided:()=>he.V45.HttpEndpointExample.userProvided(r),generated:()=>he.V45.HttpEndpointExample.generated(r),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})})}function PLF(e){return e.map(t=>({...t,pathParameters:OHu(t.pathParameters),headers:Glf(t.headers),queryParameters:F_P(t.queryParameters),messages:t.messages.map(r=>({...r,body:r.body._visit({inlinedBody:i=>he.V45.ExampleWebSocketMessageBody.inlinedBody({...i,properties:i.properties.map(n=>({...n,value:r3(n.value)}))}),reference:i=>he.V45.ExampleWebSocketMessageBody.reference(r3(i)),_other:i=>{throw new Error(`Unexpected value: ${JSON.stringify(i)}`)}})}))}))}var L_P={laterVersion:"v47",earlierVersion:"v46",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V46.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:Object.fromEntries(Object.entries(e.services).map(([t,r])=>{let i=r.endpoints.map(n=>{let{autogeneratedExamples:a,userSpecifiedExamples:u,...l}=n;return{...l,autogeneratedExamples:void 0,userSpecifiedExamples:void 0,examples:[...n.userSpecifiedExamples.map(s=>{if(s.example!=null)return he.V46.HttpEndpointExample.userProvided({...s.example,codeSamples:s.codeSamples})}).filter(u0),...n.autogeneratedExamples.map(s=>he.V46.HttpEndpointExample.generated({...s.example,codeSamples:void 0}))]}});return[t,{...r,endpoints:i}]}))})};var U_P={laterVersion:"v48",earlierVersion:"v47",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.29.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.29.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.17.0",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V47.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.map(a=>({...a,pagination:a.pagination!=null?wLF(a.pagination):void 0}));return[r,{...i,endpoints:n}]}));return{...e,sdkConfig:{...e.sdkConfig,hasPaginatedEndpoints:jLF(t)},services:t}}};function jLF(e){for(let t of Object.values(e))for(let r of t.endpoints)if(r.pagination!=null)return!0;return!1}function wLF(e){switch(e.type){case"cursor":{let t=SLF(e);return t!=null?he.V47.Pagination.cursor(t):void 0}case"offset":{let t=DLF(e);return t!=null?he.V47.Pagination.offset(t):void 0}default:Ko(e)}}function SLF(e){let t=V_P(e.page);if(t!=null)return{...e,page:t}}function DLF(e){if(e.step!=null)return;let t=V_P(e.page);if(t!=null)return{...e,page:t}}function V_P(e){switch(e.property.type){case"query":return e.property}}var W_P={laterVersion:"v49",earlierVersion:"v48",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:"0.11.0-rc0",[J.PYTHON_PYDANTIC]:"0.10.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:"2.11.0-rc0",[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:ii,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V48.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=Object.fromEntries(Object.entries(e.services).map(([r,i])=>{let n=i.endpoints.flatMap(a=>{let u;return a.response?.body!=null&&(u=a.response.body?._visit({json:d=>he.V48.HttpResponseBody.json({...d}),fileDownload:d=>he.V48.HttpResponseBody.fileDownload({...d}),text:d=>he.V48.HttpResponseBody.text({...d}),streaming:d=>he.V48.HttpResponseBody.streaming({...d}),streamParameter:()=>{},_other:()=>{}}),u==null)?[]:{...a,response:a.response==null?void 0:{statusCode:a.response?.statusCode,body:u}}});return[r,{...i,endpoints:n}]}));return{...e,services:t}}};var H_P={laterVersion:"v50",earlierVersion:"v49",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.34.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.34.0",[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:"0.17.2",[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:"0.0.0",[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V49.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>({...r,shape:he.V50.types.Type._visit(r.shape,{union:i=>he.V49.types.Type.union({...i,baseProperties:i.baseProperties.map(n=>({...n,valueType:Bq(n.valueType)})),types:i.types.map(n=>NLF(n))}),enum:he.V49.types.Type.enum,object:i=>he.V49.types.Type.object({...i,properties:i.properties.map(n=>({...n,valueType:Bq(n.valueType)}))}),alias:i=>he.V49.types.Type.alias({aliasOf:Bq(i.aliasOf),resolvedType:LLF(i.resolvedType)}),undiscriminatedUnion:i=>he.V49.types.Type.undiscriminatedUnion(ULF(i)),_other:()=>{throw new Error("Encountered unknown shape")}})}));return{...e,auth:BLF(e.auth),headers:e.headers.map(r=>jLn(r)),idempotencyHeaders:e.idempotencyHeaders.map(r=>jLn(r)),types:t,services:od(e.services,r=>VLF(r)),errors:od(e.errors,r=>nUF(r)),webhookGroups:od(e.webhookGroups,r=>qLF(r)),websocketChannels:od(e.websocketChannels,r=>ELF(r)),pathParameters:e.pathParameters.map(r=>N6a(r)),variables:e.variables.map(r=>WLF(r))}}};function ELF(e){return{...e,headers:e.headers.map(t=>jLn(t)),queryParameters:e.queryParameters.map(t=>Jlf(t)),pathParameters:e.pathParameters.map(t=>N6a(t)),messages:e.messages.map(t=>MLF(t))}}function MLF(e){return{...e,body:ALF(e.body)}}function ALF(e){switch(e.type){case"inlinedBody":return he.V49.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:Bq(t.valueType)}))});case"reference":return he.V49.websocket.WebSocketMessageBody.reference({...e,bodyType:Bq(e.bodyType)})}}function qLF(e){return e.map(t=>TLF(t))}function TLF(e){return{...e,headers:e.headers.map(t=>jLn(t)),payload:CLF(e.payload)}}function CLF(e){switch(e.type){case"reference":return he.V49.webhooks.WebhookPayload.reference({...e,payloadType:Bq(e.payloadType)});case"inlinedPayload":return he.V49.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:Bq(t.valueType)}))})}}function BLF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V49.auth.AuthScheme.basic(t);case"bearer":return he.V49.auth.AuthScheme.bearer(t);case"header":return he.V49.auth.AuthScheme.header(xLF(t));case"oauth":return he.V49.auth.AuthScheme.oauth(ILF(t))}})}}function xLF(e){return{...e,valueType:Bq(e.valueType)}}function ILF(e){return{...e,configuration:he.V49.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:zLF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?RLF(e.configuration.refreshEndpoint):void 0})}}function zLF(e){return{...e,requestProperties:{clientId:Pji(e.requestProperties.clientId),clientSecret:Pji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Pji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Aei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Aei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Aei(e.responseProperties.refreshToken):void 0}}}function RLF(e){return{...e,requestProperties:{refreshToken:Pji(e.requestProperties.refreshToken)},responseProperties:{accessToken:Aei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Aei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Aei(e.responseProperties.refreshToken):void 0}}}function jLn(e){return{...e,valueType:Bq(e.valueType)}}function Bq(e){return he.V50.types.TypeReference._visit(e,{container:t=>he.V49.types.TypeReference.container($_P(t)),primitive:t=>t.v2?.type==="integer"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?he.V49.types.TypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.string(t.v2)}):he.V49.types.TypeReference.primitive({v1:t.v1,v2:void 0}),named:he.V49.types.TypeReference.named,unknown:he.V49.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function $_P(e){return he.V50.types.ContainerType._visit(e,{list:t=>he.V49.types.ContainerType.list(Bq(t)),optional:t=>he.V49.types.ContainerType.optional(Bq(t)),set:t=>he.V49.types.ContainerType.set(Bq(t)),map:({keyType:t,valueType:r})=>he.V49.types.ContainerType.map({keyType:Bq(t),valueType:Bq(r)}),literal:he.V49.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function NLF(e){return{...e,shape:FLF(e.shape)}}function FLF(e){return he.V50.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V49.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V49.types.SingleUnionTypeProperties.singleProperty({...t,type:Bq(t.type)}),noProperties:he.V49.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function LLF(e){return he.V50.types.ResolvedTypeReference._visit(e,{container:t=>he.V49.types.ResolvedTypeReference.container($_P(t)),named:he.V49.types.ResolvedTypeReference.named,primitive:t=>t.v2?.type==="integer"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.integer(t.v2)}):t.v2?.type==="double"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.double(t.v2)}):t.v2?.type==="string"?he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:he.V49.types.PrimitiveTypeV2.string(t.v2)}):he.V49.types.ResolvedTypeReference.primitive({v1:t.v1,v2:void 0}),unknown:he.V49.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function ULF(e){return{members:e.members.map(t=>({...t,type:Bq(t.type)}))}}function VLF(e){return{...e,pathParameters:e.pathParameters.map(t=>N6a(t)),headers:e.headers.map(t=>jLn(t)),endpoints:e.endpoints.map(t=>HLF(t))}}function N6a(e){return{...e,valueType:Bq(e.valueType)}}function WLF(e){return{...e,type:Bq(e.type)}}function HLF(e){return{...e,pagination:e.pagination!=null?KLF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>N6a(t)),pathParameters:e.pathParameters.map(t=>N6a(t)),sdkRequest:e.sdkRequest!=null?kLF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?rUF(e.requestBody):void 0,response:e.response!=null?$LF(e.response):void 0,headers:e.headers.map(t=>jLn(t)),queryParameters:e.queryParameters.map(t=>Jlf(t))}}function $LF(e){return{...e,body:e.body!=null?GLF(e.body):void 0}}function GLF(e){switch(e.type){case"json":return he.V49.http.HttpResponseBody.json(G_P(e.value));case"fileDownload":return he.V49.http.HttpResponseBody.fileDownload(e);case"text":return he.V49.http.HttpResponseBody.text(e);case"streaming":return he.V49.http.HttpResponseBody.streaming(Q_P(e.value));case"streamParameter":return he.V49.http.HttpResponseBody.streamParameter(JLF(e))}}function G_P(e){switch(e.type){case"response":return he.V49.http.JsonResponse.response({...e,responseBodyType:Bq(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V49.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:Bq(e.responseBodyType),responseProperty:e.responseProperty!=null?Qlf(e.responseProperty):void 0})}}function Q_P(e){switch(e.type){case"json":return he.V49.http.StreamingResponse.json({...e,payload:Bq(e.payload)});case"text":return he.V49.http.StreamingResponse.text(e);case"sse":return he.V49.http.StreamingResponse.sse({...e,payload:Bq(e.payload)})}}function QLF(e){switch(e.type){case"json":return he.V49.http.NonStreamHttpResponseBody.json(G_P(e.value));case"text":return he.V49.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V49.http.NonStreamHttpResponseBody.fileDownload(e)}}function JLF(e){return{nonStreamResponse:QLF(e.nonStreamResponse),streamResponse:Q_P(e.streamResponse)}}function KLF(e){switch(e.type){case"cursor":return he.V49.http.Pagination.cursor(YLF(e));case"offset":return he.V49.http.Pagination.offset(XLF(e))}}function YLF(e){return{...e,page:Pji(e.page),next:Aei(e.next),results:Aei(e.results)}}function XLF(e){return{...e,page:Pji(e.page),results:Aei(e.results),step:e.step!=null?Pji(e.step):void 0}}function Pji(e){return{...e,property:ZLF(e.property)}}function ZLF(e){switch(e.type){case"query":return he.V49.RequestPropertyValue.query(Jlf(e));case"body":return he.V49.RequestPropertyValue.body(Qlf(e))}}function Aei(e){return{...e,property:Qlf(e.property)}}function Qlf(e){return{...e,valueType:Bq(e.valueType)}}function Jlf(e){return{...e,valueType:Bq(e.valueType)}}function kLF(e){return{...e,streamParameter:e.streamParameter!=null?Pji(e.streamParameter):void 0,shape:eUF(e.shape)}}function eUF(e){return he.V50.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V49.http.SdkRequestShape.justRequestBody(tUF(t)),wrapper:he.V49.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function tUF(e){switch(e.type){case"bytes":return he.V49.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V49.http.SdkRequestBodyType.typeReference({...e,requestBodyType:Bq(e.requestBodyType)})}}function rUF(e){return he.V50.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V49.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:Bq(r.valueType)}))}),reference:t=>he.V49.http.HttpRequestBody.reference({...t,requestBodyType:Bq(t.requestBodyType)}),fileUpload:t=>he.V49.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V49.http.FileUploadRequestProperty.bodyProperty({...r,valueType:Bq(r.valueType)});case"file":return he.V49.http.FileUploadRequestProperty.file(iUF(r.value))}})}),bytes:t=>he.V49.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function iUF(e){switch(e.type){case"file":return he.V49.http.FileProperty.file(e);case"fileArray":return he.V49.http.FileProperty.fileArray(e)}}function nUF(e){return{...e,type:e.type!=null?Bq(e.type):void 0}}var Y_P={laterVersion:"v51",earlierVersion:"v50",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"0.1.2",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V50.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>{let t=od(e.types,r=>{let i=r.autogeneratedExamples.map(a=>J_P(a)),n=r.userProvidedExamples.map(a=>J_P(a));return{...r,examples:[...i,...n]}});return{...e,types:t,services:od(e.services,r=>hUF(r)),errors:od(e.errors,r=>OUF(r)),webhookGroups:od(e.webhookGroups,r=>sUF(r)),websocketChannels:od(e.websocketChannels,r=>aUF(r))}}};function aUF(e){return{...e,examples:e.examples.map(t=>oUF(t))}}function oUF(e){return{...e,pathParameters:e.pathParameters.map(t=>mHu(t)),headers:e.headers.map(t=>Klf(t)),queryParameters:e.queryParameters.map(t=>X_P(t)),messages:e.messages.map(t=>({...t,body:uUF(t.body)}))}}function X_P(e){return{...e,value:j4(e.value)}}function Klf(e){return{...e,value:j4(e.value)}}function mHu(e){return{...e,value:j4(e.value)}}function uUF(e){switch(e.type){case"inlinedBody":return he.V50.ExampleWebSocketMessageBody.inlinedBody(Z_P(e));case"reference":return he.V50.ExampleWebSocketMessageBody.reference(j4(e))}}function Z_P(e){return{...e,properties:e.properties.map(t=>({...t,value:j4(t.value)}))}}function sUF(e){return e.map(t=>({...t,examples:t.examples?.map(r=>({...r,payload:j4(r.payload)}))}))}function J_P(e){return{...e,shape:k_P(e.shape)}}function Ylf(e){switch(e.type){case"primitive":return he.V50.ExampleTypeReferenceShape.primitive({...e.primitive});case"container":return he.V50.ExampleTypeReferenceShape.container(cUF(e));case"unknown":return he.V50.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V50.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:k_P(e.shape)})}}function cUF(e){switch(e.container.type){case"list":return he.V50.ExampleContainer.list(e.container.list.map(t=>j4(t)));case"set":return he.V50.ExampleContainer.set(e.container.set.map(t=>j4(t)));case"optional":return he.V50.ExampleContainer.optional(e.container.optional!=null?j4(e.container.optional):void 0);case"map":return he.V50.ExampleContainer.map(e.container.map.map(t=>({key:j4(t.key),value:j4(t.value)})));case"literal":return he.V50.ExampleContainer.literal(e.container.literal)}}function j4(e){return{...e,shape:Ylf(e.shape)}}function k_P(e){switch(e.type){case"object":return he.V50.ExampleTypeShape.object({properties:e.properties.map(t=>ehP(t))});case"alias":return he.V50.ExampleTypeShape.alias({value:{...j4(e.value)}});case"enum":return he.V50.ExampleTypeShape.enum(e);case"union":return he.V50.ExampleTypeShape.union(fUF(e));case"undiscriminatedUnion":return he.V50.ExampleTypeShape.undiscriminatedUnion(lUF(e))}}function lUF(e){return{...e,singleUnionType:j4(e.singleUnionType)}}function fUF(e){return{...e,singleUnionType:dUF(e.singleUnionType)}}function dUF(e){return{...e,shape:pUF(e.shape)}}function pUF(e){switch(e.type){case"samePropertiesAsObject":return he.V50.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:_UF(e.object)});case"singleProperty":return he.V50.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:Ylf(e.shape)});case"noProperties":return he.V50.ExampleSingleUnionTypeProperties.noProperties()}}function _UF(e){return{...e,properties:e.properties.map(t=>ehP(t))}}function ehP(e){return{...e,value:{...e.value,shape:Ylf(e.value.shape)}}}function hUF(e){return{...e,endpoints:e.endpoints.map(t=>yUF(t))}}function yUF(e){return{...e,autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:K_P(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?K_P(t.example):void 0}))}}function K_P(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>mHu(t)),servicePathParameters:e.servicePathParameters.map(t=>mHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>mHu(t)),serviceHeaders:e.serviceHeaders.map(t=>Klf(t)),endpointHeaders:e.endpointHeaders.map(t=>Klf(t)),queryParameters:e.queryParameters.map(t=>X_P(t)),request:e.request!=null?gUF(e.request):void 0,response:vUF(e.response)}}function vUF(e){switch(e.type){case"error":return he.V50.ExampleResponse.error({...e,body:e.body!=null?j4(e.body):void 0});case"ok":return he.V50.ExampleResponse.ok(bUF(e))}}function bUF(e){switch(e.value.type){case"body":return he.V50.ExampleEndpointSuccessResponse.body(e.value.value!=null?j4(e.value.value):void 0);case"stream":return he.V50.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>j4(t)));case"sse":return he.V50.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:j4(t.data)})))}}function gUF(e){switch(e.type){case"inlinedRequestBody":return he.V50.ExampleRequestBody.inlinedRequestBody(Z_P(e));case"reference":return he.V50.ExampleRequestBody.reference(j4(e))}}function OUF(e){return{...e,examples:e.examples.map(t=>({...t,shape:j4(t.shape)}))}}var ihP={laterVersion:"v52",earlierVersion:"v51",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:ii},jsonifyEarlierVersion:e=>W_.V51.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?PUF(e.apiVersion):void 0,auth:qUF(e.auth),headers:e.headers.map(t=>Gen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Gen(t)),types:mUF(e.types),services:od(e.services,t=>UUF(t)),webhookGroups:od(e.webhookGroups,t=>DUF(t)),websocketChannels:od(e.websocketChannels,t=>jUF(t)),errors:od(e.errors,t=>iVF(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),variables:e.variables.map(t=>VUF(t))})};function mUF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>thP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>thP(r)),shape:he.V52.types.Type._visit(t.shape,{union:r=>he.V51.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:_E(i.valueType)})),types:r.types.map(i=>RUF(i))}),enum:he.V51.types.Type.enum,object:r=>he.V51.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:_E(i.valueType)}))}),alias:r=>he.V51.types.Type.alias({aliasOf:_E(r.aliasOf),resolvedType:FUF(r.resolvedType)}),undiscriminatedUnion:r=>he.V51.types.Type.undiscriminatedUnion(LUF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function PUF(e){return he.V51.ApiVersionScheme.header({...e,header:Gen(e.header)})}function jUF(e){return{...e,headers:e.headers.map(t=>Gen(t)),queryParameters:e.queryParameters.map(t=>klf(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),messages:e.messages.map(t=>wUF(t)),examples:e.examples.map(t=>nVF(t))}}function wUF(e){return{...e,body:SUF(e.body)}}function SUF(e){switch(e.type){case"inlinedBody":return he.V51.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:_E(t.valueType)}))});case"reference":return he.V51.websocket.WebSocketMessageBody.reference({...e,bodyType:_E(e.bodyType)})}}function DUF(e){return e.map(t=>EUF(t))}function EUF(e){return{...e,headers:e.headers.map(t=>Gen(t)),payload:MUF(e.payload),examples:e.examples!=null?e.examples.map(t=>AUF(t)):void 0}}function MUF(e){switch(e.type){case"reference":return he.V51.webhooks.WebhookPayload.reference({...e,payloadType:_E(e.payloadType)});case"inlinedPayload":return he.V51.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:_E(t.valueType)}))})}}function AUF(e){return{...e,payload:w4(e.payload)}}function qUF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V51.auth.AuthScheme.basic(t);case"bearer":return he.V51.auth.AuthScheme.bearer(t);case"header":return he.V51.auth.AuthScheme.header(TUF(t));case"oauth":return he.V51.auth.AuthScheme.oauth(CUF(t))}})}}function TUF(e){return{...e,valueType:_E(e.valueType)}}function CUF(e){return{...e,configuration:he.V51.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:BUF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?xUF(e.configuration.refreshEndpoint):void 0})}}function BUF(e){return{...e,requestProperties:{clientId:jji(e.requestProperties.clientId),clientSecret:jji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?jji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:qei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?qei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?qei(e.responseProperties.refreshToken):void 0}}}function xUF(e){return{...e,requestProperties:{refreshToken:jji(e.requestProperties.refreshToken)},responseProperties:{accessToken:qei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?qei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?qei(e.responseProperties.refreshToken):void 0}}}function Gen(e){return{...e,valueType:_E(e.valueType)}}function _E(e){return he.V52.types.TypeReference._visit(e,{container:t=>he.V51.types.TypeReference.container(ahP(t)),primitive:t=>he.V51.types.TypeReference.primitive(nhP(t)),named:he.V51.types.TypeReference.named,unknown:he.V51.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function nhP(e){return{v1:IUF(e.v1),v2:e.v2!=null?zUF(e.v2):void 0}}function IUF(e){switch(e){case"UINT":return he.V51.types.PrimitiveTypeV1.Integer;case"UINT_64":return he.V51.types.PrimitiveTypeV1.Long}return e}function zUF(e){switch(e.type){case"integer":return he.V51.types.PrimitiveTypeV2.integer(e);case"double":return he.V51.types.PrimitiveTypeV2.double(e);case"string":return he.V51.types.PrimitiveTypeV2.string(e);case"boolean":return he.V51.types.PrimitiveTypeV2.boolean(e);case"long":return he.V51.types.PrimitiveTypeV2.long(e);case"bigInteger":return he.V51.types.PrimitiveTypeV2.bigInteger(e);case"uint":return;case"uint64":return;default:Ko(e)}}function ahP(e){return he.V52.types.ContainerType._visit(e,{list:t=>he.V51.types.ContainerType.list(_E(t)),optional:t=>he.V51.types.ContainerType.optional(_E(t)),set:t=>he.V51.types.ContainerType.set(_E(t)),map:({keyType:t,valueType:r})=>he.V51.types.ContainerType.map({keyType:_E(t),valueType:_E(r)}),literal:he.V51.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function RUF(e){return{...e,shape:NUF(e.shape)}}function NUF(e){return he.V52.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V51.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V51.types.SingleUnionTypeProperties.singleProperty({...t,type:_E(t.type)}),noProperties:he.V51.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function FUF(e){return he.V52.types.ResolvedTypeReference._visit(e,{container:t=>he.V51.types.ResolvedTypeReference.container(ahP(t)),named:he.V51.types.ResolvedTypeReference.named,primitive:t=>he.V51.types.ResolvedTypeReference.primitive(nhP(t)),unknown:he.V51.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function LUF(e){return{members:e.members.map(t=>({...t,type:_E(t.type)}))}}function UUF(e){return{...e,pathParameters:e.pathParameters.map(t=>F6a(t)),headers:e.headers.map(t=>Gen(t)),endpoints:e.endpoints.map(t=>WUF(t))}}function F6a(e){return{...e,valueType:_E(e.valueType)}}function VUF(e){return{...e,type:_E(e.type)}}function WUF(e){return{...e,pagination:e.pagination!=null?JUF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>F6a(t)),pathParameters:e.pathParameters.map(t=>F6a(t)),sdkRequest:e.sdkRequest!=null?ZUF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?tVF(e.requestBody):void 0,response:e.response!=null?HUF(e.response):void 0,headers:e.headers.map(t=>Gen(t)),queryParameters:e.queryParameters.map(t=>klf(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:rhP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?rhP(t.example):void 0}))}}function HUF(e){return{...e,body:e.body!=null?$UF(e.body):void 0}}function $UF(e){switch(e.type){case"json":return he.V51.http.HttpResponseBody.json(ohP(e.value));case"fileDownload":return he.V51.http.HttpResponseBody.fileDownload(e);case"text":return he.V51.http.HttpResponseBody.text(e);case"streaming":return he.V51.http.HttpResponseBody.streaming(uhP(e.value));case"streamParameter":return he.V51.http.HttpResponseBody.streamParameter(QUF(e))}}function ohP(e){switch(e.type){case"response":return he.V51.http.JsonResponse.response({...e,responseBodyType:_E(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V51.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:_E(e.responseBodyType),responseProperty:e.responseProperty!=null?Zlf(e.responseProperty):void 0})}}function uhP(e){switch(e.type){case"json":return he.V51.http.StreamingResponse.json({...e,payload:_E(e.payload)});case"text":return he.V51.http.StreamingResponse.text(e);case"sse":return he.V51.http.StreamingResponse.sse({...e,payload:_E(e.payload)})}}function GUF(e){switch(e.type){case"json":return he.V51.http.NonStreamHttpResponseBody.json(ohP(e.value));case"text":return he.V51.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V51.http.NonStreamHttpResponseBody.fileDownload(e)}}function QUF(e){return{nonStreamResponse:GUF(e.nonStreamResponse),streamResponse:uhP(e.streamResponse)}}function JUF(e){switch(e.type){case"cursor":return he.V51.http.Pagination.cursor(KUF(e));case"offset":return he.V51.http.Pagination.offset(YUF(e))}}function KUF(e){return{...e,page:jji(e.page),next:qei(e.next),results:qei(e.results)}}function YUF(e){return{...e,page:jji(e.page),results:qei(e.results),step:e.step!=null?jji(e.step):void 0}}function jji(e){return{...e,property:XUF(e.property)}}function XUF(e){switch(e.type){case"query":return he.V51.RequestPropertyValue.query(klf(e));case"body":return he.V51.RequestPropertyValue.body(Zlf(e))}}function qei(e){return{...e,property:Zlf(e.property)}}function Zlf(e){return{...e,valueType:_E(e.valueType)}}function klf(e){return{...e,valueType:_E(e.valueType)}}function ZUF(e){return{...e,streamParameter:e.streamParameter!=null?jji(e.streamParameter):void 0,shape:kUF(e.shape)}}function kUF(e){return he.V52.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V51.http.SdkRequestShape.justRequestBody(eVF(t)),wrapper:he.V51.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function eVF(e){switch(e.type){case"bytes":return he.V51.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V51.http.SdkRequestBodyType.typeReference({...e,requestBodyType:_E(e.requestBodyType)})}}function tVF(e){return he.V52.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V51.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:_E(r.valueType)}))}),reference:t=>he.V51.http.HttpRequestBody.reference({...t,requestBodyType:_E(t.requestBodyType)}),fileUpload:t=>he.V51.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V51.http.FileUploadRequestProperty.bodyProperty({...r,valueType:_E(r.valueType)});case"file":return he.V51.http.FileUploadRequestProperty.file(rVF(r.value))}})}),bytes:t=>he.V51.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function rVF(e){switch(e.type){case"file":return he.V51.http.FileProperty.file(e);case"fileArray":return he.V51.http.FileProperty.fileArray(e)}}function iVF(e){return{...e,type:e.type!=null?_E(e.type):void 0,examples:e.examples.map(t=>({...t,shape:w4(t.shape)}))}}function nVF(e){return{...e,pathParameters:e.pathParameters.map(t=>PHu(t)),headers:e.headers.map(t=>Xlf(t)),queryParameters:e.queryParameters.map(t=>shP(t)),messages:e.messages.map(t=>({...t,body:aVF(t.body)}))}}function shP(e){return{...e,value:w4(e.value)}}function Xlf(e){return{...e,value:w4(e.value)}}function PHu(e){return{...e,value:w4(e.value)}}function aVF(e){switch(e.type){case"inlinedBody":return he.V51.ExampleWebSocketMessageBody.inlinedBody(chP(e));case"reference":return he.V51.ExampleWebSocketMessageBody.reference(w4(e))}}function chP(e){return{...e,properties:e.properties.map(t=>({...t,value:w4(t.value)}))}}function thP(e){return{...e,shape:fhP(e.shape)}}function eff(e){switch(e.type){case"primitive":return he.V51.ExampleTypeReferenceShape.primitive(oVF(e));case"container":return he.V51.ExampleTypeReferenceShape.container(uVF(e));case"unknown":return he.V51.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V51.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:fhP(e.shape)})}}function lhP(e){switch(e.type){case"integer":return he.V51.ExamplePrimitive.integer(e.integer);case"uint":return he.V51.ExamplePrimitive.integer(e.uint);case"uint64":return he.V51.ExamplePrimitive.integer(e.uint64);case"double":return he.V51.ExamplePrimitive.double(e.double);case"long":return he.V51.ExamplePrimitive.long(e.long);case"boolean":return he.V51.ExamplePrimitive.boolean(e.boolean);case"string":return he.V51.ExamplePrimitive.string(e.string);case"date":return he.V51.ExamplePrimitive.date(e.date);case"datetime":return he.V51.ExamplePrimitive.datetime(e.datetime);case"uuid":return he.V51.ExamplePrimitive.uuid(e.uuid)}}function oVF(e){return lhP(e.primitive)}function uVF(e){switch(e.container.type){case"list":return he.V51.ExampleContainer.list({list:e.container.list.map(t=>w4(t)),itemType:_E(e.container.itemType)});case"set":return he.V51.ExampleContainer.set({set:e.container.set.map(t=>w4(t)),itemType:_E(e.container.itemType)});case"optional":return he.V51.ExampleContainer.optional({optional:e.container.optional!=null?w4(e.container.optional):void 0,valueType:_E(e.container.valueType)});case"map":return he.V51.ExampleContainer.map({map:e.container.map.map(t=>({key:w4(t.key),value:w4(t.value)})),keyType:_E(e.container.keyType),valueType:_E(e.container.valueType)});case"literal":return he.V51.ExampleContainer.literal({literal:lhP(e.container.literal)})}}function w4(e){return{...e,shape:eff(e.shape)}}function fhP(e){switch(e.type){case"object":return he.V51.ExampleTypeShape.object({properties:e.properties.map(t=>dhP(t))});case"alias":return he.V51.ExampleTypeShape.alias({value:{...w4(e.value)}});case"enum":return he.V51.ExampleTypeShape.enum(e);case"union":return he.V51.ExampleTypeShape.union(cVF(e));case"undiscriminatedUnion":return he.V51.ExampleTypeShape.undiscriminatedUnion(sVF(e))}}function sVF(e){return{...e,singleUnionType:w4(e.singleUnionType)}}function cVF(e){return{...e,singleUnionType:lVF(e.singleUnionType)}}function lVF(e){return{...e,shape:fVF(e.shape)}}function fVF(e){switch(e.type){case"samePropertiesAsObject":return he.V51.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:dVF(e.object)});case"singleProperty":return he.V51.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:eff(e.shape)});case"noProperties":return he.V51.ExampleSingleUnionTypeProperties.noProperties()}}function dVF(e){return{...e,properties:e.properties.map(t=>dhP(t))}}function dhP(e){return{...e,value:{...e.value,shape:eff(e.value.shape)}}}function rhP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>PHu(t)),servicePathParameters:e.servicePathParameters.map(t=>PHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>PHu(t)),serviceHeaders:e.serviceHeaders.map(t=>Xlf(t)),endpointHeaders:e.endpointHeaders.map(t=>Xlf(t)),queryParameters:e.queryParameters.map(t=>shP(t)),request:e.request!=null?hVF(e.request):void 0,response:pVF(e.response)}}function pVF(e){switch(e.type){case"error":return he.V51.ExampleResponse.error({...e,body:e.body!=null?w4(e.body):void 0});case"ok":return he.V51.ExampleResponse.ok(_VF(e))}}function _VF(e){switch(e.value.type){case"body":return he.V51.ExampleEndpointSuccessResponse.body(e.value.value!=null?w4(e.value.value):void 0);case"stream":return he.V51.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>w4(t)));case"sse":return he.V51.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:w4(t.data)})))}}function hVF(e){switch(e.type){case"inlinedRequestBody":return he.V51.ExampleRequestBody.inlinedRequestBody(chP(e));case"reference":return he.V51.ExampleRequestBody.reference(w4(e))}}var hhP={laterVersion:"v53",earlierVersion:"v52",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.38.0-rc0",[J.TYPESCRIPT_BROWSER_SDK]:"0.38.0-rc0",[J.TYPESCRIPT]:"0.38.0-rc0",[J.TYPESCRIPT_SDK]:"0.38.0-rc0",[J.TYPESCRIPT_EXPRESS]:"0.17.3",[J.JAVA]:$e,[J.JAVA_MODEL]:"1.3.0",[J.JAVA_SDK]:"2.5.0",[J.JAVA_SPRING]:"1.3.0",[J.PYTHON_FASTAPI]:"1.1.0-rc0",[J.PYTHON_PYDANTIC]:"1.1.0-rc0",[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:"0.1.0",[J.STOPLIGHT]:$e,[J.POSTMAN]:"0.2.0",[J.PYTHON_SDK]:"3.3.0-rc0",[J.GO_FIBER]:"0.23.5",[J.GO_MODEL]:"0.23.5",[J.GO_SDK]:"0.28.3",[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"0.5.0",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:"0.1.0"},jsonifyEarlierVersion:e=>W_.V52.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?vVF(e.apiVersion):void 0,auth:SVF(e.auth),headers:e.headers.map(t=>Qen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Qen(t)),types:yVF(e.types),services:od(e.services,t=>zVF(t)),webhookGroups:od(e.webhookGroups,t=>mVF(t)),websocketChannels:od(e.websocketChannels,t=>bVF(t)),errors:od(e.errors,t=>ZVF(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),variables:e.variables.map(t=>RVF(t))})};function yVF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>phP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>phP(r)),shape:he.V53.types.Type._visit(t.shape,{union:r=>he.V52.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:hE(i.valueType)})),types:r.types.map(i=>CVF(i))}),enum:he.V52.types.Type.enum,object:r=>he.V52.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:hE(i.valueType)}))}),alias:r=>he.V52.types.Type.alias({aliasOf:hE(r.aliasOf),resolvedType:xVF(r.resolvedType)}),undiscriminatedUnion:r=>he.V52.types.Type.undiscriminatedUnion(IVF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function vVF(e){return he.V52.ApiVersionScheme.header({...e,header:Qen(e.header)})}function bVF(e){return{...e,headers:e.headers.map(t=>Qen(t)),queryParameters:e.queryParameters.map(t=>iff(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),messages:e.messages.map(t=>gVF(t)),examples:e.examples.map(t=>kVF(t))}}function gVF(e){return{...e,body:OVF(e.body)}}function OVF(e){switch(e.type){case"inlinedBody":return he.V52.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:hE(t.valueType)}))});case"reference":return he.V52.websocket.WebSocketMessageBody.reference({...e,bodyType:hE(e.bodyType)})}}function mVF(e){return e.map(t=>PVF(t))}function PVF(e){return{...e,headers:e.headers.map(t=>Qen(t)),payload:jVF(e.payload),examples:e.examples!=null?e.examples.map(t=>wVF(t)):void 0}}function jVF(e){switch(e.type){case"reference":return he.V52.webhooks.WebhookPayload.reference({...e,payloadType:hE(e.payloadType)});case"inlinedPayload":return he.V52.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:hE(t.valueType)}))})}}function wVF(e){return{...e,payload:S4(e.payload)}}function SVF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V52.auth.AuthScheme.basic(t);case"bearer":return he.V52.auth.AuthScheme.bearer(t);case"header":return he.V52.auth.AuthScheme.header(DVF(t));case"oauth":return he.V52.auth.AuthScheme.oauth(EVF(t))}})}}function DVF(e){return{...e,valueType:hE(e.valueType)}}function EVF(e){return{...e,configuration:he.V52.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:MVF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?AVF(e.configuration.refreshEndpoint):void 0})}}function MVF(e){return{...e,requestProperties:{clientId:wji(e.requestProperties.clientId),clientSecret:wji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?wji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:Tei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Tei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Tei(e.responseProperties.refreshToken):void 0}}}function AVF(e){return{...e,requestProperties:{refreshToken:wji(e.requestProperties.refreshToken)},responseProperties:{accessToken:Tei(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?Tei(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?Tei(e.responseProperties.refreshToken):void 0}}}function Qen(e){return{...e,valueType:hE(e.valueType)}}function hE(e){return he.V53.types.TypeReference._visit(e,{container:t=>he.V52.types.TypeReference.container(vhP(t)),primitive:t=>he.V52.types.TypeReference.primitive(yhP(t)),named:he.V52.types.TypeReference.named,unknown:he.V52.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function yhP(e){return{v1:qVF(e.v1),v2:e.v2!=null?TVF(e.v2):void 0}}function qVF(e){switch(e){case"FLOAT":return he.V52.types.PrimitiveTypeV1.Double}return e}function TVF(e){switch(e.type){case"integer":return he.V52.types.PrimitiveTypeV2.integer(e);case"double":return he.V52.types.PrimitiveTypeV2.double(e);case"string":return he.V52.types.PrimitiveTypeV2.string(e);case"boolean":return he.V52.types.PrimitiveTypeV2.boolean(e);case"long":return he.V52.types.PrimitiveTypeV2.long(e);case"bigInteger":return he.V52.types.PrimitiveTypeV2.bigInteger(e);case"uint":return he.V52.types.PrimitiveTypeV2.uint();case"uint64":return he.V52.types.PrimitiveTypeV2.uint64();case"date":return;case"dateTime":return;case"uuid":return;case"base64":return;case"float":return;default:Ko(e)}}function vhP(e){return he.V53.types.ContainerType._visit(e,{list:t=>he.V52.types.ContainerType.list(hE(t)),optional:t=>he.V52.types.ContainerType.optional(hE(t)),set:t=>he.V52.types.ContainerType.set(hE(t)),map:({keyType:t,valueType:r})=>he.V52.types.ContainerType.map({keyType:hE(t),valueType:hE(r)}),literal:he.V52.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function CVF(e){return{...e,shape:BVF(e.shape)}}function BVF(e){return he.V53.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V52.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V52.types.SingleUnionTypeProperties.singleProperty({...t,type:hE(t.type)}),noProperties:he.V52.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function xVF(e){return he.V53.types.ResolvedTypeReference._visit(e,{container:t=>he.V52.types.ResolvedTypeReference.container(vhP(t)),named:he.V52.types.ResolvedTypeReference.named,primitive:t=>he.V52.types.ResolvedTypeReference.primitive(yhP(t)),unknown:he.V52.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function IVF(e){return{members:e.members.map(t=>({...t,type:hE(t.type)}))}}function zVF(e){return{...e,pathParameters:e.pathParameters.map(t=>L6a(t)),headers:e.headers.map(t=>Qen(t)),endpoints:e.endpoints.map(t=>NVF(t))}}function L6a(e){return{...e,valueType:hE(e.valueType)}}function RVF(e){return{...e,type:hE(e.type)}}function NVF(e){return{...e,pagination:e.pagination!=null?WVF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>L6a(t)),pathParameters:e.pathParameters.map(t=>L6a(t)),sdkRequest:e.sdkRequest!=null?QVF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?YVF(e.requestBody):void 0,response:e.response!=null?FVF(e.response):void 0,headers:e.headers.map(t=>Qen(t)),queryParameters:e.queryParameters.map(t=>iff(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:_hP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?_hP(t.example):void 0}))}}function FVF(e){return{...e,body:e.body!=null?LVF(e.body):void 0}}function LVF(e){switch(e.type){case"json":return he.V52.http.HttpResponseBody.json(bhP(e.value));case"fileDownload":return he.V52.http.HttpResponseBody.fileDownload(e);case"text":return he.V52.http.HttpResponseBody.text(e);case"streaming":return he.V52.http.HttpResponseBody.streaming(ghP(e.value));case"streamParameter":return he.V52.http.HttpResponseBody.streamParameter(VVF(e))}}function bhP(e){switch(e.type){case"response":return he.V52.http.JsonResponse.response({...e,responseBodyType:hE(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V52.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:hE(e.responseBodyType),responseProperty:e.responseProperty!=null?rff(e.responseProperty):void 0})}}function ghP(e){switch(e.type){case"json":return he.V52.http.StreamingResponse.json({...e,payload:hE(e.payload)});case"text":return he.V52.http.StreamingResponse.text(e);case"sse":return he.V52.http.StreamingResponse.sse({...e,payload:hE(e.payload)})}}function UVF(e){switch(e.type){case"json":return he.V52.http.NonStreamHttpResponseBody.json(bhP(e.value));case"text":return he.V52.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V52.http.NonStreamHttpResponseBody.fileDownload(e)}}function VVF(e){return{nonStreamResponse:UVF(e.nonStreamResponse),streamResponse:ghP(e.streamResponse)}}function WVF(e){switch(e.type){case"cursor":return he.V52.http.Pagination.cursor(HVF(e));case"offset":return he.V52.http.Pagination.offset($VF(e))}}function HVF(e){return{...e,page:wji(e.page),next:Tei(e.next),results:Tei(e.results)}}function $VF(e){return{...e,page:wji(e.page),results:Tei(e.results),step:e.step!=null?wji(e.step):void 0}}function wji(e){return{...e,property:GVF(e.property)}}function GVF(e){switch(e.type){case"query":return he.V52.RequestPropertyValue.query(iff(e));case"body":return he.V52.RequestPropertyValue.body(rff(e))}}function Tei(e){return{...e,property:rff(e.property)}}function rff(e){return{...e,valueType:hE(e.valueType)}}function iff(e){return{...e,valueType:hE(e.valueType)}}function QVF(e){return{...e,streamParameter:e.streamParameter!=null?wji(e.streamParameter):void 0,shape:JVF(e.shape)}}function JVF(e){return he.V53.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V52.http.SdkRequestShape.justRequestBody(KVF(t)),wrapper:he.V52.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function KVF(e){switch(e.type){case"bytes":return he.V52.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V52.http.SdkRequestBodyType.typeReference({...e,requestBodyType:hE(e.requestBodyType)})}}function YVF(e){return he.V53.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V52.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:hE(r.valueType)}))}),reference:t=>he.V52.http.HttpRequestBody.reference({...t,requestBodyType:hE(t.requestBodyType)}),fileUpload:t=>he.V52.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V52.http.FileUploadRequestProperty.bodyProperty({...r,valueType:hE(r.valueType)});case"file":return he.V52.http.FileUploadRequestProperty.file(XVF(r.value))}})}),bytes:t=>he.V52.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function XVF(e){switch(e.type){case"file":return he.V52.http.FileProperty.file(e);case"fileArray":return he.V52.http.FileProperty.fileArray(e)}}function ZVF(e){return{...e,type:e.type!=null?hE(e.type):void 0,examples:e.examples.map(t=>({...t,shape:S4(t.shape)}))}}function kVF(e){return{...e,pathParameters:e.pathParameters.map(t=>jHu(t)),headers:e.headers.map(t=>tff(t)),queryParameters:e.queryParameters.map(t=>OhP(t)),messages:e.messages.map(t=>({...t,body:eWF(t.body)}))}}function OhP(e){return{...e,value:S4(e.value)}}function tff(e){return{...e,value:S4(e.value)}}function jHu(e){return{...e,value:S4(e.value)}}function eWF(e){switch(e.type){case"inlinedBody":return he.V52.ExampleWebSocketMessageBody.inlinedBody(mhP(e));case"reference":return he.V52.ExampleWebSocketMessageBody.reference(S4(e))}}function mhP(e){return{...e,properties:e.properties.map(t=>({...t,value:S4(t.value)}))}}function phP(e){return{...e,shape:jhP(e.shape)}}function nff(e){switch(e.type){case"primitive":return he.V52.ExampleTypeReferenceShape.primitive(tWF(e));case"container":return he.V52.ExampleTypeReferenceShape.container(rWF(e));case"unknown":return he.V52.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V52.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:jhP(e.shape)})}}function PhP(e){switch(e.type){case"integer":return he.V52.ExamplePrimitive.integer(e.integer);case"uint":return he.V52.ExamplePrimitive.integer(e.uint);case"uint64":return he.V52.ExamplePrimitive.integer(e.uint64);case"float":return he.V52.ExamplePrimitive.double(e.float);case"double":return he.V52.ExamplePrimitive.double(e.double);case"long":return he.V52.ExamplePrimitive.long(e.long);case"boolean":return he.V52.ExamplePrimitive.boolean(e.boolean);case"string":return he.V52.ExamplePrimitive.string(e.string);case"date":return he.V52.ExamplePrimitive.date(e.date);case"datetime":return he.V52.ExamplePrimitive.datetime(e.datetime);case"uuid":return he.V52.ExamplePrimitive.uuid(e.uuid);case"base64":return he.V52.ExamplePrimitive.string({original:e.base64});case"bigInteger":return he.V52.ExamplePrimitive.string({original:e.bigInteger})}}function tWF(e){return PhP(e.primitive)}function rWF(e){switch(e.container.type){case"list":return he.V52.ExampleContainer.list({list:e.container.list.map(t=>S4(t)),itemType:hE(e.container.itemType)});case"set":return he.V52.ExampleContainer.set({set:e.container.set.map(t=>S4(t)),itemType:hE(e.container.itemType)});case"optional":return he.V52.ExampleContainer.optional({optional:e.container.optional!=null?S4(e.container.optional):void 0,valueType:hE(e.container.valueType)});case"map":return he.V52.ExampleContainer.map({map:e.container.map.map(t=>({key:S4(t.key),value:S4(t.value)})),keyType:hE(e.container.keyType),valueType:hE(e.container.valueType)});case"literal":return he.V52.ExampleContainer.literal({literal:PhP(e.container.literal)})}}function S4(e){return{...e,shape:nff(e.shape)}}function jhP(e){switch(e.type){case"object":return he.V52.ExampleTypeShape.object({properties:e.properties.map(t=>whP(t))});case"alias":return he.V52.ExampleTypeShape.alias({value:{...S4(e.value)}});case"enum":return he.V52.ExampleTypeShape.enum(e);case"union":return he.V52.ExampleTypeShape.union(nWF(e));case"undiscriminatedUnion":return he.V52.ExampleTypeShape.undiscriminatedUnion(iWF(e))}}function iWF(e){return{...e,singleUnionType:S4(e.singleUnionType)}}function nWF(e){return{...e,singleUnionType:aWF(e.singleUnionType)}}function aWF(e){return{...e,shape:oWF(e.shape)}}function oWF(e){switch(e.type){case"samePropertiesAsObject":return he.V52.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:uWF(e.object)});case"singleProperty":return he.V52.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:nff(e.shape)});case"noProperties":return he.V52.ExampleSingleUnionTypeProperties.noProperties()}}function uWF(e){return{...e,properties:e.properties.map(t=>whP(t))}}function whP(e){return{...e,value:{...e.value,shape:nff(e.value.shape)}}}function _hP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>jHu(t)),servicePathParameters:e.servicePathParameters.map(t=>jHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>jHu(t)),serviceHeaders:e.serviceHeaders.map(t=>tff(t)),endpointHeaders:e.endpointHeaders.map(t=>tff(t)),queryParameters:e.queryParameters.map(t=>OhP(t)),request:e.request!=null?lWF(e.request):void 0,response:sWF(e.response)}}function sWF(e){switch(e.type){case"error":return he.V52.ExampleResponse.error({...e,body:e.body!=null?S4(e.body):void 0});case"ok":return he.V52.ExampleResponse.ok(cWF(e))}}function cWF(e){switch(e.value.type){case"body":return he.V52.ExampleEndpointSuccessResponse.body(e.value.value!=null?S4(e.value.value):void 0);case"stream":return he.V52.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>S4(t)));case"sse":return he.V52.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:S4(t.data)})))}}function lWF(e){switch(e.type){case"inlinedRequestBody":return he.V52.ExampleRequestBody.inlinedRequestBody(mhP(e));case"reference":return he.V52.ExampleRequestBody.reference(S4(e))}}var ShP={laterVersion:"v54",earlierVersion:"v53",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:$e,[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:$e},jsonifyEarlierVersion:e=>W_.V53.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:od(e.services,t=>({...t,endpoints:t.endpoints.map(r=>({...r,response:fWF(r.response)}))}))})};function fWF(e){if(e!=null)return{statusCode:e.statusCode,body:e.body?.type==="bytes"?he.V53.HttpResponseBody.fileDownload({docs:void 0}):e.body}}var MhP={laterVersion:"v55",earlierVersion:"v54",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:"0.47.0",[J.TYPESCRIPT_BROWSER_SDK]:"0.47.0",[J.TYPESCRIPT]:"0.47.0",[J.TYPESCRIPT_SDK]:"0.47.0",[J.TYPESCRIPT_EXPRESS]:"0.17.7",[J.JAVA]:$e,[J.JAVA_MODEL]:"1.7.0",[J.JAVA_SDK]:"2.16.0",[J.JAVA_SPRING]:"1.5.0",[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:$e,[J.CSHARP_SDK]:"1.10.1",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:"0.3.2"},jsonifyEarlierVersion:e=>W_.V54.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,apiVersion:e.apiVersion!=null?pWF(e.apiVersion):void 0,auth:mWF(e.auth),headers:e.headers.map(t=>Jen(t)),idempotencyHeaders:e.idempotencyHeaders.map(t=>Jen(t)),types:dWF(e.types),services:od(e.services,t=>qWF(t)),webhookGroups:od(e.webhookGroups,t=>vWF(t)),websocketChannels:od(e.websocketChannels,t=>_WF(t)),errors:od(e.errors,t=>GWF(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),variables:e.variables.map(t=>TWF(t)),dynamic:e.dynamic!=null?aHF(e.dynamic):void 0})};function dWF(e){return od(e,t=>({...t,autogeneratedExamples:t.autogeneratedExamples.map(r=>DhP(r)),userProvidedExamples:t.userProvidedExamples.map(r=>DhP(r)),shape:he.V55.types.Type._visit(t.shape,{union:r=>he.V54.types.Type.union({...r,baseProperties:r.baseProperties.map(i=>({...i,valueType:mP(i.valueType)})),types:r.types.map(i=>DWF(i))}),enum:he.V54.types.Type.enum,object:r=>he.V54.types.Type.object({...r,properties:r.properties.map(i=>({...i,valueType:mP(i.valueType)})),extendedProperties:r.extendedProperties?.map(i=>({...i,valueType:mP(i.valueType)}))}),alias:r=>he.V54.types.Type.alias({aliasOf:mP(r.aliasOf),resolvedType:MWF(r.resolvedType)}),undiscriminatedUnion:r=>he.V54.types.Type.undiscriminatedUnion(AWF(r)),_other:()=>{throw new Error("Encountered unknown shape")}})}))}function pWF(e){return he.V54.ApiVersionScheme.header({...e,header:Jen(e.header)})}function _WF(e){return{...e,headers:e.headers.map(t=>Jen(t)),queryParameters:e.queryParameters.map(t=>uff(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),messages:e.messages.map(t=>hWF(t)),examples:e.examples.map(t=>QWF(t))}}function hWF(e){return{...e,body:yWF(e.body)}}function yWF(e){switch(e.type){case"inlinedBody":return he.V54.websocket.WebSocketMessageBody.inlinedBody({...e,properties:e.properties.map(t=>({...t,valueType:mP(t.valueType)}))});case"reference":return he.V54.websocket.WebSocketMessageBody.reference({...e,bodyType:mP(e.bodyType)})}}function vWF(e){return e.map(t=>bWF(t))}function bWF(e){return{...e,headers:e.headers.map(t=>Jen(t)),payload:gWF(e.payload),examples:e.examples!=null?e.examples.map(t=>OWF(t)):void 0}}function gWF(e){switch(e.type){case"reference":return he.V54.webhooks.WebhookPayload.reference({...e,payloadType:mP(e.payloadType)});case"inlinedPayload":return he.V54.webhooks.WebhookPayload.inlinedPayload({...e,properties:e.properties.map(t=>({...t,valueType:mP(t.valueType)}))})}}function OWF(e){return{...e,payload:d6(e.payload)}}function mWF(e){return{...e,schemes:e.schemes.map(t=>{switch(t.type){case"basic":return he.V54.auth.AuthScheme.basic(t);case"bearer":return he.V54.auth.AuthScheme.bearer(t);case"header":return he.V54.auth.AuthScheme.header(PWF(t));case"oauth":return he.V54.auth.AuthScheme.oauth(jWF(t))}})}}function PWF(e){return{...e,valueType:mP(e.valueType)}}function jWF(e){return{...e,configuration:he.V54.auth.OAuthConfiguration.clientCredentials({...e.configuration,tokenEndpoint:wWF(e.configuration.tokenEndpoint),refreshEndpoint:e.configuration.refreshEndpoint!=null?SWF(e.configuration.refreshEndpoint):void 0})}}function wWF(e){return{...e,requestProperties:{clientId:Sji(e.requestProperties.clientId),clientSecret:Sji(e.requestProperties.clientSecret),scopes:e.requestProperties.scopes!=null?Sji(e.requestProperties.scopes):void 0},responseProperties:{accessToken:zLr(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?zLr(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?zLr(e.responseProperties.refreshToken):void 0}}}function SWF(e){return{...e,requestProperties:{refreshToken:Sji(e.requestProperties.refreshToken)},responseProperties:{accessToken:zLr(e.responseProperties.accessToken),expiresIn:e.responseProperties.expiresIn!=null?zLr(e.responseProperties.expiresIn):void 0,refreshToken:e.responseProperties.refreshToken!=null?zLr(e.responseProperties.refreshToken):void 0}}}function Jen(e){return{...e,valueType:mP(e.valueType)}}function mP(e){return e.type==="container"&&e.container.type==="nullable"?bHF(e.container.nullable):e.type==="container"&&e.container.type==="optional"?vHF(e.container.optional):he.V55.types.TypeReference._visit(e,{container:t=>he.V54.types.TypeReference.container(qhP(t)),primitive:t=>he.V54.types.TypeReference.primitive(AhP(t)),named:he.V54.types.TypeReference.named,unknown:he.V54.types.TypeReference.unknown,_other:()=>{throw new Error("Unknown type reference: "+e.type)}})}function AhP(e){return{v1:e.v1,v2:e.v2!=null?e.v2:void 0}}function qhP(e){return he.V55.types.ContainerType._visit(e,{list:t=>he.V54.types.ContainerType.list(mP(t)),optional:t=>he.V54.types.ContainerType.optional(mP(t)),nullable:t=>he.V54.types.ContainerType.optional(mP(t)),set:t=>he.V54.types.ContainerType.set(mP(t)),map:({keyType:t,valueType:r})=>he.V54.types.ContainerType.map({keyType:mP(t),valueType:mP(r)}),literal:he.V54.types.ContainerType.literal,_other:()=>{throw new Error("Unknown ContainerType: "+e.type)}})}function DWF(e){return{...e,shape:EWF(e.shape)}}function EWF(e){return he.V55.types.SingleUnionTypeProperties._visit(e,{samePropertiesAsObject:t=>he.V54.types.SingleUnionTypeProperties.samePropertiesAsObject(t),singleProperty:t=>he.V54.types.SingleUnionTypeProperties.singleProperty({...t,type:mP(t.type)}),noProperties:he.V54.types.SingleUnionTypeProperties.noProperties,_other:()=>{throw new Error(`Unknown SingleUnionTypeProperties: ${JSON.stringify(e)}`)}})}function MWF(e){return he.V55.types.ResolvedTypeReference._visit(e,{container:t=>he.V54.types.ResolvedTypeReference.container(qhP(t)),named:he.V54.types.ResolvedTypeReference.named,primitive:t=>he.V54.types.ResolvedTypeReference.primitive(AhP(t)),unknown:he.V54.types.ResolvedTypeReference.unknown,_other:()=>{throw new Error("Unknown ResolvedTypeReference: "+e.type)}})}function AWF(e){return{members:e.members.map(t=>({...t,type:mP(t.type)}))}}function qWF(e){return{...e,pathParameters:e.pathParameters.map(t=>U6a(t)),headers:e.headers.map(t=>Jen(t)),endpoints:e.endpoints.map(t=>CWF(t))}}function U6a(e){return{...e,valueType:mP(e.valueType)}}function TWF(e){return{...e,type:mP(e.type)}}function CWF(e){return{...e,pagination:e.pagination!=null?RWF(e.pagination):void 0,allPathParameters:e.allPathParameters.map(t=>U6a(t)),pathParameters:e.pathParameters.map(t=>U6a(t)),sdkRequest:e.sdkRequest!=null?UWF(e.sdkRequest):void 0,requestBody:e.requestBody!=null?HWF(e.requestBody):void 0,response:e.response!=null?BWF(e.response):void 0,headers:e.headers.map(t=>Jen(t)),queryParameters:e.queryParameters.map(t=>uff(t)),autogeneratedExamples:e.autogeneratedExamples.map(t=>({...t,example:EhP(t.example)})),userSpecifiedExamples:e.userSpecifiedExamples.map(t=>({...t,example:t.example!=null?EhP(t.example):void 0}))}}function BWF(e){return{...e,body:e.body!=null?xWF(e.body):void 0}}function xWF(e){switch(e.type){case"json":return he.V54.http.HttpResponseBody.json(ThP(e.value));case"fileDownload":return he.V54.http.HttpResponseBody.fileDownload(e);case"bytes":return he.V54.http.HttpResponseBody.bytes(e);case"text":return he.V54.http.HttpResponseBody.text(e);case"streaming":return he.V54.http.HttpResponseBody.streaming(ChP(e.value));case"streamParameter":return he.V54.http.HttpResponseBody.streamParameter(zWF(e));default:Ko(e)}}function ThP(e){switch(e.type){case"response":return he.V54.http.JsonResponse.response({...e,responseBodyType:mP(e.responseBodyType)});case"nestedPropertyAsResponse":return he.V54.http.JsonResponse.nestedPropertyAsResponse({...e,responseBodyType:mP(e.responseBodyType),responseProperty:e.responseProperty!=null?off(e.responseProperty):void 0})}}function ChP(e){switch(e.type){case"json":return he.V54.http.StreamingResponse.json({...e,payload:mP(e.payload)});case"text":return he.V54.http.StreamingResponse.text(e);case"sse":return he.V54.http.StreamingResponse.sse({...e,payload:mP(e.payload)})}}function IWF(e){switch(e.type){case"json":return he.V54.http.NonStreamHttpResponseBody.json(ThP(e.value));case"bytes":return he.V54.http.NonStreamHttpResponseBody.bytes(e);case"text":return he.V54.http.NonStreamHttpResponseBody.text(e);case"fileDownload":return he.V54.http.NonStreamHttpResponseBody.fileDownload(e);default:Ko(e)}}function zWF(e){return{nonStreamResponse:IWF(e.nonStreamResponse),streamResponse:ChP(e.streamResponse)}}function RWF(e){switch(e.type){case"cursor":return he.V54.http.Pagination.cursor(NWF(e));case"offset":return he.V54.http.Pagination.offset(FWF(e))}}function NWF(e){return{...e,page:Sji(e.page),next:zLr(e.next),results:zLr(e.results)}}function FWF(e){return{...e,page:Sji(e.page),results:zLr(e.results),step:e.step!=null?Sji(e.step):void 0,hasNextPage:e.hasNextPage!=null?zLr(e.hasNextPage):void 0}}function Sji(e){return{...e,property:LWF(e.property)}}function LWF(e){switch(e.type){case"query":return he.V54.RequestPropertyValue.query(uff(e));case"body":return he.V54.RequestPropertyValue.body(off(e))}}function zLr(e){return{...e,property:off(e.property)}}function off(e){return{...e,valueType:mP(e.valueType)}}function uff(e){return{...e,valueType:mP(e.valueType)}}function UWF(e){return{...e,streamParameter:e.streamParameter!=null?Sji(e.streamParameter):void 0,shape:VWF(e.shape)}}function VWF(e){return he.V55.http.SdkRequestShape._visit(e,{justRequestBody:t=>he.V54.http.SdkRequestShape.justRequestBody(WWF(t)),wrapper:he.V54.http.SdkRequestShape.wrapper,_other:()=>{throw new Error("Unknown SdkRequestShape: "+e.type)}})}function WWF(e){switch(e.type){case"bytes":return he.V54.http.SdkRequestBodyType.bytes(e);case"typeReference":return he.V54.http.SdkRequestBodyType.typeReference({...e,requestBodyType:mP(e.requestBodyType)})}}function HWF(e){return he.V55.http.HttpRequestBody._visit(e,{inlinedRequestBody:t=>he.V54.http.HttpRequestBody.inlinedRequestBody({...t,properties:t.properties.map(r=>({...r,valueType:mP(r.valueType)})),extendedProperties:t.extendedProperties?.map(r=>({...r,valueType:mP(r.valueType)}))}),reference:t=>he.V54.http.HttpRequestBody.reference({...t,requestBodyType:mP(t.requestBodyType)}),fileUpload:t=>he.V54.http.HttpRequestBody.fileUpload({...t,properties:t.properties.map(r=>{switch(r.type){case"bodyProperty":return he.V54.http.FileUploadRequestProperty.bodyProperty({...r,valueType:mP(r.valueType)});case"file":return he.V54.http.FileUploadRequestProperty.file($WF(r.value))}})}),bytes:t=>he.V54.http.HttpRequestBody.bytes(t),_other:()=>{throw new Error("Unknown HttpRequestBody: "+e.type)}})}function $WF(e){switch(e.type){case"file":return he.V54.http.FileProperty.file(e);case"fileArray":return he.V54.http.FileProperty.fileArray(e)}}function GWF(e){return{...e,type:e.type!=null?mP(e.type):void 0,examples:e.examples.map(t=>({...t,shape:d6(t.shape)}))}}function QWF(e){return{...e,pathParameters:e.pathParameters.map(t=>wHu(t)),headers:e.headers.map(t=>aff(t)),queryParameters:e.queryParameters.map(t=>BhP(t)),messages:e.messages.map(t=>({...t,body:JWF(t.body)}))}}function BhP(e){return{...e,value:d6(e.value)}}function aff(e){return{...e,value:d6(e.value)}}function wHu(e){return{...e,value:d6(e.value)}}function JWF(e){switch(e.type){case"inlinedBody":return he.V54.ExampleWebSocketMessageBody.inlinedBody(xhP(e));case"reference":return he.V54.ExampleWebSocketMessageBody.reference(d6(e))}}function xhP(e){return{...e,properties:e.properties.map(t=>({...t,value:d6(t.value)}))}}function DhP(e){return{...e,shape:IhP(e.shape)}}function sff(e){switch(e.type){case"primitive":return he.V54.ExampleTypeReferenceShape.primitive(KWF(e));case"container":return he.V54.ExampleTypeReferenceShape.container(YWF(e));case"unknown":return he.V54.ExampleTypeReferenceShape.unknown(e.unknown);case"named":return he.V54.ExampleTypeReferenceShape.named({...e,typeName:e.typeName,shape:IhP(e.shape)})}}function KWF(e){return e.primitive}function YWF(e){switch(e.container.type){case"list":return he.V54.ExampleContainer.list({list:e.container.list.map(t=>d6(t)),itemType:mP(e.container.itemType)});case"set":return he.V54.ExampleContainer.set({set:e.container.set.map(t=>d6(t)),itemType:mP(e.container.itemType)});case"optional":return he.V54.ExampleContainer.optional({optional:e.container.optional!=null?d6(e.container.optional):void 0,valueType:mP(e.container.valueType)});case"nullable":return he.V54.ExampleContainer.optional({optional:e.container.nullable!=null?d6(e.container.nullable):void 0,valueType:mP(e.container.valueType)});case"map":return he.V54.ExampleContainer.map({map:e.container.map.map(t=>({key:d6(t.key),value:d6(t.value)})),keyType:mP(e.container.keyType),valueType:mP(e.container.valueType)});case"literal":return he.V54.ExampleContainer.literal({literal:e.container.literal})}}function d6(e){return{...e,shape:sff(e.shape)}}function IhP(e){switch(e.type){case"object":return he.V54.ExampleTypeShape.object({properties:e.properties.map(t=>zhP(t))});case"alias":return he.V54.ExampleTypeShape.alias({value:{...d6(e.value)}});case"enum":return he.V54.ExampleTypeShape.enum(e);case"union":return he.V54.ExampleTypeShape.union(ZWF(e));case"undiscriminatedUnion":return he.V54.ExampleTypeShape.undiscriminatedUnion(XWF(e))}}function XWF(e){return{...e,singleUnionType:d6(e.singleUnionType)}}function ZWF(e){return{...e,singleUnionType:kWF(e.singleUnionType)}}function kWF(e){return{...e,shape:eHF(e.shape)}}function eHF(e){switch(e.type){case"samePropertiesAsObject":return he.V54.ExampleSingleUnionTypeProperties.samePropertiesAsObject({...e,object:tHF(e.object)});case"singleProperty":return he.V54.ExampleSingleUnionTypeProperties.singleProperty({...e,shape:sff(e.shape)});case"noProperties":return he.V54.ExampleSingleUnionTypeProperties.noProperties()}}function tHF(e){return{...e,properties:e.properties.map(t=>zhP(t))}}function zhP(e){return{...e,value:{...e.value,shape:sff(e.value.shape)}}}function EhP(e){return{...e,rootPathParameters:e.rootPathParameters.map(t=>wHu(t)),servicePathParameters:e.servicePathParameters.map(t=>wHu(t)),endpointPathParameters:e.endpointPathParameters.map(t=>wHu(t)),serviceHeaders:e.serviceHeaders.map(t=>aff(t)),endpointHeaders:e.endpointHeaders.map(t=>aff(t)),queryParameters:e.queryParameters.map(t=>BhP(t)),request:e.request!=null?nHF(e.request):void 0,response:rHF(e.response)}}function rHF(e){switch(e.type){case"error":return he.V54.ExampleResponse.error({...e,body:e.body!=null?d6(e.body):void 0});case"ok":return he.V54.ExampleResponse.ok(iHF(e))}}function iHF(e){switch(e.value.type){case"body":return he.V54.ExampleEndpointSuccessResponse.body(e.value.value!=null?d6(e.value.value):void 0);case"stream":return he.V54.ExampleEndpointSuccessResponse.stream(e.value.value.map(t=>d6(t)));case"sse":return he.V54.ExampleEndpointSuccessResponse.sse(e.value.value.map(t=>({...t,data:d6(t.data)})))}}function nHF(e){switch(e.type){case"inlinedRequestBody":return he.V54.ExampleRequestBody.inlinedRequestBody(xhP(e));case"reference":return he.V54.ExampleRequestBody.reference(d6(e))}}function aHF(e){return{...e,types:od(e.types,t=>oHF(t)),endpoints:od(e.endpoints,t=>uHF(t)),headers:e.headers?.map(t=>C7t(t))}}function oHF(e){switch(e.type){case"alias":return he.V54.dynamic.NamedType.alias({...e,typeReference:eAe(e.typeReference)});case"enum":return he.V54.dynamic.NamedType.enum(e);case"object":return he.V54.dynamic.NamedType.object({...e,properties:e.properties.map(t=>C7t(t))});case"discriminatedUnion":return he.V54.dynamic.NamedType.discriminatedUnion({...e,types:Object.fromEntries(Object.entries(e.types).map(([t,r])=>[t,cHF(r)]))});case"undiscriminatedUnion":return he.V54.dynamic.NamedType.undiscriminatedUnion({...e,types:e.types.map(t=>eAe(t))});default:Ko(e)}}function uHF(e){return{...e,auth:e.auth!=null?sHF(e.auth):void 0,request:lHF(e.request)}}function sHF(e){switch(e.type){case"basic":return he.V54.dynamic.Auth.basic(e);case"bearer":return he.V54.dynamic.Auth.bearer(e);case"header":return he.V54.dynamic.Auth.header({header:C7t(e.header)})}}function eAe(e){switch(e.type){case"list":return he.V54.dynamic.TypeReference.list(eAe(e.value));case"optional":return OHF(e.value);case"nullable":return gHF(e.value);case"map":return he.V54.dynamic.TypeReference.map({...e,key:eAe(e.key),value:eAe(e.value)});case"literal":return he.V54.dynamic.TypeReference.literal(e.value);case"named":return he.V54.dynamic.TypeReference.named(e.value);case"primitive":return he.V54.dynamic.TypeReference.primitive(e.value);case"set":return he.V54.dynamic.TypeReference.set(eAe(e.value));case"unknown":return he.V54.dynamic.TypeReference.unknown();default:Ko(e)}}function cHF(e){switch(e.type){case"samePropertiesAsObject":return he.V54.dynamic.SingleDiscriminatedUnionType.samePropertiesAsObject({...e,properties:e.properties.map(t=>C7t(t))});case"singleProperty":return he.V54.dynamic.SingleDiscriminatedUnionType.singleProperty({...e,typeReference:eAe(e.typeReference),properties:e.properties?.map(t=>C7t(t))});case"noProperties":return he.V54.dynamic.SingleDiscriminatedUnionType.noProperties({...e,properties:e.properties?.map(t=>C7t(t))});default:Ko(e)}}function C7t(e){return{...e,typeReference:eAe(e.typeReference)}}function lHF(e){switch(e.type){case"body":return he.V54.dynamic.Request.body(fHF(e));case"inlined":return he.V54.dynamic.Request.inlined(dHF(e));default:Ko(e)}}function fHF(e){return{pathParameters:e.pathParameters?.map(t=>C7t(t)),body:e.body!=null?RhP(e.body):void 0}}function dHF(e){return{...e,pathParameters:e.pathParameters?.map(t=>C7t(t)),queryParameters:e.queryParameters?.map(t=>C7t(t)),headers:e.headers?.map(t=>C7t(t)),body:e.body!=null?pHF(e.body):void 0}}function pHF(e){switch(e.type){case"properties":return he.V54.dynamic.InlinedRequestBody.properties(e.value.map(t=>C7t(t)));case"referenced":return he.V54.dynamic.InlinedRequestBody.referenced(_HF(e));case"fileUpload":return he.V54.dynamic.InlinedRequestBody.fileUpload(hHF(e));default:Ko(e)}}function _HF(e){return{...e,bodyType:RhP(e.bodyType)}}function RhP(e){switch(e.type){case"bytes":return he.V54.dynamic.ReferencedRequestBodyType.bytes();case"typeReference":return he.V54.dynamic.ReferencedRequestBodyType.typeReference(eAe(e.value));default:Ko(e)}}function hHF(e){return{properties:e.properties.map(t=>yHF(t))}}function yHF(e){switch(e.type){case"file":return he.V54.dynamic.FileUploadRequestBodyProperty.file(e);case"fileArray":return he.V54.dynamic.FileUploadRequestBodyProperty.fileArray(e);case"bodyProperty":return he.V54.dynamic.FileUploadRequestBodyProperty.bodyProperty(C7t(e));default:Ko(e)}}function vHF(e){return e.type==="container"&&e.container.type==="nullable"?he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e.container.nullable))):he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e)))}function bHF(e){return e.type==="container"&&e.container.type==="optional"?mP(e):he.V54.types.TypeReference.container(he.V54.types.ContainerType.optional(mP(e)))}function gHF(e){return e.type==="optional"?eAe(e):he.V54.dynamic.TypeReference.optional(eAe(e))}function OHF(e){return e.type==="nullable"?he.V54.dynamic.TypeReference.optional(eAe(e.value)):he.V54.dynamic.TypeReference.optional(eAe(e))}var NhP={laterVersion:"v56",earlierVersion:"v55",firstGeneratorVersionToConsumeNewIR:{[J.TYPESCRIPT_NODE_SDK]:$e,[J.TYPESCRIPT_BROWSER_SDK]:$e,[J.TYPESCRIPT]:$e,[J.TYPESCRIPT_SDK]:$e,[J.TYPESCRIPT_EXPRESS]:$e,[J.JAVA]:$e,[J.JAVA_MODEL]:$e,[J.JAVA_SDK]:$e,[J.JAVA_SPRING]:$e,[J.PYTHON_FASTAPI]:$e,[J.PYTHON_PYDANTIC]:$e,[J.OPENAPI_PYTHON_CLIENT]:$e,[J.OPENAPI]:$e,[J.STOPLIGHT]:$e,[J.POSTMAN]:$e,[J.PYTHON_SDK]:$e,[J.GO_FIBER]:$e,[J.GO_MODEL]:$e,[J.GO_SDK]:$e,[J.RUBY_MODEL]:$e,[J.RUBY_SDK]:$e,[J.CSHARP_MODEL]:"0.0.2",[J.CSHARP_SDK]:"1.12.0-rc0",[J.SWIFT_MODEL]:$e,[J.SWIFT_SDK]:ii,[J.PHP_MODEL]:ii,[J.PHP_SDK]:$e},jsonifyEarlierVersion:e=>W_.V55.IntermediateRepresentation.jsonOrThrow(e,{unrecognizedObjectKeys:"strip",skipValidation:!0}),migrateBackwards:e=>({...e,services:od(e.services,t=>mHF(t))})};function mHF(e){return{...e,endpoints:e.endpoints.map(t=>PHF(t))}}function PHF(e){return{...e,pagination:jHF(e.pagination)}}function jHF(e){if(e!=null)switch(e.type){case"cursor":return he.V55.http.Pagination.cursor({next:e.next,page:e.page,results:e.results});case"offset":return he.V55.http.Pagination.offset({hasNextPage:e.hasNextPage,page:e.page,results:e.results,step:e.step});case"custom":return;default:Ko(e)}}function V6a(){return SHF}var SHu=class{migrations;constructor(t){this.migrations=t}withMigration(t){return new cff([...this.migrations,t])}},cff=class extends SHu{build(){return new lff(this.migrations)}},lff=class{migrations;constructor(t){this.migrations=t}migrateForGenerator({intermediateRepresentation:t,context:r,targetGenerator:i}){return this.migrate({intermediateRepresentation:t,shouldMigrate:n=>this.shouldRunMigration({migration:n,targetGenerator:i}),context:r,targetGenerator:i})}migrateThroughMigration({migration:t,intermediateRepresentation:r,context:i,targetGenerator:n}){return this.migrateThroughVersion({version:t.earlierVersion,intermediateRepresentation:r,context:i,targetGenerator:n})}migrateThroughVersion({version:t,intermediateRepresentation:r,context:i,targetGenerator:n}){let a=!1;if(this.migrations[0]?.laterVersion===t)return{ir:r,jsonify:()=>Promise.resolve().then(()=>t_.IntermediateRepresentation.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"}))};let l=this.migrate({intermediateRepresentation:r,shouldMigrate:d=>{let s=d.earlierVersion===t;return a||=s,s||!a},context:i,targetGenerator:n});return a||i.failAndThrow(`IR ${t} does not exist`),l}migrate({intermediateRepresentation:t,shouldMigrate:r,context:i,targetGenerator:n}){let a=t,u=async()=>await t_.IntermediateRepresentation.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"});for(let l of this.migrations){if(!r(l))break;i.logger.debug(`Migrating IR from ${l.laterVersion} to ${l.earlierVersion}`),a=l.migrateBackwards(a,{taskContext:i,targetGenerator:n}),u=()=>Promise.resolve().then(()=>l.jsonifyEarlierVersion(a))}return{ir:a,jsonify:u}}shouldRunMigration({migration:t,targetGenerator:r}){let i=t.firstGeneratorVersionToConsumeNewIR[r.name];if(i==null)throw new Error(`Cannot migrate intermediate representation. Unrecognized generator: ${r.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`);switch(i){case $e:return!0;case ii:throw new Error(`Cannot migrate intermediate representation. Generator was created after intermediate representation ${t.laterVersion}.`)}return Qre(i,r.version)}getIRVersionForGenerator({targetGenerator:t}){let r=this.migrations[0]?.laterVersion;for(let i of this.migrations)if(this.shouldRunMigration({migration:i,targetGenerator:t}))r=i.earlierVersion;else break;return r}},wHF={Builder:new SHu([])},SHF=wHF.Builder.withMigration(NhP).withMigration(MhP).withMigration(ShP).withMigration(hhP).withMigration(ihP).withMigration(Y_P).withMigration(H_P).withMigration(W_P).withMigration(U_P).withMigration(L_P).withMigration(R_P).withMigration(x_P).withMigration(B_P).withMigration(T_P).withMigration(q_P).withMigration(A_P).withMigration(M_P).withMigration(E_P).withMigration(D_P).withMigration(S_P).withMigration(w_P).withMigration(j_P).withMigration(P_P).withMigration(m_P).withMigration(g_P).withMigration(v_P).withMigration(y_P).withMigration(h_P).withMigration(s_P).withMigration(u_P).withMigration(o_P).withMigration(n_P).withMigration(i_P).withMigration(mQ0).withMigration(bQ0).withMigration(vQ0).withMigration(_Q0).withMigration(dQ0).withMigration(lQ0).withMigration(cQ0).withMigration(sQ0).withMigration(aQ0).withMigration(rQ0).withMigration(tQ0).withMigration(eQ0).withMigration(ZG0).withMigration(XG0).withMigration(YG0).withMigration(GG0).withMigration(WG0).withMigration(VG0).withMigration(UG0).withMigration(EG0).withMigration(wG0).withMigration(qp_).build();function W6a({intermediateRepresentation:e,context:t,targetGenerator:r}){return V6a().migrateForGenerator({intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function fff({intermediateRepresentation:e,context:t,targetGenerator:r,irVersion:i}){return V6a().migrateThroughVersion({version:i,intermediateRepresentation:e,context:t,targetGenerator:r}).jsonify()}function H6a({intermediateRepresentation:e,context:t,version:r}){return V6a().migrateThroughVersion({version:r,intermediateRepresentation:e,context:t}).jsonify()}async function LhP({project:e,irFilepath:t,cliContext:r,generationLanguage:i,audiences:n,version:a,keywords:u,smartCasing:l,readme:d,directFromOpenapi:s}){await Promise.all(e.apiWorkspaces.map(async o=>{await r.runTaskForWorkspace(o,async c=>{r.logger.info(`Generating IR for workspace ${o.workspaceName??"api"}`);let b=await DHF({workspace:o,context:c,generationLanguage:i,keywords:u,smartCasing:l,disableExamples:!1,audiences:n,version:a,readme:d,directFromOpenapi:s}),g=FhP.default.resolve(t);await EHr(Wl.of(g),b),c.logger.info(`Wrote IR to ${g}`)})}))}async function DHF({workspace:e,context:t,generationLanguage:r,audiences:i,keywords:n,smartCasing:a,disableExamples:u,version:l,readme:d,directFromOpenapi:s}){let o;if(s&&e instanceof y7)o=await e.getIntermediateRepresentation({context:t});else{let c=await e.toFernWorkspace({context:t});o=await tSn({workspace:c,context:t,generationLanguage:r,audiences:i,keywords:n,smartCasing:a,disableExamples:u,readme:d,includeDynamicExamples:!1})}return l==null?t_.IntermediateRepresentation.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}):H6a({intermediateRepresentation:o,version:l,context:t})}var UhP=require("fs/promises"),VhP=vi(require("path"),1);async function WhP({project:e,outputFilepath:t,cliContext:r}){await Promise.all(e.apiWorkspaces.map(async i=>{await r.runTaskForWorkspace(i,async n=>{let a=await Z_a(i,n),u=VhP.default.resolve(t);await(0,UhP.writeFile)(u,await qHr(a,{pretty:!0})),n.logger.info(`Wrote FDR API definition to ${u}`)})}))}var HhP=require("fs/promises"),$hP=vi(require("path"),1);async function GhP({project:e,irFilepath:t,cliContext:r,sdkLanguage:i}){await Promise.all(e.apiWorkspaces.map(async n=>{await r.runTaskForWorkspace(n,async a=>{if(n instanceof gfi){a.logger.info("Skipping, API is specified as a Fern Definition.");return}else if(!(n instanceof y7))return;let u=new e5t(n.absoluteFilePath),l=await $Ie({context:a,specs:n.specs}),d=TIi({context:a,documents:await u.loadDocuments({context:a,specs:l})}),s=$hP.default.resolve(t),o=await ev.OpenApiIntermediateRepresentation.jsonOrThrow(d,{skipValidation:!0});await(0,HhP.writeFile)(s,await qHr(o,{pretty:!0})),a.logger.info(`Wrote IR to ${s}`)})}))}var DHu=require("fs/promises");async function JhP({project:e,includeModels:t,cliContext:r}){await Promise.all(e.apiWorkspaces.map(async i=>{await r.runTaskForWorkspace(i,async n=>{i instanceof y7?await MHF({workspace:i,context:n,includeModels:t}):n.logger.warn("Skipping fern workspace definition generation")})}))}async function EHF(e,t){let r=null;try{let i=(await(0,DHu.readFile)(e,"utf8")).toString();try{r=JSON.parse(i)}catch{r=rp.load(i,{json:!0})}}catch{return t.failAndThrow(`Failed to read OpenAPI overrides from file ${e}`)}return r}async function MHF({workspace:e,includeModels:t,context:r}){let i=new e5t(e.absoluteFilePath),n=await $Ie({context:r,specs:e.specs});for(let a of n){let u=TIi({context:r,documents:await i.loadDocuments({context:r,specs:[a]})}),l={};a.absoluteFilepathToOverrides!==void 0&&(l=await EHF(a.absoluteFilepathToOverrides,r));let d="path"in l?l.path:{};for(let c of u.endpoints){let b=Tla(c);c.path in d||(d[c.path]={});let g=d[c.path];if(g!=null&&g[c.method]==null){let O=b.file.split("/").map(w=>w.replace(".yml","")).filter(w=>w!=="__package__"),m={};O.length>0&&(m["x-fern-sdk-group-name"]=O),m["x-fern-sdk-method-name"]=b.endpointId,g[c.method.toLowerCase()]=m}else l==null&&r.logger.warn(`Endpoint ${c.path} ${c.method} is defined multiple times`)}let s="path"in l?l.path:{};if(t){QhP(s,u.groupedSchemas.rootSchemas);for(let[c,b]of Object.entries(u.groupedSchemas.namespacedSchemas))QhP(s,b)}let o={schemas:s};await(0,DHu.writeFile)(Xu(fp(a.absoluteFilepath),Xa.of("openapi-overrides.yml")),rp.dump({paths:d,components:o}))}}function QhP(e,t){for(let[r,i]of Object.entries(t)){if(r in e)continue;let n={};n["x-fern-type-name"]="nameOverride"in i?i.nameOverride??r:r,e[r]=n}}var EHu="api",KhP="group";var YhP=".preview",XhP="approved-output-directories",ZhP=".fern";var nyP=require("fs/promises");var eyP=require("fs/promises");var khP=require("os");function $6a(){return Xu(Wl.of((0,khP.homedir)()),Xa.of(ZhP),Xa.of(XhP))}async function tyP(){let e=$6a();if(!await Cf(e))return[];let r=await(0,eyP.readFile)(e,{encoding:"utf-8"});return JSON.parse(r)}var MHu=require("fs/promises"),ryP=vi(require("path"),1);async function iyP(e){await(0,MHu.mkdir)(ryP.default.dirname($6a()),{recursive:!0}),await(0,MHu.writeFile)($6a(),JSON.stringify(e,null,2))}async function ayP(e,t,r){if(!e||zfs()||r)return{shouldProceed:!0};let i=await tyP();return i?.includes(e)?{shouldProceed:!0}:await Cf(e)?(await(0,nyP.readdir)(e)).length===0?{shouldProceed:!0}:await t.confirmPrompt(`Directory ${e} contains existing files that may be overwritten. Continue?`,!1)?(await iyP([...i??[],e]),{shouldProceed:!0}):{shouldProceed:!1}:{shouldProceed:!0}}var DmP=vi(Cg(),1),y6t=vi(PmP(),1),sAe=vi(xq(),1);var Uji=vi(require("path"),1),ltn="/fern",ftn=Uji.default.join(ltn,"output"),qdf=Uji.default.join(ltn,"config.json"),Y$u=Uji.default.join(ltn,"ir.json"),d2a=Uji.default.join(ltn,"snippet.json"),p2a=Uji.default.join(ltn,"snippet-templates.json"),RlV=Uji.default.join(ltn,"generators"),jmP=Uji.default.join(ltn,"sources");var WZF="0.0.1";function wmP(e){return e!=null?DmP.GithubPublishInfo._visit(e,{npm:t=>y6t.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:t.registryUrl,packageName:t.packageName,tokenEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.token??"")}),maven:t=>y6t.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:t.registryUrl,coordinate:t.coordinate,usernameEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.password??""),signature:t.signature!=null?{keyIdEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.keyId??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.password??""),secretKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.signature.secretKey??"")}:void 0}),pypi:t=>y6t.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:t.registryUrl,packageName:t.packageName,usernameEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.username??""),passwordEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.credentials?.password??"")}),rubygems:t=>y6t.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??"")}),postman:t=>y6t.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??""),workspaceIdEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.workspaceId??"")}),nuget:t=>y6t.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:t.registryUrl,packageName:t.packageName,apiKeyEnvironmentVariable:(0,sAe.EnvironmentVariable)(t.apiKey??"")}),_other:()=>{}}):void 0}function EmP({generatorInvocation:e,customConfig:t,workspaceName:r,organization:i,outputVersion:n=WZF,absolutePathToSnippet:a,absolutePathToSnippetTemplates:u,writeUnitTests:l,generateOauthClients:d,generatePaginatedClients:s}){let o=[],c=e.outputMode._visit({publish:b=>({...SmP(n,b),publishingMetadata:e.publishMetadata}),publishV2:b=>({...SmP(n,b),publishingMetadata:e.publishMetadata}),downloadFiles:()=>({mode:y6t.FernGeneratorExec.OutputMode.downloadFiles(),path:ftn,publishingMetadata:e.publishMetadata}),github:b=>{let g={mode:y6t.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${b.owner}/${b.repo}`,version:n,publishInfo:wmP(b.publishInfo),installationToken:void 0}),path:ftn,publishingMetadata:e.publishMetadata};return a!==void 0&&(o.push(`${a}:${d2a}`),g.snippetFilepath=d2a),u!==void 0&&(o.push(`${u}:${p2a}`),g.snippetTemplateFilepath=p2a),g},githubV2:b=>{let g=b._visit({commitAndRelease:m=>`https://github.com/${m.owner}/${m.repo}`,push:m=>`https://github.com/${m.owner}/${m.repo}`,pullRequest:m=>`https://github.com/${m.owner}/${m.repo}`,_other:()=>{throw new Error("Encountered unknown github mode")}}),O={mode:y6t.FernGeneratorExec.OutputMode.github({repoUrl:g,version:n,publishInfo:wmP(b.publishInfo)}),path:ftn,publishingMetadata:e.publishMetadata};return a!==void 0&&(o.push(`${a}:${d2a}`),O.snippetFilepath=d2a),u!==void 0&&(o.push(`${u}:${p2a}`),O.snippetTemplateFilepath=p2a),O},_other:()=>{throw new Error("Output type did not match any of the types supported by Fern")}});return{binds:o,config:{irFilepath:Y$u,output:c,publish:void 0,customConfig:t,workspaceName:r,organization:i,environment:y6t.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:!1,writeUnitTests:l,generateOauthClients:d,generatePaginatedClients:s}}}function SmP(e,t){let r;return"registryOverrides"in t?r=t.registryOverrides.maven??t.registryOverrides.npm:r!=null&&(r=t._visit({mavenOverride:i=>i,npmOverride:i=>i,pypiOverride:i=>i,rubyGemsOverride:i=>i,postman:i=>i,nugetOverride:i=>i,_other:()=>{}})),{mode:y6t.FernGeneratorExec.OutputMode.publish({registries:{maven:{group:"",password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??""},npm:{registryUrl:r?.registryUrl??"",scope:"",token:r?.token??""}},publishTarget:void 0,registriesV2:{maven:{password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??"",coordinate:r?.coordinate??"",signature:r?.signature},npm:{registryUrl:r?.registryUrl??"",token:r?.token??"",packageName:r?.packageName??""},pypi:{packageName:r?.coordinate??"",password:r?.password??"",registryUrl:r?.registryUrl??"",username:r?.username??"",pypiMetadata:r?.pypiMetadata},rubygems:{registryUrl:r?.registryUrl??"",apiKey:r?.apiKey??"",packageName:r?.packageName??""},nuget:{registryUrl:r?.registryUrl??"",apiKey:r?.apiKey??"",packageName:r?.packageName??""}},version:e}),path:ftn}}async function MmP({workspace:e,audiences:t,generatorInvocation:r,context:i,irVersionOverride:n,version:a,packageName:u,sourceConfig:l,includeOptionalRequestPropertyExamples:d}){let s=_2({workspace:e,audiences:t,generationLanguage:r.language,keywords:r.keywords,smartCasing:r.smartCasing,exampleGeneration:{includeOptionalRequestPropertyExamples:d,disabled:r.disableExamples},readme:r.readme,version:a,packageName:u,context:i,sourceResolver:new d2(i,e),includeDynamicExamples:!0});l!=null&&(s.sourceConfig=l),i.logger.debug("Generated IR");let o=n!=null?await H6a({intermediateRepresentation:s,context:i,version:n}):await W6a({intermediateRepresentation:s,context:i,targetGenerator:{name:r.name,version:r.version}});return{latest:s,migrated:o}}var BmP=require("fs/promises"),oUn=vi(fte(),1);var AmP=require("fs/promises"),qmP=vi(fte(),1);async function Tdf({logger:e,imageName:t,args:r=[],binds:i=[],writeLogsToFile:n=!0,removeAfterCompletion:a=!1}){let u=()=>HZF({logger:e,imageName:t,args:r,binds:i,removeAfterCompletion:a,writeLogsToFile:n});try{await u()}catch(l){if(l instanceof Error&&l.message.includes("No such image"))await $ZF(t),await u();else throw l}}async function HZF({logger:e,imageName:t,args:r,binds:i,removeAfterCompletion:n,writeLogsToFile:a}){let u=["run","--user","root",...i.flatMap(c=>["-v",c]),n?"--rm":"",t,...r].filter(Boolean),{stdout:l,stderr:d,exitCode:s}=await eG(e,"docker",u,{reject:!1,all:!0,doNotPipeOutput:!0}),o=l+d;if(a){let c=await qmP.default.file();await(0,AmP.writeFile)(c.path,o),e.info(`Generator logs here: ${c.path}`)}if(s!==0)throw new Error(`Docker exited with code ${s}.
|
|
1996
1996
|
${l}
|
|
1997
1997
|
${d}`)}async function $ZF(e){await eG(void 0,"docker",["pull",e],{all:!0,doNotPipeOutput:!0})}var xmP=vi(Vf(),1);var TmP=vi(aNo(),1),nje=require("fs/promises"),CmP=vi(fte(),1);var X$u=class{context;absolutePathToTmpOutputDirectory;absolutePathToTmpSnippetJSON;absolutePathToTmpSnippetTemplatesJSON;absolutePathToLocalSnippetTemplateJSON;absolutePathToLocalOutput;absolutePathToLocalSnippetJSON;constructor({context:t,absolutePathToTmpOutputDirectory:r,absolutePathToTmpSnippetJSON:i,absolutePathToLocalSnippetTemplateJSON:n,absolutePathToLocalOutput:a,absolutePathToLocalSnippetJSON:u,absolutePathToTmpSnippetTemplatesJSON:l}){this.context=t,this.absolutePathToLocalOutput=a,this.absolutePathToTmpOutputDirectory=r,this.absolutePathToTmpSnippetJSON=i,this.absolutePathToLocalSnippetJSON=u,this.absolutePathToLocalSnippetTemplateJSON=n,this.absolutePathToTmpSnippetTemplatesJSON=l}async copyGeneratedFiles(){await this.isFernIgnorePresent()?await this.copyGeneratedFilesWithFernIgnore():await this.copyGeneratedFilesNoFernIgnore(),this.absolutePathToTmpSnippetJSON!=null&&this.absolutePathToLocalSnippetJSON!=null&&await Cf(this.absolutePathToTmpSnippetJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetJSON}),this.absolutePathToTmpSnippetTemplatesJSON!=null&&this.absolutePathToLocalSnippetTemplateJSON!=null&&await Cf(this.absolutePathToTmpSnippetTemplatesJSON)&&await this.copySnippetJSON({absolutePathToTmpSnippetJSON:this.absolutePathToTmpSnippetTemplatesJSON,absolutePathToLocalSnippetJSON:this.absolutePathToLocalSnippetTemplateJSON})}async isFernIgnorePresent(){let t=Wl.of(Xu(this.absolutePathToLocalOutput,Xa.of(uQa)));return await Cf(t)}async copyGeneratedFilesWithFernIgnore(){let t=Wl.of((await CmP.default.dir({})).path),r=Wl.of(Xu(this.absolutePathToLocalOutput,Xa.of(uQa))),i=await QZF({absolutePathToFernignore:r});await(0,nje.cp)(this.absolutePathToLocalOutput,t,{recursive:!0}),await this.runGitCommand(["init"],t),await this.runGitCommand(["add","."],t),(await this.runGitCommand(["config","--list"],t)).includes("user.name")||(await this.runGitCommand(["config","user.name","fern-api"],t),await this.runGitCommand(["config","user.email","info@buildwithfern.com"],t)),await this.runGitCommand(["commit","--allow-empty","-m",'"init"'],t),await this.runGitCommand(["rm","-rf","."],t),await this.copyGeneratedFilesToDirectory(t),await this.runGitCommand(["reset","--",...i],t),await this.runGitCommand(["restore","."],t),await(0,nje.rmdir)(this.absolutePathToLocalOutput,{recursive:!0}),await(0,nje.cp)(t,this.absolutePathToLocalOutput,{recursive:!0})}async copyGeneratedFilesNoFernIgnore(){this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`),await(0,nje.rm)(this.absolutePathToLocalOutput,{force:!0,recursive:!0}),await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput)}async copyGeneratedFilesToDirectory(t){let[r,...i]=await(0,nje.readdir)(this.absolutePathToTmpOutputDirectory);if(r!=null)if(this.context.logger.debug(`Copying generated files to ${t}`),r.endsWith(".zip")){await(0,TmP.default)(Xu(this.absolutePathToTmpOutputDirectory,Xa.of(r)),t);for(let n of i)await(0,nje.cp)(Xu(this.absolutePathToTmpOutputDirectory,Xa.of(n)),Xu(t,Xa.of(n)),{recursive:!0})}else await(0,nje.cp)(this.absolutePathToTmpOutputDirectory,t,{recursive:!0})}async copySnippetJSON({absolutePathToTmpSnippetJSON:t,absolutePathToLocalSnippetJSON:r}){this.context.logger.debug(`Copying generated snippets to ${r}`),await(0,nje.cp)(t,r)}async runGitCommand(t,r){return(await eG(this.context.logger,"git",t,{cwd:r,doNotPipeOutput:!0})).stdout}},GZF=/\r?\n/;async function QZF({absolutePathToFernignore:e}){let t=(await(0,nje.readFile)(e)).toString();return[uQa,...t.trim().split(GZF).filter(r=>!r.startsWith("#")&&r.length>0)]}async function ImP({organization:e,workspace:t,generatorInvocation:r,absolutePathToLocalOutput:i,absolutePathToLocalSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:a,absolutePathToFernConfig:u,audiences:l,workspaceTempDir:d,keepDocker:s,context:o,irVersionOverride:c,outputVersionOverride:b,writeUnitTests:g,generateOauthClients:O,generatePaginatedClients:m,includeOptionalRequestPropertyExamples:w}){let{latest:E,migrated:A}=await MmP({workspace:t,audiences:l,generatorInvocation:r,context:o,irVersionOverride:c,packageName:c0.getPackageName({generatorInvocation:r}),version:b,sourceConfig:YZF(t),includeOptionalRequestPropertyExamples:w}),q=await JZF({workspaceTempDir:d,context:o,ir:A});o.logger.debug("Wrote IR to: "+q);let D=await oUn.default.file({tmpdir:d.path}),C=Wl.of(D.path);o.logger.debug("Will write config.json to: "+C);let R=await oUn.default.dir({tmpdir:d.path}),$=Wl.of(R.path);o.logger.debug("Will write output to: "+$);let I;if(n!=null){let K=await oUn.default.file({tmpdir:d.path});I=Wl.of(K.path),o.logger.debug("Will write snippet.json to: "+I)}let U;if(a!=null){let K=await oUn.default.file({tmpdir:d.path});U=Wl.of(K.path),o.logger.debug("Will write snippet-templates.json to: "+U)}let{generatorConfig:H}=await KZF({absolutePathToOutput:$,absolutePathToSnippet:I,absolutePathToSnippetTemplates:U,absolutePathToIr:q,absolutePathToWriteConfigJson:C,workspaceName:t.definition.rootApiFile.contents.name,organization:e,outputVersion:b,keepDocker:s,generatorInvocation:r,context:o,writeUnitTests:g,generateOauthClients:O,generatePaginatedClients:m,sources:t.getSources()});return await new X$u({context:o,absolutePathToLocalOutput:i,absolutePathToTmpOutputDirectory:$,absolutePathToLocalSnippetJSON:n,absolutePathToLocalSnippetTemplateJSON:a,absolutePathToTmpSnippetJSON:I,absolutePathToTmpSnippetTemplatesJSON:U}).copyGeneratedFiles(),{absolutePathToIr:q,absolutePathToConfigJson:C,ir:E,generatorConfig:H}}async function JZF({ir:e,workspaceTempDir:t,context:r}){r.logger.debug("Migrated IR");let i=await oUn.default.file({tmpdir:t.path}),n=Wl.of(i.path);return await EHr(n,e,{pretty:!1}),r.logger.debug(`Wrote IR to ${n}`),n}async function KZF({workspaceName:e,organization:t,outputVersion:r,absolutePathToOutput:i,absolutePathToSnippet:n,absolutePathToSnippetTemplates:a,absolutePathToIr:u,absolutePathToWriteConfigJson:l,keepDocker:d,context:s,generatorInvocation:o,writeUnitTests:c,generateOauthClients:b,generatePaginatedClients:g,sources:O}){let{name:m,version:w,config:E}=o,A=`${m}:${w}`,q=[`${l}:${qdf}:ro`,`${u}:${Y$u}:ro`,`${i}:${ftn}`];for(let I of O)q.push(`${I.absoluteFilePath}:${zmP(I)}:ro`);let{config:D,binds:C}=EmP({generatorInvocation:o,customConfig:E,workspaceName:e,outputVersion:r,organization:t,absolutePathToSnippet:n,absolutePathToSnippetTemplates:a,writeUnitTests:c,generateOauthClients:b,generatePaginatedClients:g});q.push(...C);let R=await xmP.GeneratorConfig.json(D);if(!R.ok)throw new Error(`Failed to parse config.json into ${l}`);if(await(0,BmP.writeFile)(l,JSON.stringify(R.value,void 0,4)),!await xfs(l,5e3))throw new Error(`Failed to create ${l}`);return await Tdf({logger:s.logger,imageName:A,args:[qdf],binds:q,removeAfterCompletion:!d}),{generatorConfig:D}}function YZF(e){return{sources:e.getSources().map(t=>t.type==="protobuf"?Yte.proto({id:t.id,protoRootUrl:`file:///${zmP(t)}`}):Yte.openapi())}}function zmP(e){return`${jmP}/${e.id}`}var Cdf=vi(require("os"),1),RmP=vi(require("path"),1),NmP=vi(fte(),1);async function Bdf({projectConfig:e,workspace:t,generatorGroup:r,keepDocker:i,context:n}){let a=await XZF();(await Promise.all(r.generators.map(async l=>n.runInteractiveTask({name:l.name},async d=>{if(l.absolutePathToLocalOutput==null)d.failWithoutThrowing("Cannot generate because output location is not local-file-system");else{let s=await t.toFernWorkspace({context:n},qPn(l));await ImP({organization:e.organization,absolutePathToFernConfig:e._absolutePath,workspace:s,generatorInvocation:l,absolutePathToLocalOutput:l.absolutePathToLocalOutput,absolutePathToLocalSnippetJSON:void 0,absolutePathToLocalSnippetTemplateJSON:void 0,audiences:r.audiences,workspaceTempDir:a,keepDocker:i,context:d,irVersionOverride:l.irVersionOverride,outputVersionOverride:void 0,writeUnitTests:!1,generateOauthClients:!1,generatePaginatedClients:!1}),d.logger.info(Qs.green("Wrote files to "+l.absolutePathToLocalOutput))}})))).some(l=>!l)&&n.failAndThrow()}async function XZF(){return NmP.default.dir({tmpdir:Cdf.default.platform()==="darwin"?RmP.default.join("/private",Cdf.default.tmpdir()):void 0,prefix:"fern"})}var nGu=vi(TTi(),1);var FmP=require("fs"),Z$u=require("fs/promises"),LmP=require("stream/promises");async function UmP({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await ZZF({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(Qs.green(`Downloaded to ${t}`))}catch{r.logger.debug(Qs.yellow("Failed to download snippet.json from output."))}}async function ZZF({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await gR.get(e,{responseType:"stream"});await Cf(t)&&await(0,Z$u.rm)(t,{recursive:!0}),await(0,Z$u.mkdir)(fp(t),{recursive:!0}),await(0,LmP.pipeline)(r.data,(0,FmP.createWriteStream)(t))}var zdf=vi(zte(),1);var $mP=vi(aNo(),1),GmP=require("fs"),tGu=require("fs/promises"),Idf=vi(require("path"),1),QmP=require("stream/promises");var k$u=vi(HmP(),1);function Nei(e,t,{target:r="stdout",...i}={}){return k$u.default[r]?Umn.link(e,t):i.fallback===!1?e:typeof i.fallback=="function"?i.fallback(e,t):`${e} (\u200B${t}\u200B)`}Nei.isSupported=k$u.default.stdout;Nei.stderr=(e,t,r={})=>Nei(e,t,{target:"stderr",...r});Nei.stderr.isSupported=k$u.default.stderr;var JmP=vi(fte(),1);var eGu=class{context;generatorInvocation;absolutePathToPreview;lengthOfLastLogs=0;constructor({interactiveTaskContext:t,generatorInvocation:r,absolutePathToPreview:i}){this.context=t,this.generatorInvocation=r,this.absolutePathToPreview=i}async processUpdate(t){t==null&&this.context.failAndThrow("Task is missing on job status");let r=t.packages.map(n=>n.coordinate._visit({npm:a=>`${a.name}@${a.version}`,maven:a=>`${a.group}:${a.artifact}:${a.version}`,pypi:a=>`${a.name} ${a.version}`,ruby:a=>`${a.name}:${a.version}`,nuget:a=>`${a.name} ${a.version}`,_other:()=>"<unknown package>"}));this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(n=>`\u25E6 ${n}`).join(`
|
|
1998
1998
|
`):void 0);for(let n of t.logs.slice(this.lengthOfLastLogs))this.context.logger.log(rkF(n.level),n.message);this.lengthOfLastLogs=t.logs.length;let i=n=>{this.context.logger.debug(`Generated files. ${Nei("View here",n,{fallback:(a,u)=>`${a}: ${u}`})}`)};return await t.status._visit({notStarted:Qo,running:Qo,failed:({message:n,s3PreSignedReadUrl:a})=>{a!=null&&i(a),this.context.failAndThrow(n)},finished:async n=>{if(n.s3PreSignedReadUrlV2!=null){i(n.s3PreSignedReadUrlV2);let a=this.getAbsolutePathToLocalOutput();a!=null&&await ekF({s3PreSignedReadUrl:n.s3PreSignedReadUrlV2,absolutePathToLocalOutput:a,context:this.context})}if(this.absolutePathToPreview==null)for(let a of r)this.context.logger.info(`Published ${a}`);this.#e=!0,this.#t=n.createdSnippets!=null?n.createdSnippets:!1,this.#r=n.snippetsS3PreSignedReadUrl},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Xu(this.absolutePathToPreview,Xa.of(Idf.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}};async function ekF({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{await tkF({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(Qs.green(`Downloaded to ${t}`))}catch(i){r.failAndThrow("Failed to download files",i)}}async function tkF({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await gR.get(e,{responseType:"stream"}),i=await JmP.default.dir({prefix:"fern",unsafeCleanup:!0}),n=Idf.default.join(i.path,"output.zip");await(0,QmP.pipeline)(r.data,(0,GmP.createWriteStream)(n)),await Cf(t)&&await(0,tGu.rm)(t,{recursive:!0}),await(0,tGu.mkdir)(t,{recursive:!0}),await(0,$mP.default)(n,t)}function rkF(e){switch(e){case"DEBUG":return B0.Debug;case"INFO":return B0.Info;case"WARN":return B0.Warn;case"ERROR":return B0.Error;default:return B0.Info}}var iGu=require("fs/promises"),KmP=vi(fte(),1);var ikF="proto.zip",rGu=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(i=>[i.id,i])),this.sourceTypes=new Set(Object.values(this.sources).map(i=>i.type))}async uploadSources(t){for(let[r,i]of Object.entries(t)){let n=this.getSourceOrThrow(r);await this.uploadSource(n,i.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let i=await this.getUploadCommand(t),n=await(0,iGu.readFile)(i.absoluteFilePath),a=await fetch(r,{method:"PUT",body:n,headers:{"Content-Type":"application/octet-stream"}});await i.cleanup(),a.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${a.status}, ${a.statusText}`)}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,iGu.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await KmP.default.dir(),i=Xu(Wl.of(r.path),Xa.of(ikF));return this.context.logger.debug(`Zipping source ${t} into ${i}`),await eG(this.context.logger,"zip",["-r",i,"."],{cwd:t,doNotPipeOutput:!0}),i}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[i,n]of Object.entries(t))switch(this.getSourceOrThrow(i).type){case"protobuf":r.push(Yte.proto({id:i,protoRootUrl:n.downloadUrl}));continue;case"openapi":r.push(Yte.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`),r}};var YmP=vi(JZn(),1),aje=require("fs/promises");var XmP=require("path"),ZmP=vi(PBo(),1),kmP=vi(fte(),1);var sUn=vi(TTi(),1);async function ePP({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:i,generatorInvocation:n,version:a,context:u,shouldLogS3Url:l,token:d,whitelabel:s,irVersionOverride:o,absolutePathToPreview:c}){let b=await nkF({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:a,context:u,shouldLogS3Url:l,token:d,whitelabel:s,absolutePathToPreview:c});return await akF({intermediateRepresentation:i,job:b,context:u,generatorInvocation:n,irVersionOverride:o}),b}async function nkF({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:n,context:a,shouldLogS3Url:u,token:l,whitelabel:d,absolutePathToPreview:s}){let o=D$r({token:l.value}),c={id:i.name,version:i.version,outputMode:i.outputMode,customConfig:i.config,publishMetadata:i.publishMetadata},b;if(i.outputMode.type.startsWith("github"))try{let O=await kmP.default.dir(),m=Wl.of(O.path);a.logger.debug(`Writing mock fern definition to ${m}`);let w=Xu(m,Xa.of(JL)),E=Xu(w,Xa.of(b8));await(0,aje.mkdir)(E,{recursive:!0});let A=Xu(E,Xa.of(T3));await(0,aje.writeFile)(A,rp.dump(t.definition.rootApiFile.contents)),await tPP({absolutePathToDefinitionDirectory:E,definition:t.definition});let q=Xu(w,Xa.of(ste));await(0,aje.writeFile)(q,JSON.stringify(e.rawConfig,void 0,2));try{let R=t.getSources();for(let $ of R){let I=await(0,aje.readFile)($.absoluteFilePath),U=(0,XmP.relative)(t.absoluteFilePath,$.absoluteFilePath),H=Xu(w,Xa.of(U));await(0,aje.mkdir)(fp(H),{recursive:!0}),await(0,aje.writeFile)(H,new Uint8Array(I))}}catch(R){a.logger.debug(`Failed to write source files to disk, continuing: ${R}`)}let D=Xu(m,Xa.of("definition.tgz"));await(0,ZmP.create)({file:D,cwd:w},["."]),a.logger.debug("Getting upload URL for Fern definition.");let C=await o.remoteGen.getDefinitionUploadUrl({apiName:t.definition.rootApiFile.contents.name,organizationName:r,version:n});C.ok?(a.logger.debug("Uploading definition..."),await gR.put(C.body.s3Url,await(0,aje.readFile)(D)),b={definitionS3DownloadUrl:C.body.s3Url,outputPath:".mock",cliVersion:e.version}):C.error.content.reason==="status-code"?a.logger.debug(`Failed with status-code to get upload URL with status code ${C.error.content.statusCode}, continuing: ${C.error.content.body}`):C.error.content.reason==="non-json"?a.logger.debug(`Failed with non-json to get upload URL with status code ${C.error.content.statusCode}, continuing: ${C.error.content.rawBody}`):C.error.content.reason==="unknown"&&a.logger.debug(`Failed to get upload URL as unknown error occurred continuing: ${C.error.content.errorMessage}`)}catch(O){a.logger.debug(`Failed to upload definition to S3, continuing: ${O}`)}let g=await o.remoteGen.createJobV3({apiName:t.definition.rootApiFile.contents.name,version:n,organizationName:r,generators:[c],uploadToS3:ukF({outputMode:i.outputMode,generatorInvocation:i,absolutePathToPreview:s,shouldLogS3Url:u}),whitelabel:d,fernDefinitionMetadata:b,preview:s!=null});return g.ok?g.body:okF(g.error)._visit({illegalApiNameError:()=>a.failAndThrow("API name is invalid: "+t.definition.rootApiFile.contents.name),illegalApiVersionError:()=>a.failAndThrow("API version is invalid: "+n),cannotPublishToNpmScope:({validScope:O,invalidScope:m})=>a.failAndThrow(`You do not have permission to publish to ${m} (expected ${O})`),cannotPublishToMavenGroup:({validGroup:O,invalidGroup:m})=>a.failAndThrow(`You do not have permission to publish to ${m} (expected ${O})`),cannotPublishPypiPackage:({validPrefix:O,invalidPackageName:m})=>a.failAndThrow(`You do not have permission to publish to ${m} (expected ${O})`),generatorsDoNotExistError:O=>a.failAndThrow("Generators do not exist: "+O.nonExistentGenerators.map(m=>`${m.id}@${m.version}`).join(", ")),insufficientPermissions:()=>a.failAndThrow("Insufficient permissions."),orgNotConfiguredForWhitelabel:()=>a.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com."),_other:O=>a.failAndThrow("Failed to create job",O)})}async function tPP({absolutePathToDefinitionDirectory:e,definition:t}){for(let[r,i]of Object.entries(t.namedDefinitionFiles)){let n=Xu(e,Xa.of(r));await(0,aje.mkdir)(fp(n),{recursive:!0}),await(0,aje.writeFile)(n,rp.dump(i.contents))}for(let[r,i]of Object.entries(t.packageMarkers))if(i.contents.export==null){let n=Xu(e,Xa.of(r));await(0,aje.mkdir)(fp(n),{recursive:!0}),await(0,aje.writeFile)(n,rp.dump(i.contents))}for(let[r,i]of Object.entries(t.importedDefinitions))await tPP({absolutePathToDefinitionDirectory:Xu(e,Xa.of(r)),definition:i.definition})}async function akF({intermediateRepresentation:e,generatorInvocation:t,job:r,context:i,irVersionOverride:n}){let a=n==null?await W6a({intermediateRepresentation:e,context:i,targetGenerator:{name:t.name,version:t.version}}):await fff({intermediateRepresentation:e,context:i,irVersion:n,targetGenerator:{name:t.name,version:t.version}}),u=new YmP.default,l=await qHr(a,{onWrite:s=>{i.logger.debug("Wrote IR to disk: "+s)}});u.append("file",l);let d=Cv(sgs(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await gR.post(d,u,{headers:u.getHeaders(),maxBodyLength:1/0})}catch(s){let o=s instanceof gtp?s.response?.data:s;i.logger.debug(`POST ${d} failed with ${JSON.stringify(s)}`),i.failAndThrow("Failed to start job",o)}}function okF(e){if(e?.reason==="status-code"){let t=e.body;switch(t?._error){case"IllegalApiNameError":return sUn.FernFiddle.remoteGen.createJobV3.Error.illegalApiNameError();case"GeneratorsDoNotExistError":return sUn.FernFiddle.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.body);case"CannotPublishToNpmScope":return sUn.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.body);case"CannotPublishToMavenScope":return sUn.FernFiddle.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.body);case"InsufficientPermissions":return sUn.FernFiddle.remoteGen.createJobV3.Error.insufficientPermissions(t.body)}}return e}function ukF({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:i}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||i}var rPP=D$r();var skF=3;function iPP({job:e,taskId:t,taskHandler:r,context:i}){let n=0,a=async()=>{let u=await rPP.remoteGen.getJobStatus(e.jobId);if(u.ok)return u.body[t];i.logger.debug("Failed to get job status.",JSON.stringify(u.error.content))};return new Promise((u,l)=>{d();async function d(){try{let s=await a();if(s==null)n++,n===skF&&i.failAndThrow(`Failed to get job status after ${n} attempts.`),setTimeout(d,2e3+1e3*n);else{n=0;let o=await r.processUpdate(s);r.isFinished?u(o):setTimeout(d,2e3)}}catch(s){l(s)}}})}async function nPP({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:i,generatorInvocation:n,version:a,audiences:u,shouldLogS3Url:l,token:d,whitelabel:s,irVersionOverride:o,absolutePathToPreview:c,readme:b}){let g=zTi({token:d.value}),O=c0.getPackageName({generatorInvocation:n}),m=_2({workspace:r,generationLanguage:n.language,keywords:n.keywords,smartCasing:n.smartCasing,exampleGeneration:{disabled:n.disableExamples,skipAutogenerationIfManualExamplesExist:!0},audiences:u,readme:b,packageName:O,version:a??await lkF({fdr:g,packageName:O,generatorInvocation:n}),context:i,sourceResolver:new d2(i,r)}),w=r.getSources(),E=SSe({ir:m,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0}}),A=await g.api.v1.register.registerApiDefinition({orgId:zdf.FernRegistry.OrgId(t),apiId:zdf.FernRegistry.ApiId(m.apiName.originalName),definition:E,sources:w.length>0?fkF(w):void 0}),q,D;A.ok&&(q=A.body.apiDefinitionId,D=A.body.sources);let C=new rGu(i,w);if(D==null&&C.sourceTypes.has("protobuf")&&(A.ok||i.failAndThrow(`Failed to register API definition: ${JSON.stringify(A.error.content)}`),i.failAndThrow("Did not successfully upload Protobuf source files.")),D!=null){i.logger.debug("Uploading source files ...");let K=await C.uploadSources(D);i.logger.debug("Setting IR source configuration ..."),m.sourceConfig=K}let R=c!=null,$=K=>zfn(K,{onError:te=>i.failAndThrow(te)},{substituteAsEmpty:R}),I=$(n),U=await ePP({projectConfig:e,workspace:r,organization:t,generatorInvocation:I,context:i,version:a,intermediateRepresentation:{...m,fdrApiDefinitionId:q,publishConfig:ckF({generatorInvocation:I})},shouldLogS3Url:l,token:d,whitelabel:s!=null?$(s):void 0,irVersionOverride:o,absolutePathToPreview:c});i.logger.debug(`Job ID: ${U.jobId}`);let H=U.taskIds[0];if(H==null){i.failAndThrow("Did not receive a task ID.");return}i.logger.debug(`Task ID: ${H}`);let k=new eGu({job:U,taskId:H,generatorInvocation:n,interactiveTaskContext:i,absolutePathToPreview:c});return await iPP({job:U,taskHandler:k,taskId:H,context:i})}function ckF({generatorInvocation:e}){return e.outputMode._visit({downloadFiles:()=>{},github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:t=>t._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},postman:r=>{let i;return e.raw?.output?.location==="postman"&&(i=e.raw.output?.["collection-id"]),Tc.PublishingConfig.direct({target:Tc.PublishTarget.postman({apiKey:r.apiKey,workspaceId:r.workspaceId,collectionId:i})})},_other:()=>{}}),_other:()=>{}})}async function lkF({fdr:e,packageName:t,generatorInvocation:r}){if(r.language==null)return;let i;switch(r.language){case"csharp":i="Csharp";break;case"go":i="Go";break;case"java":i="Java";break;case"python":i="Python";break;case"ruby":i="Ruby";break;case"typescript":i="TypeScript";break;default:return}if(t==null)return;let n=await e.sdks.versions.computeSemanticVersion({githubRepository:r.outputMode.type==="githubV2"?`${r.outputMode.githubV2.owner}/${r.outputMode.githubV2.repo}`:void 0,language:i,package:t});if(n.ok)return n.body.version}function fkF(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}async function Rdf({projectConfig:e,organization:t,workspace:r,context:i,generatorGroup:n,version:a,shouldLogS3Url:u,token:l,whitelabel:d,absolutePathToPreview:s,mode:o}){if(n.generators.length===0)return i.logger.warn("No generators specified."),null;let c=[],b=[];return c.push(...n.generators.map(O=>i.runInteractiveTask({name:O.name},async m=>{let w=await r.toFernWorkspace({context:i},qPn(O)),E=await nPP({projectConfig:e,organization:t,workspace:w,interactiveTaskContext:m,generatorInvocation:{...O,outputMode:O.outputMode._visit({downloadFiles:()=>O.outputMode,github:A=>nGu.FernFiddle.OutputMode.github({...A,makePr:o==="pull-request"}),githubV2:A=>o==="pull-request"?nGu.FernFiddle.OutputMode.githubV2(nGu.FernFiddle.GithubOutputModeV2.pullRequest(A)):O.outputMode,publish:()=>O.outputMode,publishV2:()=>O.outputMode,_other:()=>O.outputMode})},version:a,audiences:n.audiences,shouldLogS3Url:u,token:l,whitelabel:d,readme:O.readme,irVersionOverride:O.irVersionOverride,absolutePathToPreview:s});E!=null&&E.createdSnippets&&(b.push(O),O.absolutePathToLocalSnippets!=null&&E.snippetsS3PreSignedReadUrl!=null&&await UmP({snippetsS3PreSignedReadUrl:E.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:O.absolutePathToLocalSnippets,context:m}))}))),(await Promise.all(c)).some(O=>!O)&&i.failAndThrow(),{snippetsProducedBy:b}}var JPP=require("fs/promises");var rpf=vi(gfn(),1);var v6t=vi(zte(),1);var UPP=vi(LPP(),1);var VPP=require("util");var We3=(0,VPP.promisify)(UPP.default);async function WPP(e,t,r){let i=bkn(e,t),n=[];for(let a of i){let u=await Promise.all(a.map(async l=>{try{let d=await We3(l);return d==null||d.height==null||d.width==null?void 0:{filePath:l,width:d.width,height:d.height,blurDataUrl:void 0}}catch(d){r.logger.error(`Failed to measure image size for ${l}. ${d?.message}`);return}}));n.push(...u.filter(u0))}return new Map(n.map(a=>[a.filePath,a]))}var He3=10,HPP=10;async function KPP({token:e,organization:t,docsWorkspace:r,domain:i,customDomains:n,fernWorkspaces:a,ossWorkspaces:u,context:l,preview:d,editThisPage:s,isPrivate:o=!1}){let c=zTi({token:e.value}),b=o?{type:"private",authType:"sso"}:{type:"public"},g,O=n[0]??i,m=$e3(i),E=await new O5t(i,r,u,a,l,s,async q=>{let D=new Map(q.map(H=>[H.absoluteFilePath,H])),R=q.map(H=>({...H,mediaType:rpf.lookup(H.absoluteFilePath)})).filter(H=>H.mediaType!==!1).filter(H=>zB.parse(H.mediaType)?.isImage()??!1).map(H=>H.absoluteFilePath),$=await WPP(R,He3,l),I=[];[...$.values()].forEach(H=>{let k=D.get(H.filePath);if(k==null)return;let K={filePath:v6t.FernRegistry.docs.v1.write.FilePath(ZKa(k.relativeFilePath)),width:H.width,height:H.height,blurDataUrl:H.blurDataUrl,alt:void 0};I.push(K)});let U=q.filter(({absoluteFilePath:H})=>!$.has(H)).map(({relativeFilePath:H})=>ZKa(H));if(d){let H=await c.docs.v2.write.startDocsPreviewRegister({orgId:v6t.FernRegistry.OrgId(t),authConfig:o?{type:"private",authType:"sso"}:{type:"public"},filepaths:U.map(k=>v6t.FernRegistry.docs.v1.write.FilePath(k)),images:I,basePath:m});return H.ok?(O=H.body.previewUrl,g=H.body.docsRegistrationId,await $PP(H.body.uploadUrls,r.absoluteFilePath,l,HPP),GPP(H.body.uploadUrls,r.absoluteFilePath)):await QPP(H.error,l)}else{let H=await c.docs.v2.write.startDocsRegister({domain:i,customDomains:n,authConfig:b,apiId:v6t.FernRegistry.ApiId(""),orgId:v6t.FernRegistry.OrgId(t),filepaths:U.map(k=>v6t.FernRegistry.docs.v1.write.FilePath(k)),images:I});return H.ok?(g=H.body.docsRegistrationId,await $PP(H.body.uploadUrls,r.absoluteFilePath,l,HPP),GPP(H.body.uploadUrls,r.absoluteFilePath)):QPP(H.error,l)}},async({ir:q,snippetsConfig:D,playgroundConfig:C,apiName:R})=>{let $=SSe({ir:q,snippetsConfig:D,playgroundConfig:C}),I=await c.api.v1.register.registerApiDefinition({orgId:v6t.FernRegistry.OrgId(t),apiId:v6t.FernRegistry.ApiId(q.apiName.originalName),definition:$,definitionV2:void 0});if(I.ok)return l.logger.debug(`Registered API Definition ${I.body.apiDefinitionId}`),I.body.apiDefinitionId;switch(I.error.error){case"UnauthorizedError":case"UserNotInOrgError":return l.failAndThrow("You do not have permissions to register the docs. Reach out to support@buildwithfern.com");default:return R!=null?l.failAndThrow(`Failed to publish docs because API definition (${R}) could not be uploaded. Please contact support@buildwithfern.com
|