fern-api 0.90.1 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +2 -2
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -2161,7 +2161,7 @@ ${omy.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&Oyf(th
|
|
|
2161
2161
|
`+Rsa.default.red(">> ")+t),this.screen.render(r,n)}getMaskedValue(t){return this.status==="answered"?this.opt.mask?Rsa.default.cyan(hmy(t,this.opt.mask)):Rsa.default.italic(Rsa.default.dim("[hidden]")):this.opt.mask?hmy(t,this.opt.mask):Rsa.default.italic(Rsa.default.dim("[input is hidden] "))}getSpinningValue(t){return this.getMaskedValue(t)}filterInput(t){return t||(this.opt.default==null?"":this.opt.default)}onEnd(t){this.status="answered",this.answer=t.value,this.render(),this.screen.done(),this.done(t.value)}onError(t){this.render(t.isValid)}onKeypress(){this.opt.default&&=void 0,this.render()}};var V1s=fa(use(),1);var hOy=fa(rvf(),1),L1s=require("child_process"),JZa=require("fs"),Q1s=fa(require("path"),1),yOy=fa(require("os"),1),vOy=require("crypto"),Qvf=fa(pOy(),1);var F1s=class extends Error{originalError;constructor(t){super(`Failed to create temporary file. ${t.message}`),this.originalError=t}};var EJo=class extends Error{originalError;constructor(t){super(`Failed to launch editor. ${t.message}`),this.originalError=t}};var x1s=class extends Error{originalError;constructor(t){super(`Failed to read temporary file. ${t.message}`),this.originalError=t}};var z1s=class extends Error{originalError;constructor(t){super(`Failed to remove temporary file. ${t.message}`),this.originalError=t}};function U1s(e="",t,r){let n=new Lvf(e,r);n.runAsync((i,a)=>{if(i)setImmediate(t,i,void 0);else try{n.cleanup(),setImmediate(t,void 0,a)}catch(o){setImmediate(t,o,void 0)}})}function _Oy(e){return e?e.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function OrC(e){let t=[],r="";for(let n=0;n<e.length;n++){let i=e.charAt(n);n>0&&i===" "&&e[n-1]!=="\\"&&r.length>0?(t.push(r),r=""):r=`${r}${i}`}return r.length>0&&t.push(r),t}var Lvf=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(t="",r){this.text=t,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(t){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(t,void 0,this.text)}catch(r){setImmediate(t,r,void 0)}})}catch(r){setImmediate(t,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let t=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=OrC(t).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let t=this.fileOptions.dir??yOy.default.tmpdir(),r=(0,vOy.randomUUID)(),n=_Oy(this.fileOptions.prefix),i=_Oy(this.fileOptions.postfix),a=`${n}${r}${i}`,o=Q1s.default.resolve(t,a),c=Q1s.default.resolve(t)+Q1s.default.sep;if(!o.startsWith(c))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let d={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(d.mode=this.fileOptions.mode),(0,JZa.writeFileSync)(this.tempFile,this.text,d)}catch(t){throw new F1s(t)}}readTemporaryFile(){try{let t=(0,JZa.readFileSync)(this.tempFile);if(t.length===0)this.text="";else{let r=(0,hOy.detect)(t)??"utf8";Qvf.default.encodingExists(r)||(r="utf8"),this.text=Qvf.default.decode(t,r)}}catch(t){throw new x1s(t)}}removeTemporaryFile(){try{(0,JZa.unlinkSync)(this.tempFile)}catch(t){throw new z1s(t)}}launchEditor(){try{let t=(0,L1s.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=t.status??0}catch(t){throw new EJo(t)}}launchEditorAsync(t){try{(0,L1s.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(t)})}catch(r){throw new EJo(r)}}};var bOy=fa(Int(),1);var SJo=class extends sse{_run(t){this.done=t,this.editorResult=new bOy.Subject;let r=Nbe(this.rl);this.lineSubscription=r.line.subscribe(this.startExternalEditor.bind(this));let n=this.opt.waitUserInput===void 0?!0:this.opt.waitUserInput,i=this.handleSubmitEvents(this.editorResult);return i.success.forEach(this.onEnd.bind(this)),i.error.forEach(this.onError.bind(this)),this.currentText=this.opt.default,this.opt.default=null,n?this.render():this.startExternalEditor(),this}render(t){let r="",n=this.getQuestion();n+=this.status==="answered"?V1s.default.dim("Received"):V1s.default.dim("Press <enter> to launch your preferred editor."),t&&(r=V1s.default.red(">> ")+t),this.screen.render(n,r)}startExternalEditor(){this.rl.pause(),U1s(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 POy=require("stream");var OOy=fa(require("readline"),1),AOy=fa(mOy(),1),zsa=class{constructor(t){this.rl||=OOy.default.createInterface(PrC(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 PrC(e={}){e.skipTTYChecks=e.skipTTYChecks===void 0?!0:e.skipTTYChecks;let t=e.input||process.stdin;if(!e.skipTTYChecks&&!t.isTTY){let i=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw i.isTtyError=!0,i}let r=new AOy.default;return r.pipe(e.output||process.stdout),{terminal:!0,...e,input:t,output:r}}var DJo=class extends zsa{constructor(t={}){super(t),this.log=new POy.Writable({write:(r,n,i)=>{this.writeLog(r),i()}}),this.bottomBar=t.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return fJo(this.rl,this.bottomBar.split(`
|
|
2162
2162
|
`).length),this}updateBottomBar(t){return fJo(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+`
|
|
2163
2163
|
`}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&&f1s(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var W6=fa(Int(),1),EOy=fa(BGo(),1);var W1s=fa(Int(),1),wOy=fa(BGo(),1),H1s=function(e,t,r){return typeof e[t]!="function"?(0,W1s.of)(e):(0,W1s.from)((0,wOy.default)(e[t])(r).then(n=>(e[t]=n,e)))};var jOy={set:(e,t="",r)=>{let n=e;t.split(".").forEach((i,a,o)=>{i==="__proto__"||i==="constructor"||(a===o.length-1?n[i]=r:(!(i in n)||typeof n[i]!="object")&&(n[i]={}),n=n[i])})},get:(e,t="",r)=>{let n=a=>String.prototype.split.call(t,a).filter(Boolean).reduce((o,c)=>o!=null?o[c]:o,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?r:i}},KZa=class extends zsa{constructor(t,r){super(r),this.prompts=t}run(t,r){this.answers=typeof r=="object"?{...r}:{};let n;return Array.isArray(t)?n=(0,W6.from)(t):(0,W6.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,W6.from)(Object.entries(t).map(([i,a])=>({name:i,...a}))):n=(0,W6.from)([t]),this.process=n.pipe((0,W6.concatMap)(this.processQuestion.bind(this)),(0,W6.publish)()),this.process.connect(),this.process.pipe((0,W6.reduce)((i,a)=>(jOy.set(i,a.name,a.answer),i),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,W6.defer)(()=>(0,W6.of)(t).pipe((0,W6.concatMap)(this.setDefaultType.bind(this)),(0,W6.concatMap)(this.filterIfRunnable.bind(this)),(0,W6.concatMap)(()=>H1s(t,"message",this.answers)),(0,W6.concatMap)(()=>H1s(t,"default",this.answers)),(0,W6.concatMap)(()=>H1s(t,"choices",this.answers)),(0,W6.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,W6.defer)(()=>(0,W6.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,W6.defer)(()=>(0,W6.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&jOy.get(this.answers,t.name)!==void 0)return W6.EMPTY;if(t.when===!1)return W6.EMPTY;if(typeof t.when!="function")return(0,W6.of)(t);let{answers:r}=this;return(0,W6.defer)(()=>(0,W6.from)((0,EOy.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,W6.filter)(n=>n!=null)))}};function SOy(e){let t=function(r,n){let i;try{i=new KZa(t.prompts,e)}catch(o){return Promise.reject(o)}let a=i.run(r,n);return a.ui=i,a};return t.prompts={},t.registerPrompt=function(r,n){return t.prompts[r]=n,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",pJo),this.registerPrompt("input",qsa),this.registerPrompt("number",_Jo),this.registerPrompt("confirm",hJo),this.registerPrompt("rawlist",yJo),this.registerPrompt("expand",vJo),this.registerPrompt("checkbox",bJo),this.registerPrompt("password",gJo),this.registerPrompt("editor",SJo)},t.restoreDefaultPrompts(),t}var Vvf=SOy();function jrC(e,t){Vvf.registerPrompt(e,t)}function ErC(){Vvf.restoreDefaultPrompts()}var SrC={prompt:Vvf,ui:{BottomBar:DJo,Prompt:KZa},createPromptModule:SOy,registerPrompt:jrC,restoreDefaultPrompts:ErC,Separator:Nxe},G1s=SrC;var uka=require("path"),pPy=require("fs"),_Py=require("readline"),xAy="posthog-node";function _aC(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"]}={}){return a=>{if(!(i==="*"||i.includes(a.level)))return a;a.tags||(a.tags={});let c=a.tags[hEs.POSTHOG_ID_TAG];if(c===void 0)return a;let d=e.options.host??"https://us.i.posthog.com",s=new URL(`/project/${e.apiKey}/person/${c}`,d).toString();a.tags["PostHog Person URL"]=s;let u=a.exception?.values||[],l=u.map(A=>({...A,stacktrace:A.stacktrace?{...A.stacktrace,type:"raw",frames:(A.stacktrace.frames||[]).map(P=>({...P,platform:"node:javascript"}))}:void 0})),m={$exception_message:u[0]?.value||a.message,$exception_type:u[0]?.type,$exception_personURL:s,$exception_level:a.level,$exception_list:l,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:u[0]?.value||a.message,$sentry_exception_type:u[0]?.type,$sentry_tags:a.tags};return t&&r&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+a.event_id),e.capture({event:"$exception",distinctId:c,properties:m}),a}}var hEs=class{constructor(t,r,n,i){this.name=xAy,this.name=xAy,this.setupOnce=function(a,o){let c=o()?.getClient()?.getDsn()?.projectId;a(_aC(t,{organization:r,projectId:c,prefix:n,severityAllowList:i}))}}};hEs.POSTHOG_ID_TAG="posthog_distinct_id";var lEs="0123456789abcdef",yEs=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,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||t<0||r<0||n<0||i<0||t>0xffffffffffff||r>4095||n>1073741823||i>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|n>>>24,a[9]=n>>>16,a[10]=n>>>8,a[11]=n,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,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 n=new Uint8Array(16);for(let i=0;i<16;i+=4){let a=parseInt(r.substring(2*i,2*i+8),16);n[i+0]=a>>>24,n[i+1]=a>>>16,n[i+2]=a>>>8,n[i+3]=a}return new e(n)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=lEs.charAt(this.bytes[r]>>>4),t+=lEs.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+=lEs.charAt(this.bytes[r]>>>4),t+=lEs.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 n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},Mbf=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??haC()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,r){let n=this.generateOrAbortCore(t,r);return n===void 0&&(this.timestamp=0,n=this.generateOrAbortCore(t,r)),n}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 yEs.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,yEs.ofInner(t)}},haC=()=>({nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}),zAy,Bbf=()=>yaC().toString(),yaC=()=>(zAy||(zAy=new Mbf)).generate();function vaC(e,t){let r=!1;return Object.assign(n=>{let a=global.process.listeners("uncaughtException").filter(o=>o.name!=="domainUncaughtExceptionClear"&&o._posthogErrorHandler!==!0).length===0;e(n,{mechanism:{type:"onuncaughtexception",handled:!1}}),!r&&a&&(r=!0,t())},{_posthogErrorHandler:!0})}function baC(e,t){global.process.on("uncaughtException",vaC(e,t))}function gaC(e){global.process.on("unhandledRejection",t=>{e(t,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var fEs,QAy,dEs;function maC(e){let t=globalThis._posthogChunkIds;if(!t)return console.error("No chunk id map found"),{};let r=Object.keys(t);return dEs&&r.length===QAy||(QAy=r.length,dEs=r.reduce((n,i)=>{fEs||(fEs={});let a=fEs[i];if(a)n[a[0]]=a[1];else{let o=e(i);for(let c=o.length-1;c>=0;c--){let s=o[c]?.filename,u=t[i];if(s&&u){n[s]=u,fEs[i]=[s,u];break}}}return n},{})),dEs}function OaC(e){return typeof Event<"u"&&hPy(e,Event)}function AaC(e){return yPy(e,"Object")}function Qbf(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return hPy(e,Error)}}function hPy(e,t){try{return e instanceof t}catch{return!1}}function PaC(e){return yPy(e,"ErrorEvent")}function yPy(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}async function waC(e,t,r,n){let a=n&&n.mechanism||{handled:!0,type:"generic"},o=vPy(a,r,n);return{$exception_list:await Promise.all(o.map(async s=>{let u=await MaC(e,t,s);return u.value=u.value||"",u.type=u.type||"Error",u.mechanism=a,u}))}}function vPy(e,t,r){let n=jaC(e,t,r);return n.cause?[n,...vPy(e,n.cause,r)]:[n]}function jaC(e,t,r){if(Qbf(t))return t;if(e.synthetic=!0,AaC(t)){let i=EaC(t);if(i)return i;let a=SaC(t),o=r?.syntheticException||new Error(a);return o.message=a,o}let n=r?.syntheticException||new Error(t);return n.message=`${t}`,n}function EaC(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(Qbf(r))return r}}function SaC(e){if("name"in e&&typeof e.name=="string"){let n=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(n+=` with message '${e.message}'`),n}else if("message"in e&&typeof e.message=="string")return e.message;let t=CaC(e);if(PaC(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=DaC(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function DaC(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function CaC(e,t=40){let r=Object.keys(IaC(e));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=t)return LAy(n,t);for(let i=r.length;i>0;i--){let a=r.slice(0,i).join(", ");if(!(a.length>t))return i===r.length?a:LAy(a,t)}return""}function LAy(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function IaC(e){return Qbf(e)?{message:e.message,name:e.name,stack:e.stack,...UAy(e)}:OaC(e)?{type:e.type,target:VAy(e.target),currentTarget:VAy(e.currentTarget),...UAy(e)}:e}function UAy(e){if(typeof e=="object"&&e!==null){let t={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}else return{}}function VAy(e){try{return Object.prototype.toString.call(e)}catch{return"<unknown>"}}async function MaC(e,t,r){let n={type:r.name||r.constructor.name,value:r.message},i=BaC(e,r);for(let a of t)i=await a(i);return i.length&&(n.stacktrace={frames:i,type:"raw"}),n}function BaC(e,t){return TaC(e(t.stack||"",1),e)}function TaC(e,t){let r=maC(t);return e.forEach(n=>{n.filename&&(n.chunk_id=r[n.filename])}),e}var qaC=2e3,ika=class e{static async captureException(t,r,n,i,a){let o={...a};i||(o.$process_person_profile=!1);let c=await waC(this.stackParser,this.frameModifiers,r,n);t.capture({event:"$exception",distinctId:i||Bbf(),properties:{...c,...o}})}constructor(t,r){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this.startAutocaptureIfEnabled()}startAutocaptureIfEnabled(){this.isEnabled()&&(baC(this.onException.bind(this),this.onFatalError.bind(this)),gaC(this.onException.bind(this)))}onException(t,r){e.captureException(this.client,t,r)}async onFatalError(){await this.client.shutdown(qaC)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}};function RaC(e=process.argv[1]?(0,uka.dirname)(process.argv[1]):process.cwd(),t=uka.sep==="\\"){let r=t?WAy(e):e;return n=>{if(!n)return;let i=t?WAy(n):n,{dir:a,base:o,ext:c}=uka.posix.parse(i);(c===".js"||c===".mjs"||c===".cjs")&&(o=o.slice(0,c.length*-1));let d=decodeURIComponent(o);a||(a=".");let s=a.lastIndexOf("/node_modules");if(s>-1)return`${a.slice(s+14).replace(/\//g,".")}:${d}`;if(a.startsWith(r)){let u=a.slice(r.length+1).replace(/\//g,".");return u?`${u}:${d}`:d}return d}}function WAy(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var vEs=class{constructor(t){this._maxSize=t,this._cache=new Map}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){this._cache.set(t,r)}reduce(){for(;this._cache.size>=this._maxSize;){let t=this._cache.keys().next().value;t&&this._cache.delete(t)}}},_Es=new vEs(25),bPy=new vEs(20),Lbf=7,NaC=1e3,FaC=1e4;async function xaC(e){let t={};for(let i=e.length-1;i>=0;i--){let a=e[i],o=a?.filename;if(!a||typeof o!="string"||typeof a.lineno!="number"||UaC(o)||VaC(a))continue;t[o]||(t[o]=[]),t[o].push(a.lineno)}let r=Object.keys(t);if(r.length==0)return e;let n=[];for(let i of r){if(bPy.get(i))continue;let a=t[i];if(!a)continue;a.sort((d,s)=>d-s);let o=HaC(a);if(o.every(d=>WaC(i,d)))continue;let c=GaC(_Es,i,{});n.push(zaC(i,o,c))}return await Promise.all(n).catch(()=>{}),e&&e.length>0&&QaC(e,_Es),_Es.reduce(),e}function zaC(e,t,r){return new Promise(n=>{let i=(0,pPy.createReadStream)(e),a=(0,_Py.createInterface)({input:i});function o(){i.destroy(),n()}let c=0,d=0,s=t[d];if(s===void 0){o();return}let u=s[0],l=s[1];function m(){bPy.set(e,1),a.close(),a.removeAllListeners(),o()}i.on("error",m),a.on("error",m),a.on("close",o),a.on("line",A=>{if(c++,!(c<u)&&(r[c]=JaC(A,0),c>=l)){if(d===t.length-1){a.close(),a.removeAllListeners();return}d++;let P=t[d];if(P===void 0){a.close(),a.removeAllListeners();return}u=P[0],l=P[1]}})})}function QaC(e,t){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let n=t.get(r.filename);if(n===void 0)continue;LaC(r.lineno,r,n)}}function LaC(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=gPy(e);i<e;i++){let a=r[i];if(a===void 0){HAy(t);return}t.pre_context.push(a)}if(r[e]===void 0){HAy(t);return}t.context_line=r[e];let n=mPy(e);t.post_context=[];for(let i=e+1;i<=n;i++){let a=r[i];if(a===void 0)break;t.post_context.push(a)}}function HAy(e){delete e.pre_context,delete e.context_line,delete e.post_context}function UaC(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function VaC(e){return e.lineno!==void 0&&e.lineno>FaC||e.colno!==void 0&&e.colno>NaC}function WaC(e,t){let r=_Es.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function HaC(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=GAy(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let a=e[t+1];if(typeof a!="number")break;a<=n[1]?n[1]=a+Lbf:(i.push(n),n=GAy(a)),t++}return i}function GAy(e){return[gPy(e),mPy(e)]}function gPy(e){return Math.max(1,e-Lbf)}function mPy(e){return e+Lbf}function GaC(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function JaC(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,n);return a>n-5&&(a=n),a===n&&(i=Math.max(a-140,0)),r=r.slice(i,a),i>0&&(r=`...${r}`),a<n&&(r+="..."),r}var KaC="4.18.0",Lxe;(function(e){e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.DecideEndpointWasHit="decide_endpoint_was_hit",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config"})(Lxe||(Lxe={}));var JAy;(function(e){e.Left="left",e.Right="right",e.Center="center"})(JAy||(JAy={}));var KAy;(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})(KAy||(KAy={}));var $Ay;(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})($Ay||($Ay={}));var YAy;(function(e){e.Html="html",e.Text="text"})(YAy||(YAy={}));var XAy;(function(e){e.Number="number",e.Emoji="emoji"})(XAy||(XAy={}));var ZAy;(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(ZAy||(ZAy={}));var kAy;(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(kAy||(kAy={}));var ePy;(function(e){e.Regex="regex",e.NotRegex="not_regex",e.Exact="exact",e.IsNot="is_not",e.Icontains="icontains",e.NotIcontains="not_icontains"})(ePy||(ePy={}));var tPy;(function(e){e.Contains="contains",e.Exact="exact",e.Regex="regex"})(tPy||(tPy={}));var $aC=e=>{if("flags"in e){let t=XaC(e.flags),r=ZaC(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}else{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,a])=>[i,OPy(a)])),n=Object.fromEntries(Object.entries(t).map(([i,a])=>[i,YaC(i,a,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function YaC(e,t,r){return{key:e,enabled:typeof t=="string"?!0:t,variant:typeof t=="string"?t:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:r?JSON.stringify(r):void 0,description:void 0}}}var XaC=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,Ubf(r)]).filter(([,t])=>t!==void 0)),ZaC=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(r=>{let n=t[r];return n.enabled&&n.metadata&&n.metadata.payload!==void 0}).map(r=>{let n=t[r].metadata?.payload;return[r,n?OPy(n):void 0]}))},Ubf=e=>e===void 0?void 0:e.variant??e.enabled,OPy=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}},kaC=1,eoC=new Set(["61be3dd8","96f6df5f","8cfdba9b","bf027177","e59430a8","7fa5500b","569798e9","04809ff7","0ebc61a5","32de7f98","3beeb69a","12d34ad9","733853ec","0645bb64","5dcbee21","b1f95fa3","2189e408","82b460c2","3a8cc979","29ef8843","2cdbf767","38084b54","50f9f8de","41d0df91","5c236689","c11aedd3","ada46672","f4331ee1","42fed62a","c957462c","d62f705a","e0162666","01b3e5cf","441cef7f","bb9cafee","8f348eb0","b2553f3a","97469d7d","39f21a76","03706dcc","27d50569","307584a7","6433e92e","150c7fbb","49f57f22","3772f65b","01eb8256","3c9e9234","f853c7f7","c0ac4b67","cd609d40","10ca9b1a","8a87f11b","8e8e5216","1f6b63b3","db7943dd","79b7164c","07f78e33","2d21b6fd","952db5ee","a7d3b43f","1924dd9c","84e1b8f6","dff631b6","c5aa8a79","fa133a95","498a4508","24748755","98f3d658","21bbda67","7dbfed69","be3ec24c","fc80b8e2","75cc0998"]),toC="utf8";function roC(e,t){if(!e||typeof e!="string"||noC(e))throw new Error(t)}function noC(e){return e.trim().length===0}function ioC(e){return e?.replace(/\/+$/,"")}async function aoC(e,t){let r=null;for(let n=0;n<t.retryCount+1;n++){n>0&&await new Promise(i=>setTimeout(i,t.retryDelay));try{return await e()}catch(i){if(r=i,!t.retryCheck(i))throw i}}throw r}function rPy(){return new Date().getTime()}function Cbf(){return new Date().toISOString()}function bEs(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}function ooC(){return typeof fetch<"u"?fetch:typeof globalThis.fetch<"u"?globalThis.fetch:void 0}function uoC(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return(t>>>0).toString(16).padStart(8,"0")}function soC(e,t=0,r){let n=uoC(e);return r?.has(n)?!1:parseInt(n,16)/4294967295<t}function nPy(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var xJo=String.fromCharCode,iPy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",pEs={};function coC(e,t){if(!pEs[e]){pEs[e]={};for(let r=0;r<e.length;r++)pEs[e][e.charAt(r)]=r}return pEs[e][t]}var rka={compressToBase64:function(e){if(e==null)return"";let t=rka._compress(e,6,function(r){return iPy.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:rka._decompress(e.length,32,function(t){return coC(iPy,e.charAt(t))})},compress:function(e){return rka._compress(e,16,function(t){return xJo(t)})},_compress:function(e,t,r){if(e==null)return"";let n={},i={},a=[],o,c,d="",s="",u="",l=2,m=3,A=2,P=0,C=0,M;for(M=0;M<e.length;M+=1)if(d=e.charAt(M),Object.prototype.hasOwnProperty.call(n,d)||(n[d]=m++,i[d]=!0),s=u+d,Object.prototype.hasOwnProperty.call(n,s))u=s;else{if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(o=0;o<A;o++)P=P<<1,C==t-1?(C=0,a.push(r(P)),P=0):C++;for(c=u.charCodeAt(0),o=0;o<8;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}else{for(c=1,o=0;o<A;o++)P=P<<1|c,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[u]}else for(c=n[u],o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++),n[s]=m++,u=String(d)}if(u!==""){if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(o=0;o<A;o++)P=P<<1,C==t-1?(C=0,a.push(r(P)),P=0):C++;for(c=u.charCodeAt(0),o=0;o<8;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}else{for(c=1,o=0;o<A;o++)P=P<<1|c,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=0;for(c=u.charCodeAt(0),o=0;o<16;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1}l--,l==0&&(l=Math.pow(2,A),A++),delete i[u]}else for(c=n[u],o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;l--,l==0&&(l=Math.pow(2,A),A++)}for(c=2,o=0;o<A;o++)P=P<<1|c&1,C==t-1?(C=0,a.push(r(P)),P=0):C++,c=c>>1;for(;;)if(P=P<<1,C==t-1){a.push(r(P));break}else C++;return a.join("")},decompress:function(e){return e==null?"":e==""?null:rka._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(e,t,r){let n=[],i=[],a={val:r(0),position:t,index:1},o=4,c=4,d=3,s="",u,l,m,A,P,C,M;for(u=0;u<3;u+=1)n[u]=u;for(m=0,P=Math.pow(2,2),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;switch(m){case 0:for(m=0,P=Math.pow(2,8),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;M=xJo(m);break;case 1:for(m=0,P=Math.pow(2,16),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;M=xJo(m);break;case 2:return""}for(n[3]=M,l=M,i.push(M);;){if(a.index>e)return"";for(m=0,P=Math.pow(2,d),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;switch(M=m){case 0:for(m=0,P=Math.pow(2,8),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;n[c++]=xJo(m),M=c-1,o--;break;case 1:for(m=0,P=Math.pow(2,16),C=1;C!=P;)A=a.val&a.position,a.position>>=1,a.position==0&&(a.position=t,a.val=r(a.index++)),m|=(A>0?1:0)*C,C<<=1;n[c++]=xJo(m),M=c-1,o--;break;case 2:return i.join("")}if(o==0&&(o=Math.pow(2,d),d++),n[M])s=n[M];else if(M===c)s=l+l.charAt(0);else return null;i.push(s),n[c++]=l+s.charAt(0),o--,l=s,o==0&&(o=Math.pow(2,d),d++)}}},Tbf=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(n=>n!==r)}}emit(t,r){for(let n of this.events[t]||[])n(r);for(let n of this.events["*"]||[])n(t,r)}},aka=class extends Error{constructor(t,r){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}},zJo=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};async function aPy(e){if(e instanceof aka){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function Ibf(e){return typeof e=="object"&&(e instanceof aka||e instanceof zJo)}function oPy(e){return typeof e=="object"&&e instanceof aka&&e.status===413}var qbf;(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(qbf||(qbf={}));var Rbf=class{constructor(t,r){this.flushPromise=null,this.shutdownPromise=null,this.pendingPromises={},this._events=new Tbf,this._isInitialized=!1,roC(t,"You must pass your PostHog project's api key."),this.apiKey=t,this.host=ioC(r?.host||"https://us.i.posthog.com"),this.flushAt=r?.flushAt?Math.max(r?.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,r?.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,r?.maxQueueSize??1e3),this.flushInterval=r?.flushInterval??1e4,this.captureMode=r?.captureMode||"json",this.preloadFeatureFlags=r?.preloadFeatureFlags??!0,this.defaultOptIn=r?.defaultOptIn??!0,this.disableSurveys=r?.disableSurveys??!1,this._retryOptions={retryCount:r?.fetchRetryCount??3,retryDelay:r?.fetchRetryDelay??3e3,retryCheck:Ibf},this.requestTimeout=r?.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r?.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=r?.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r?.disableGeoip??!0,this.disabled=r?.disabled??!1,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(Lxe.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(Lxe.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(Lxe.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>console.log("PostHog Debug",n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){return{distinct_id:t.distinct_id,event:t.event,properties:{...t.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(t){let r=Bbf();return this.pendingPromises[r]=t,t.catch(()=>{}).finally(()=>{delete this.pendingPromises[r]}),t}identifyStateless(t,r,n){this.wrap(()=>{let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};this.enqueue("identify",i,n)})}async identifyStatelessImmediate(t,r,n){let i={...this.buildPayload({distinct_id:t,event:"$identify",properties:r})};await this.sendImmediate("identify",i,n)}captureStateless(t,r,n,i){this.wrap(()=>{let a=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",a,i)})}async captureStatelessImmediate(t,r,n,i){let a=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",a,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",a,i)})}async aliasStatelessImmediate(t,r,n,i){let a=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",a,i)}groupIdentifyStateless(t,r,n,i,a,o){this.wrap(()=>{let c=this.buildPayload({distinct_id:a||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...o||{}}});this.enqueue("capture",c,i)})}async getRemoteConfig(){await this._initPromise;let t=this.host;t==="https://us.i.posthog.com"?t="https://us-assets.i.posthog.com":t==="https://eu.i.posthog.com"&&(t="https://eu-assets.i.posthog.com");let r=`${t}/array/${this.apiKey}/config`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(r,n,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(i=>i.json()).catch(i=>{this.logMsgIfDebug(()=>console.error("Remote config could not be loaded",i)),this._events.emit("error",i)})}async getDecide(t,r={},n={},i={},a={}){await this._initPromise;let c=soC(this.apiKey,kaC,eoC)?`${this.host}/flags/?v=2`:`${this.host}/decide/?v=4`,d={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify({token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...a})};return this.logMsgIfDebug(()=>console.log("PostHog Debug","Decide URL",c)),this.fetchWithRetry(c,d,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(s=>s.json()).then(s=>$aC(s)).catch(s=>{this._events.emit("error",s)})}async getFeatureFlagStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailStateless(t,r,n,i,a,o);if(c===void 0)return{response:void 0,requestId:void 0};let d=Ubf(c.response);return d===void 0&&(d=!1),{response:d,requestId:c.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(r,n,i,a,o,[t]);return c===void 0?void 0:{response:c.flags[t],requestId:c.requestId}}async getFeatureFlagPayloadStateless(t,r,n={},i={},a={},o){await this._initPromise;let c=await this.getFeatureFlagPayloadsStateless(r,n,i,a,o,[t]);if(!c)return;let d=c[t];return d===void 0?null:d}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},a,o){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,o)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},a,o){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,a,o)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},a,o){await this._initPromise;let c=await this.getFeatureFlagDetailsStateless(t,r,n,i,a,o);return c?{flags:c.featureFlags,payloads:c.featureFlagPayloads,requestId:c.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},a,o){await this._initPromise;let c={};(a??this.disableGeoip)&&(c.geoip_disable=!0),o&&(c.flag_keys_to_evaluate=o);let d=await this.getDecide(t,r,n,i,c);if(d!==void 0)return d.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),d.quotaLimited?.includes(qbf.FeatureFlags)?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:d?.requestId}):d}async getSurveysStateless(){if(await this._initPromise,this.disableSurveys===!0)return this.logMsgIfDebug(()=>console.log("PostHog Debug","Loading surveys is disabled.")),[];let t=`${this.host}/api/surveys/?token=${this.apiKey}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},i=(await this.fetchWithRetry(t,r).then(a=>{if(a.status!==200||!a.json){let o=`Surveys API could not be loaded: ${a.status}`,c=new Error(o);this.logMsgIfDebug(()=>console.error(c)),this._events.emit("error",new Error(o));return}return a.json()}).catch(a=>{this.logMsgIfDebug(()=>console.error("Surveys API could not be loaded",a)),this._events.emit("error",a)}))?.surveys;return i&&this.logMsgIfDebug(()=>console.log("PostHog Debug","Surveys fetched from API: ",JSON.stringify(i))),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(Lxe.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(Lxe.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(Lxe.Props,this.props)})}enqueue(t,r,n){this.wrap(()=>{if(this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let i=this.prepareMessage(t,r,n),a=this.getPersistedProperty(Lxe.Queue)||[];a.length>=this.maxQueueSize&&(a.shift(),this.logMsgIfDebug(()=>console.info("Queue is full, the oldest event is dropped."))),a.push({message:i}),this.setPersistedProperty(Lxe.Queue,a),this._events.emit(t,i),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=bEs(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n){if(this.disabled){this.logMsgIfDebug(()=>console.warn("[PostHog] The client is disabled"));return}if(this._isInitialized||await this._initPromise,this.optedOut){this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");return}let i={api_key:this.apiKey,batch:[this.prepareMessage(t,r,n)],sent_at:Cbf()};this.historicalMigration&&(i.historical_migration=!0);let a=JSON.stringify(i),o=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${rPy()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,c=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(rka.compressToBase64(a))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:a};try{await this.fetchWithRetry(o,c)}catch(d){this._events.emit("error",d)}}prepareMessage(t,r,n){let i={...r,type:t,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:n?.timestamp?n?.timestamp:Cbf(),uuid:n?.uuid?n.uuid:Bbf()};return(n?.disableGeoip??this.disableGeoip)&&(i.properties||(i.properties={}),i.properties.$geoip_disable=!0),i.distinctId&&(i.distinct_id=i.distinctId,delete i.distinctId),i}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async t=>{await aPy(t)})}async flush(){let t=nPy([this.flushPromise]).then(()=>this._flush());return this.flushPromise=t,this.addPendingPromise(t),nPy([t]).then(()=>{this.flushPromise===t&&(this.flushPromise=null)}),t}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getPersistedProperty(Lxe.Queue)||[];if(!t.length)return;let r=[],n=t.length;for(;t.length>0&&r.length<n;){let i=t.slice(0,this.maxBatchSize),a=i.map(m=>m.message),o=()=>{let A=(this.getPersistedProperty(Lxe.Queue)||[]).slice(i.length);this.setPersistedProperty(Lxe.Queue,A),t=A},c={api_key:this.apiKey,batch:a,sent_at:Cbf()};this.historicalMigration&&(c.historical_migration=!0);let d=JSON.stringify(c),s=this.captureMode==="form"?`${this.host}/e/?ip=1&_=${rPy()}&v=${this.getLibraryVersion()}`:`${this.host}/batch/`,u=this.captureMode==="form"?{method:"POST",mode:"no-cors",credentials:"omit",headers:{...this.getCustomHeaders(),"Content-Type":"application/x-www-form-urlencoded"},body:`data=${encodeURIComponent(rka.compressToBase64(d))}&compression=lz64`}:{method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:d},l={retryCheck:m=>oPy(m)?!1:Ibf(m)};try{await this.fetchWithRetry(s,u,l)}catch(m){if(oPy(m)&&a.length>1){this.maxBatchSize=Math.max(1,Math.floor(a.length/2)),this.logMsgIfDebug(()=>console.warn(`Received 413 when sending batch of size ${a.length}, reducing batch size to ${this.maxBatchSize}`));continue}throw m instanceof zJo||o(),this._events.emit("error",m),m}o(),r.push(...a)}this._events.emit("flush",r)}async fetchWithRetry(t,r,n,i){var a;(a=AbortSignal).timeout??(a.timeout=function(s){let u=new AbortController;return setTimeout(()=>u.abort(),s),u.signal});let o=r.body?r.body:"",c=-1;try{c=Buffer.byteLength(o,toC)}catch{c=new TextEncoder().encode(o).length}return await aoC(async()=>{let d=null;try{d=await this.fetch(t,{signal:AbortSignal.timeout(i??this.requestTimeout),...r})}catch(u){throw new zJo(u)}if(!(r.mode==="no-cors")&&(d.status<200||d.status>=400))throw new aka(d,c);return d},{...this._retryOptions,...n})}async _shutdown(t=3e4){await this._initPromise;let r=!1;this.clearFlushTimer();let n=async()=>{try{for(await Promise.all(Object.values(this.pendingPromises));!((this.getPersistedProperty(Lxe.Queue)||[]).length===0||(await this.flush(),r)););}catch(i){if(!Ibf(i))throw i;await aPy(i)}};return Promise.race([new Promise((i,a)=>{bEs(()=>{this.logMsgIfDebug(()=>console.error("Timed out while shutting down PostHog")),r=!0,a("Timeout while shutting down PostHog. Some events may not have been sent.")},t)}),n()])}async shutdown(t=3e4){return this.shutdownPromise?this.logMsgIfDebug(()=>console.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup")):this.shutdownPromise=this._shutdown(t).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}},Nbf=ooC();if(!Nbf){let e=FAy();Nbf=async(t,r)=>{let n=await e.request({url:t,headers:r.headers,method:r.method.toLowerCase(),data:r.body,signal:r.signal,validateStatus:()=>!0});return{status:n.status,text:async()=>n.data,json:async()=>n.data}}}var APy=Nbf,gEs=class{constructor(t){this.factory=t}async getValue(){return this.value!==void 0?this.value:(this.initializationPromise===void 0&&(this.initializationPromise=(async()=>{try{let t=await this.factory();return this.value=t,t}finally{this.initializationPromise=void 0}})()),this.initializationPromise)}isInitialized(){return this.value!==void 0}async waitForInitialization(){this.isInitialized()||await this.getValue()}},PPy=new gEs(async()=>{try{return await import("crypto")}catch{return}});async function loC(){return await PPy.getValue()}var foC=new gEs(async()=>{if(typeof globalThis.crypto?.subtle<"u")return globalThis.crypto.subtle;try{let e=await PPy.getValue();if(e?.webcrypto?.subtle)return e.webcrypto.subtle}catch{}});async function doC(){return await foC.getValue()}async function poC(e){let t=await loC();if(t)return t.createHash("sha1").update(e).digest("hex");let r=await doC();if(r){let n=await r.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(a=>a.toString(16).padStart(2,"0")).join("")}throw new Error("No crypto implementation available. Tried Node Crypto API and Web SubtleCrypto API")}var _oC=60*1e3,hoC=1152921504606847e3,yoC=["is_not"],nka=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}},cse=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,e.prototype)}},Fbf=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:a,customHeaders:o,...c}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=t,this.personalApiKey=r,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=i,this.projectApiKey=n,this.host=a,this.poller=void 0,this.fetch=c.fetch||APy,this.onError=c.onError,this.customHeaders=o,this.onLoad=c.onLoad,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}async getFeatureFlag(t,r,n={},i={},a={}){await this.loadFeatureFlags();let o,c;if(!this.loadedSuccessfullyOnce)return o;for(let d of this.featureFlags)if(t===d.key){c=d;break}if(c!==void 0)try{o=await this.computeFlagLocally(c,r,n,i,a),this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${o}`))}catch(d){d instanceof cse?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 o}async computeFeatureFlagPayloadLocally(t,r){await this.loadFeatureFlags();let n;if(this.loadedSuccessfullyOnce){if(typeof r=="boolean"?n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r.toString()]:typeof r=="string"&&(n=this.featureFlagsByKey?.[t]?.filters?.payloads?.[r]),n==null)return null;try{return JSON.parse(n)}catch{return n}}}async getAllFlagsAndPayloads(t,r={},n={},i={}){await this.loadFeatureFlags();let a={},o={},c=this.featureFlags.length==0;return await Promise.all(this.featureFlags.map(async d=>{try{let s=await this.computeFlagLocally(d,t,r,n,i);a[d.key]=s;let u=await this.computeFeatureFlagPayloadLocally(d.key,s);u&&(o[d.key]=u)}catch(s){s instanceof cse||s instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${d.key}: ${s}`)),c=!0}})),{response:a,payloads:o,fallbackToDecide:c}}async computeFlagLocally(t,r,n={},i={},a={}){if(t.ensure_experience_continuity)throw new cse("Flag has experience continuity enabled");if(!t.active)return!1;let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let d=this.groupTypeMapping[String(c)];if(!d)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new cse("Flag has unknown group type index");if(!(d in n))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 await this.matchFeatureFlagProperties(t,n[d],s)}else return await this.matchFeatureFlagProperties(t,r,i)}async matchFeatureFlagProperties(t,r,n){let i=t.filters||{},a=i.groups||[],o=!1,c,d=[...a].sort((s,u)=>{let l=!!s.variant,m=!!u.variant;return l&&m?0:l?-1:m?1:0});for(let s of d)try{if(await this.isConditionMatch(t,r,s,n)){let u=s.variant,l=i.multivariate?.variants||[];u&&l.some(m=>m.key===u)?c=u:c=await this.getMatchingVariant(t,r)||!0;break}}catch(u){if(u instanceof cse)o=!0;else throw u}if(c!==void 0)return c;if(o)throw new cse("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i){let a=n.rollout_percentage,o=c=>{this.logMsgIfDebug(()=>console.warn(c))};if((n.properties||[]).length>0){for(let c of n.properties){let d=c.type,s=!1;if(d==="cohort"?s=jPy(c,i,this.cohorts,this.debugMode):s=wPy(c,i,o),!s)return!1}if(a==null)return!0}return!(a!=null&&await uPy(t.key,r)>a/100)}async getMatchingVariant(t,r){let n=await uPy(t.key,r,"variant"),i=this.variantLookupTable(t).find(a=>n>=a.valueMin&&n<a.valueMax);if(i)return i.key}variantLookupTable(t){let r=[],n=0,i=0;return((t.filters||{}).multivariate?.variants||[]).forEach(c=>{i=n+c.rollout_percentage/100,r.push({valueMin:n,valueMax:i,key:c.key}),n=i}),r}async loadFeatureFlags(t=!1){(!this.loadedSuccessfullyOnce||t)&&await this._loadFeatureFlags()}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(_oC,this.pollingInterval*2**this.backOffCount):this.pollingInterval}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this._loadFeatureFlags(),this.getPollingInterval());try{let t=await this._requestFeatureFlagDefinitions();if(!t)return;switch(t.status){case 401:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new nka(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new nka(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,new nka(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let r=await t.json()??{};if(!("flags"in r)){this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`));return}this.featureFlags=r.flags??[],this.featureFlagsByKey=this.featureFlags.reduce((n,i)=>(n[i.key]=i,n),{}),this.groupTypeMapping=r.group_type_mapping||{},this.cohorts=r.cohorts||{},this.loadedSuccessfullyOnce=!0,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.onLoad?.(this.featureFlags.length);break}default:return}}catch(t){t instanceof nka&&this.onError?.(t)}}getPersonalApiKeyRequestOptions(t="GET"){return{method:t,headers:{...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`}}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/api/feature_flag/local_evaluation?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions(),n=null;if(this.timeout&&typeof this.timeout=="number"){let i=new AbortController;n=bEs(()=>{i.abort()},this.timeout),r.signal=i.signal}try{return await this.fetch(t,r)}finally{clearTimeout(n)}}stopPoller(){clearTimeout(this.poller)}_requestRemoteConfigPayload(t){let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config/`,n=this.getPersonalApiKeyRequestOptions(),i=null;if(this.timeout&&typeof this.timeout=="number"){let a=new AbortController;i=bEs(()=>{a.abort()},this.timeout),n.signal=a.signal}try{return this.fetch(r,n)}finally{clearTimeout(i)}}};async function uPy(e,t,r=""){let n=await poC(`${e}.${t}${r}`);return parseInt(n.slice(0,15),16)/hoC}function wPy(e,t,r){let n=e.key,i=e.value,a=e.operator||"exact";if(n in t){if(a==="is_not_set")throw new cse("Operator is_not_set is not supported")}else throw new cse(`Property ${n} not found in propertyValues`);let o=t[n];if(o==null&&!yoC.includes(a))return r&&r(`Property ${n} cannot have a value of null/undefined with the ${a} operator`),!1;function c(s,u){return Array.isArray(s)?s.map(l=>String(l).toLowerCase()).includes(String(u).toLowerCase()):String(s).toLowerCase()===String(u).toLowerCase()}function d(s,u,l){if(l==="gt")return s>u;if(l==="gte")return s>=u;if(l==="lt")return s<u;if(l==="lte")return s<=u;throw new Error(`Invalid operator: ${l}`)}switch(a){case"exact":return c(i,o);case"is_not":return!c(i,o);case"is_set":return n in t;case"icontains":return String(o).toLowerCase().includes(String(i).toLowerCase());case"not_icontains":return!String(o).toLowerCase().includes(String(i).toLowerCase());case"regex":return sPy(String(i))&&String(o).match(String(i))!==null;case"not_regex":return sPy(String(i))&&String(o).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let s=typeof i=="number"?i:null;if(typeof i=="string")try{s=parseFloat(i)}catch{}return s!=null&&o!=null?typeof o=="string"?d(o,String(i),a):d(o,s,a):d(String(o),String(i),a)}case"is_date_after":case"is_date_before":{let s=voC(String(i));if(s==null&&(s=cPy(i)),s==null)throw new cse(`Invalid date: ${i}`);let u=cPy(o);return["is_date_before"].includes(a)?u<s:u>s}default:throw new cse(`Unknown operator: ${a}`)}}function jPy(e,t,r,n=!1){let i=String(e.value);if(!(i in r))throw new cse("can't match cohort without a given cohort property value");let a=r[i];return EPy(a,t,r,n)}function EPy(e,t,r,n=!1){if(!e)return!0;let i=e.type,a=e.values;if(!a||a.length===0)return!0;let o=!1;if("values"in a[0]){for(let c of a)try{let d=EPy(c,t,r,n);if(i==="AND"){if(!d)return!1}else if(d)return!0}catch(d){if(d instanceof cse)n&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new cse("Can't match cohort without a given cohort property value");return i==="AND"}else{for(let c of a)try{let d;c.type==="cohort"?d=jPy(c,t,r,n):d=wPy(c,t);let s=c.negation||!1;if(i==="AND"){if(!d&&!s||d&&s)return!1}else if(d&&!s||!d&&s)return!0}catch(d){if(d instanceof cse)n&&console.debug(`Failed to compute property ${c} locally: ${d}`),o=!0;else throw d}if(o)throw new cse("can't match cohort without a given cohort property value");return i==="AND"}}function sPy(e){try{return new RegExp(e),!0}catch{return!1}}function cPy(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 cse(`${e} is in an invalid date format`)}else throw new cse(`The date provided ${e} must be a string, number, or date object`)}function voC(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(r){if(!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let a=r.groups.interval;if(a=="h")n.setUTCHours(n.getUTCHours()-i);else if(a=="d")n.setUTCDate(n.getUTCDate()-i);else if(a=="w")n.setUTCDate(n.getUTCDate()-i*7);else if(a=="m")n.setUTCMonth(n.getUTCMonth()-i);else if(a=="y")n.setUTCFullYear(n.getUTCFullYear()-i);else return null;return n}else return null}var xbf=class{constructor(){this._memoryStorage={}}getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}},boC=100,lPy=30*1e3,goC=50*1e3,zbf=class extends Rbf{constructor(t,r={}){if(super(t,r),this._memoryStorage=new xbf,this.options=r,this.options.featureFlagsPollingInterval=typeof r.featureFlagsPollingInterval=="number"?Math.max(r.featureFlagsPollingInterval,boC):lPy,r.personalApiKey){if(r.personalApiKey.includes("phc_"))throw new Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');this.featureFlagsPoller=new Fbf({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:r.personalApiKey,projectApiKey:t,timeout:r.requestTimeout??1e4,host:this.host,fetch:r.fetch,onError:n=>{this._events.emit("error",n)},onLoad:n=>{this._events.emit("localEvaluationFlagsLoaded",n)},customHeaders:this.getCustomHeaders()})}this.errorTracking=new ika(this,r),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=r.maxCacheSize||goC}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):APy(t,r)}getLibraryVersion(){return KaC}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}capture(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:n,properties:i,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=A=>{super.captureStateless(r,n,A,{timestamp:c,disableGeoip:d,uuid:s})},l=async(A,P,C)=>(await super.getFeatureFlagsStateless(A,P,void 0,void 0,C)).flags,m=Promise.resolve().then(async()=>{if(o)return await l(r,a,d);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[P,C]of Object.entries(a||{}))A[P]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(A=>{let P={};if(A)for(let[M,T]of Object.entries(A))P[`$feature/${M}`]=T;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(P.$active_feature_flags=C),P}).catch(()=>({})).then(A=>{u({...A,...i,$groups:a})});this.addPendingPromise(m)}async captureImmediate(t){typeof t=="string"&&this.logMsgIfDebug(()=>console.warn("Called capture() with a string as the first argument when an object was expected."));let{distinctId:r,event:n,properties:i,groups:a,sendFeatureFlags:o,timestamp:c,disableGeoip:d,uuid:s}=t,u=A=>super.captureStatelessImmediate(r,n,A,{timestamp:c,disableGeoip:d,uuid:s}),l=async(A,P,C)=>(await super.getFeatureFlagsStateless(A,P,void 0,void 0,C)).flags;await Promise.resolve().then(async()=>{if(o)return await l(r,a,d);if(n==="$feature_flag_called")return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let A={};for(let[P,C]of Object.entries(a||{}))A[P]=String(C);return await this.getAllFlags(r,{groups:A,disableGeoip:d,onlyEvaluateLocally:!0})}return{}}).then(A=>{let P={};if(A)for(let[M,T]of Object.entries(A))P[`$feature/${M}`]=T;let C=Object.keys(A||{}).filter(M=>A?.[M]!==!1).sort();return C.length>0&&(P.$active_feature_flags=C),P}).catch(()=>({})).then(A=>{u({...A,...i,$groups:a})})}identify({distinctId:t,properties:r,disableGeoip:n}){let i=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;super.identifyStateless(t,{$set:a,$set_once:i},{disableGeoip:n})}async identifyImmediate({distinctId:t,properties:r,disableGeoip:n}){let i=r?.$set_once;delete r?.$set_once;let a=r?.$set||r;await super.identifyStatelessImmediate(t,{$set:a,$set_once:i},{disableGeoip:n})}alias(t){super.aliasStateless(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}async aliasImmediate(t){await super.aliasStatelessImmediate(t.alias,t.distinctId,void 0,{disableGeoip:t.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(t=lPy){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",a=>{clearTimeout(n),i(),r(a>0)})})}async getFeatureFlag(t,r,n){let{groups:i,disableGeoip:a}=n||{},{onlyEvaluateLocally:o,sendFeatureFlagEvents:c,personProperties:d,groupProperties:s}=n||{},u=this.addLocalPersonAndGroupProperties(r,i,d,s);d=u.allPersonProperties,s=u.allGroupProperties,o==null&&(o=!1),c==null&&(c=!0);let l=await this.featureFlagsPoller?.getFeatureFlag(t,r,i,d,s),m=l!==void 0,A,P;if(!m&&!o){let M=await super.getFeatureFlagDetailStateless(t,r,i,d,s,a);if(M===void 0)return;P=M.response,l=Ubf(P),A=M?.requestId}let C=`${t}_${l}`;return c&&(!(r in this.distinctIdHasSentFlagCalls)||!this.distinctIdHasSentFlagCalls[r].includes(C))&&(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),Array.isArray(this.distinctIdHasSentFlagCalls[r])?this.distinctIdHasSentFlagCalls[r].push(C):this.distinctIdHasSentFlagCalls[r]=[C],this.capture({distinctId:r,event:"$feature_flag_called",properties:{$feature_flag:t,$feature_flag_response:l,$feature_flag_id:P?.metadata?.id,$feature_flag_version:P?.metadata?.version,$feature_flag_reason:P?.reason?.description??P?.reason?.code,locally_evaluated:m,[`$feature/${t}`]:l,$feature_flag_request_id:A},groups:i,disableGeoip:a})),l}async getFeatureFlagPayload(t,r,n,i){let{groups:a,disableGeoip:o}=i||{},{onlyEvaluateLocally:c,sendFeatureFlagEvents:d,personProperties:s,groupProperties:u}=i||{},l=this.addLocalPersonAndGroupProperties(r,a,s,u);s=l.allPersonProperties,u=l.allGroupProperties;let m;return this.featureFlagsPoller!==void 0&&(n||(n=await this.getFeatureFlag(t,r,{...i,onlyEvaluateLocally:!0,sendFeatureFlagEvents:!1})),n&&(m=await this.featureFlagsPoller?.computeFeatureFlagPayloadLocally(t,n))),c==null&&(c=!1),d==null&&(d=!0),c==null&&(c=!1),!(m!==void 0)&&!c&&(m=await super.getFeatureFlagPayloadStateless(t,r,a,s,u,o)),m}async getRemoteConfigPayload(t){return(await this.featureFlagsPoller?._requestRemoteConfigPayload(t))?.json()}async isFeatureEnabled(t,r,n){let i=await this.getFeatureFlag(t,r,n);if(i!==void 0)return!!i||!1}async getAllFlags(t,r){return(await this.getAllFlagsAndPayloads(t,r)).featureFlags||{}}async getAllFlagsAndPayloads(t,r){let{groups:n,disableGeoip:i}=r||{},{onlyEvaluateLocally:a,personProperties:o,groupProperties:c}=r||{},d=this.addLocalPersonAndGroupProperties(t,n,o,c);o=d.allPersonProperties,c=d.allGroupProperties,a==null&&(a=!1);let s=await this.featureFlagsPoller?.getAllFlagsAndPayloads(t,n,o,c),u={},l={},m=!0;if(s&&(u=s.response,l=s.payloads,m=s.fallbackToDecide),m&&!a){let A=await super.getFeatureFlagsAndPayloadsStateless(t,n,o,c,i);u={...u,...A.flags||{}},l={...l,...A.payloads||{}}}return{featureFlags:u,featureFlagPayloads:l}}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:a}){super.groupIdentifyStateless(t,r,n,{disableGeoip:a},i)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}async _shutdown(t){return this.featureFlagsPoller?.stopPoller(),super._shutdown(t)}addLocalPersonAndGroupProperties(t,r,n,i){let a={distinct_id:t,...n||{}},o={};if(r)for(let c of Object.keys(r))o[c]={$group_key:r[c],...i?.[c]||{}};return{allPersonProperties:a,allGroupProperties:o}}captureException(t,r,n){let i=new Error("PostHog syntheticException");ika.captureException(this,t,{syntheticException:i},r,n)}},fPy=/\(error: (.*)\)/,SPy=50,DPy="?";function moC(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return n=>{let i=n.match(r);if(i){let a,o,c,d,s;if(i[1]){c=i[1];let m=c.lastIndexOf(".");if(c[m-1]==="."&&m--,m>0){a=c.slice(0,m),o=c.slice(m+1);let A=a.indexOf(".Module");A>0&&(c=c.slice(A+1),a=a.slice(0,A))}d=void 0}o&&(d=a,s=o),o==="<anonymous>"&&(s=void 0,c=void 0),c===void 0&&(s=s||DPy,c=d?`${d}.${s}`:s);let u=i[2]?.startsWith("file://")?i[2].slice(7):i[2],l=i[5]==="native";return u?.match(/\/[A-Z]:/)&&(u=u.slice(1)),!u&&i[5]&&!l&&(u=i[5]),{filename:u?decodeURI(u):void 0,module:e?e(u):void 0,function:c,lineno:dPy(i[3]),colno:dPy(i[4]),in_app:OoC(u||"",l),platform:"node:javascript"}}if(n.match(t))return{filename:n,platform:"node:javascript"}}}function OoC(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function dPy(e){return parseInt(e||"",10)||void 0}function AoC(e){return[90,moC(e)]}function PoC(e){let r=[AoC(e)].sort((n,i)=>n[0]-i[0]).map(n=>n[1]);return(n,i=0)=>{let a=[],o=n.split(`
|
|
2164
|
-
`);for(let c=i;c<o.length;c++){let d=o[c];if(d.length>1024)continue;let s=fPy.test(d)?d.replace(fPy,"$1"):d;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=SPy)break}}return woC(a)}}function woC(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,SPy).map(r=>({...r,filename:r.filename||joC(t).filename,function:r.function||DPy}))}function joC(e){return e[e.length-1]||{}}ika.stackParser=PoC(RaC());ika.frameModifiers=[xaC];var oka=class extends zbf{getLibraryId(){return"posthog-node"}};var mEs=class{posthog;constructor({posthogApiKey:t}){this.posthog=new oka(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.90.1",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var QJo=class{async sendEvent(){}async identify(){}async flush(){}};var ska=require("fs/promises"),BPy=require("os"),TPy=require("path");var CPy=fa(require("crypto")),AEs=new Uint8Array(256),OEs=AEs.length;function Vbf(){return OEs>AEs.length-16&&(CPy.default.randomFillSync(AEs),OEs=0),AEs.slice(OEs,OEs+=16)}var xbe=[];for(let e=0;e<256;++e)xbe.push((e+256).toString(16).slice(1));function IPy(e,t=0){return xbe[e[t+0]]+xbe[e[t+1]]+xbe[e[t+2]]+xbe[e[t+3]]+"-"+xbe[e[t+4]]+xbe[e[t+5]]+"-"+xbe[e[t+6]]+xbe[e[t+7]]+"-"+xbe[e[t+8]]+xbe[e[t+9]]+"-"+xbe[e[t+10]]+xbe[e[t+11]]+xbe[e[t+12]]+xbe[e[t+13]]+xbe[e[t+14]]+xbe[e[t+15]]}var MPy=fa(require("crypto")),Wbf={randomUUID:MPy.default.randomUUID};function EoC(e,t,r){if(Wbf.randomUUID&&!t&&!e)return Wbf.randomUUID();e=e||{};let n=e.random||(e.rng||Vbf)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return IPy(n)}var Pht=EoC;var SoC="id",DoC=".fern",LJo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new oka(r),this.userId=t==null?void 0:iff(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.90.1",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Jl(x_.of((0,BPy.homedir)()),ys.of(DoC),ys.of(SoC));await Tv(t)||(await(0,ska.mkdir)((0,TPy.dirname)(t),{recursive:!0}),await(0,ska.writeFile)(t,Pht())),this.persistedDistinctId=(await(0,ska.readFile)(t)).toString()}return this.persistedDistinctId}};var Hbf;async function cka(){return Hbf==null&&(Hbf=await CoC()),Hbf}async function CoC(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new QJo;let r=await Mms();return r!=null?new LJo({token:r,posthogApiKey:e}):await cXa()!=null?new mEs({posthogApiKey:e}):new LJo({token:void 0,posthogApiKey:e})}catch{return new QJo}}function UJo(e,t){return function(){return e.apply(t,arguments)}}var{toString:IoC}=Object.prototype,{getPrototypeOf:Jbf}=Object,{iterator:wEs,toStringTag:RPy}=Symbol,jEs=(e=>t=>{let r=IoC.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),nqr=e=>(e=e.toLowerCase(),t=>jEs(t)===e),EEs=e=>t=>typeof t===e,{isArray:fka}=Array,lka=EEs("undefined");function VJo(e){return e!==null&&!lka(e)&&e.constructor!==null&&!lka(e.constructor)&&Uxe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var NPy=nqr("ArrayBuffer");function MoC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&NPy(e.buffer),t}var BoC=EEs("string"),Uxe=EEs("function"),FPy=EEs("number"),WJo=e=>e!==null&&typeof e=="object",ToC=e=>e===!0||e===!1,PEs=e=>{if(jEs(e)!=="object")return!1;let t=Jbf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RPy in e)&&!(wEs in e)},qoC=e=>{if(!WJo(e)||VJo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},RoC=nqr("Date"),NoC=nqr("File"),FoC=nqr("Blob"),xoC=nqr("FileList"),zoC=e=>WJo(e)&&Uxe(e.pipe),QoC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Uxe(e.append)&&((t=jEs(e))==="formdata"||t==="object"&&Uxe(e.toString)&&e.toString()==="[object FormData]"))},LoC=nqr("URLSearchParams"),[UoC,VoC,WoC,HoC]=["ReadableStream","Request","Response","Headers"].map(nqr),GoC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function HJo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),fka(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(VJo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(n=0;n<o;n++)c=a[n],t.call(null,e[c],c,e)}}function xPy(e,t){if(VJo(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var Hsa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zPy=e=>!lka(e)&&e!==Hsa;function Gbf(){let{caseless:e,skipUndefined:t}=zPy(this)&&this||{},r={},n=(i,a)=>{let o=e&&xPy(r,a)||a;PEs(r[o])&&PEs(i)?r[o]=Gbf(r[o],i):PEs(i)?r[o]=Gbf({},i):fka(i)?r[o]=i.slice():(!t||!lka(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&HJo(arguments[i],n);return r}var JoC=(e,t,r,{allOwnKeys:n}={})=>(HJo(t,(i,a)=>{r&&Uxe(i)?e[a]=UJo(i,r):e[a]=i},{allOwnKeys:n}),e),KoC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$oC=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},YoC=(e,t,r,n)=>{let i,a,o,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&Jbf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},XoC=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},ZoC=e=>{if(!e)return null;if(fka(e))return e;let t=e.length;if(!FPy(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},koC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jbf(Uint8Array)),euC=(e,t)=>{let n=(e&&e[wEs]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},tuC=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ruC=nqr("HTMLFormElement"),nuC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),qPy=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),iuC=nqr("RegExp"),QPy=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};HJo(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},auC=e=>{QPy(e,(t,r)=>{if(Uxe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Uxe(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ouC=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return fka(e)?n(e):n(String(e).split(t)),r},uuC=()=>{},suC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cuC(e){return!!(e&&Uxe(e.append)&&e[RPy]==="FormData"&&e[wEs])}var luC=e=>{let t=new Array(10),r=(n,i)=>{if(WJo(n)){if(t.indexOf(n)>=0)return;if(VJo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=fka(n)?[]:{};return HJo(n,(o,c)=>{let d=r(o,i+1);!lka(d)&&(a[c]=d)}),t[i]=void 0,a}}return n};return r(e,0)},fuC=nqr("AsyncFunction"),duC=e=>e&&(WJo(e)||Uxe(e))&&Uxe(e.then)&&Uxe(e.catch),LPy=((e,t)=>e?setImmediate:t?((r,n)=>(Hsa.addEventListener("message",({source:i,data:a})=>{i===Hsa&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Hsa.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Uxe(Hsa.postMessage)),puC=typeof queueMicrotask<"u"?queueMicrotask.bind(Hsa):typeof process<"u"&&process.nextTick||LPy,_uC=e=>e!=null&&Uxe(e[wEs]),Yf={isArray:fka,isArrayBuffer:NPy,isBuffer:VJo,isFormData:QoC,isArrayBufferView:MoC,isString:BoC,isNumber:FPy,isBoolean:ToC,isObject:WJo,isPlainObject:PEs,isEmptyObject:qoC,isReadableStream:UoC,isRequest:VoC,isResponse:WoC,isHeaders:HoC,isUndefined:lka,isDate:RoC,isFile:NoC,isBlob:FoC,isRegExp:iuC,isFunction:Uxe,isStream:zoC,isURLSearchParams:LoC,isTypedArray:koC,isFileList:xoC,forEach:HJo,merge:Gbf,extend:JoC,trim:GoC,stripBOM:KoC,inherits:$oC,toFlatObject:YoC,kindOf:jEs,kindOfTest:nqr,endsWith:XoC,toArray:ZoC,forEachEntry:euC,matchAll:tuC,isHTMLForm:ruC,hasOwnProperty:qPy,hasOwnProp:qPy,reduceDescriptors:QPy,freezeMethods:auC,toObjectSet:ouC,toCamelCase:nuC,noop:uuC,toFiniteNumber:suC,findKey:xPy,global:Hsa,isContextDefined:zPy,isSpecCompliantForm:cuC,toJSONObject:luC,isAsyncFn:fuC,isThenable:duC,setImmediate:LPy,asap:puC,isIterable:_uC};function dka(e,t,r,n,i){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),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}Yf.inherits(dka,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:Yf.toJSONObject(this.config),code:this.code,status:this.status}}});var UPy=dka.prototype,VPy={};["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=>{VPy[e]={value:e}});Object.defineProperties(dka,VPy);Object.defineProperty(UPy,"isAxiosError",{value:!0});dka.from=(e,t,r,n,i,a)=>{let o=Object.create(UPy);Yf.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return dka.call(o,c,d,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Dm=dka;var WPy=fa($1s(),1),SEs=WPy.default;function Kbf(e){return Yf.isPlainObject(e)||Yf.isArray(e)}function GPy(e){return Yf.endsWith(e,"[]")?e.slice(0,-2):e}function HPy(e,t,r){return e?e.concat(t).map(function(i,a){return i=GPy(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function huC(e){return Yf.isArray(e)&&!e.some(Kbf)}var yuC=Yf.toFlatObject(Yf,{},null,function(t){return/^is[A-Z]/.test(t)});function vuC(e,t,r){if(!Yf.isObject(e))throw new TypeError("target must be an object");t=t||new(SEs||FormData),r=Yf.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!Yf.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&Yf.isSpecCompliantForm(t);if(!Yf.isFunction(i))throw new TypeError("visitor must be a function");function s(P){if(P===null)return"";if(Yf.isDate(P))return P.toISOString();if(Yf.isBoolean(P))return P.toString();if(!d&&Yf.isBlob(P))throw new Dm("Blob is not supported. Use a Buffer instead.");return Yf.isArrayBuffer(P)||Yf.isTypedArray(P)?d&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function u(P,C,M){let T=P;if(P&&!M&&typeof P=="object"){if(Yf.endsWith(C,"{}"))C=n?C:C.slice(0,-2),P=JSON.stringify(P);else if(Yf.isArray(P)&&huC(P)||(Yf.isFileList(P)||Yf.endsWith(C,"[]"))&&(T=Yf.toArray(P)))return C=GPy(C),T.forEach(function(U,R){!(Yf.isUndefined(U)||U===null)&&t.append(o===!0?HPy([C],R,a):o===null?C:C+"[]",s(U))}),!1}return Kbf(P)?!0:(t.append(HPy(M,C,a),s(P)),!1)}let l=[],m=Object.assign(yuC,{defaultVisitor:u,convertValue:s,isVisitable:Kbf});function A(P,C){if(!Yf.isUndefined(P)){if(l.indexOf(P)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(P),Yf.forEach(P,function(T,z){(!(Yf.isUndefined(T)||T===null)&&i.call(t,T,Yf.isString(z)?z.trim():z,C,m))===!0&&A(T,C?C.concat(z):[z])}),l.pop()}}if(!Yf.isObject(e))throw new TypeError("data must be an object");return A(e),t}var I4i=vuC;function JPy(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function KPy(e,t){this._pairs=[],e&&I4i(e,this,t)}var $Py=KPy.prototype;$Py.append=function(t,r){this._pairs.push([t,r])};$Py.toString=function(t){let r=t?function(n){return t.call(this,n,JPy)}:JPy;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var YPy=KPy;function buC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Gsa(e,t,r){if(!t)return e;let n=r&&r.encode||buC;Yf.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=Yf.isURLSearchParams(t)?t.toString():new YPy(t,r).toString(n),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var $bf=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Yf.forEach(this.handlers,function(n){n!==null&&t(n)})}},Ybf=$bf;var pka={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ewy=fa(require("crypto"),1);var XPy=fa(require("url"),1),ZPy=XPy.default.URLSearchParams;var Xbf="abcdefghijklmnopqrstuvwxyz",kPy="0123456789",twy={DIGIT:kPy,ALPHA:Xbf,ALPHA_DIGIT:Xbf+Xbf.toUpperCase()+kPy},guC=(e=16,t=twy.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);ewy.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},rwy={isNode:!0,classes:{URLSearchParams:ZPy,FormData:SEs,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:twy,generateString:guC,protocols:["http","https","file","data"]};var egf={};ff(egf,{hasBrowserEnv:()=>kbf,hasStandardBrowserEnv:()=>muC,hasStandardBrowserWebWorkerEnv:()=>OuC,navigator:()=>Zbf,origin:()=>AuC});var kbf=typeof window<"u"&&typeof document<"u",Zbf=typeof navigator=="object"&&navigator||void 0,muC=kbf&&(!Zbf||["ReactNative","NativeScript","NS"].indexOf(Zbf.product)<0),OuC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",AuC=kbf&&window.location.href||"http://localhost";var V2={...egf,...rwy};function tgf(e,t){return I4i(e,new V2.classes.URLSearchParams,{visitor:function(r,n,i,a){return V2.isNode&&Yf.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function PuC(e){return Yf.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wuC(e){let t={},r=Object.keys(e),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function juC(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&Yf.isArray(i)?i.length:o,d?(Yf.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!c):((!i[o]||!Yf.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&Yf.isArray(i[o])&&(i[o]=wuC(i[o])),!c)}if(Yf.isFormData(e)&&Yf.isFunction(e.entries)){let r={};return Yf.forEachEntry(e,(n,i)=>{t(PuC(n),i,r,0)}),r}return null}var DEs=juC;function EuC(e,t,r){if(Yf.isString(e))try{return(t||JSON.parse)(e),Yf.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var rgf={transitional:pka,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Yf.isObject(t);if(a&&Yf.isHTMLForm(t)&&(t=new FormData(t)),Yf.isFormData(t))return i?JSON.stringify(DEs(t)):t;if(Yf.isArrayBuffer(t)||Yf.isBuffer(t)||Yf.isStream(t)||Yf.isFile(t)||Yf.isBlob(t)||Yf.isReadableStream(t))return t;if(Yf.isArrayBufferView(t))return t.buffer;if(Yf.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return tgf(t,this.formSerializer).toString();if((c=Yf.isFileList(t))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return I4i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),EuC(t)):t}],transformResponse:[function(t){let r=this.transitional||rgf.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(Yf.isResponse(t)||Yf.isReadableStream(t))return t;if(t&&Yf.isString(t)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Dm.from(c,Dm.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:V2.classes.FormData,Blob:V2.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Yf.forEach(["delete","get","head","post","put","patch"],e=>{rgf.headers[e]={}});var _ka=rgf;var SuC=Yf.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"]),nwy=e=>{let t={},r,n,i;return e&&e.split(`
|
|
2164
|
+
`);for(let c=i;c<o.length;c++){let d=o[c];if(d.length>1024)continue;let s=fPy.test(d)?d.replace(fPy,"$1"):d;if(!s.match(/\S*Error: /)){for(let u of r){let l=u(s);if(l){a.push(l);break}}if(a.length>=SPy)break}}return woC(a)}}function woC(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,SPy).map(r=>({...r,filename:r.filename||joC(t).filename,function:r.function||DPy}))}function joC(e){return e[e.length-1]||{}}ika.stackParser=PoC(RaC());ika.frameModifiers=[xaC];var oka=class extends zbf{getLibraryId(){return"posthog-node"}};var mEs=class{posthog;constructor({posthogApiKey:t}){this.posthog=new oka(t)}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"0.91.0",usingAccessToken:!0}})}async flush(){await this.posthog.flush()}};var QJo=class{async sendEvent(){}async identify(){}async flush(){}};var ska=require("fs/promises"),BPy=require("os"),TPy=require("path");var CPy=fa(require("crypto")),AEs=new Uint8Array(256),OEs=AEs.length;function Vbf(){return OEs>AEs.length-16&&(CPy.default.randomFillSync(AEs),OEs=0),AEs.slice(OEs,OEs+=16)}var xbe=[];for(let e=0;e<256;++e)xbe.push((e+256).toString(16).slice(1));function IPy(e,t=0){return xbe[e[t+0]]+xbe[e[t+1]]+xbe[e[t+2]]+xbe[e[t+3]]+"-"+xbe[e[t+4]]+xbe[e[t+5]]+"-"+xbe[e[t+6]]+xbe[e[t+7]]+"-"+xbe[e[t+8]]+xbe[e[t+9]]+"-"+xbe[e[t+10]]+xbe[e[t+11]]+xbe[e[t+12]]+xbe[e[t+13]]+xbe[e[t+14]]+xbe[e[t+15]]}var MPy=fa(require("crypto")),Wbf={randomUUID:MPy.default.randomUUID};function EoC(e,t,r){if(Wbf.randomUUID&&!t&&!e)return Wbf.randomUUID();e=e||{};let n=e.random||(e.rng||Vbf)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return IPy(n)}var Pht=EoC;var SoC="id",DoC=".fern",LJo=class{posthog;userId;constructor({token:t,posthogApiKey:r}){this.posthog=new oka(r),this.userId=t==null?void 0:iff(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.91.0",...t,...t.properties}})}async flush(){await this.posthog.flush()}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=Jl(x_.of((0,BPy.homedir)()),ys.of(DoC),ys.of(SoC));await Tv(t)||(await(0,ska.mkdir)((0,TPy.dirname)(t),{recursive:!0}),await(0,ska.writeFile)(t,Pht())),this.persistedDistinctId=(await(0,ska.readFile)(t)).toString()}return this.persistedDistinctId}};var Hbf;async function cka(){return Hbf==null&&(Hbf=await CoC()),Hbf}async function CoC(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal",t=process.env.FERN_DISABLE_TELEMETRY==="true";if(e==null||t)return new QJo;let r=await Mms();return r!=null?new LJo({token:r,posthogApiKey:e}):await cXa()!=null?new mEs({posthogApiKey:e}):new LJo({token:void 0,posthogApiKey:e})}catch{return new QJo}}function UJo(e,t){return function(){return e.apply(t,arguments)}}var{toString:IoC}=Object.prototype,{getPrototypeOf:Jbf}=Object,{iterator:wEs,toStringTag:RPy}=Symbol,jEs=(e=>t=>{let r=IoC.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),nqr=e=>(e=e.toLowerCase(),t=>jEs(t)===e),EEs=e=>t=>typeof t===e,{isArray:fka}=Array,lka=EEs("undefined");function VJo(e){return e!==null&&!lka(e)&&e.constructor!==null&&!lka(e.constructor)&&Uxe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var NPy=nqr("ArrayBuffer");function MoC(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&NPy(e.buffer),t}var BoC=EEs("string"),Uxe=EEs("function"),FPy=EEs("number"),WJo=e=>e!==null&&typeof e=="object",ToC=e=>e===!0||e===!1,PEs=e=>{if(jEs(e)!=="object")return!1;let t=Jbf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RPy in e)&&!(wEs in e)},qoC=e=>{if(!WJo(e)||VJo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},RoC=nqr("Date"),NoC=nqr("File"),FoC=nqr("Blob"),xoC=nqr("FileList"),zoC=e=>WJo(e)&&Uxe(e.pipe),QoC=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Uxe(e.append)&&((t=jEs(e))==="formdata"||t==="object"&&Uxe(e.toString)&&e.toString()==="[object FormData]"))},LoC=nqr("URLSearchParams"),[UoC,VoC,WoC,HoC]=["ReadableStream","Request","Response","Headers"].map(nqr),GoC=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function HJo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),fka(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(VJo(e))return;let a=r?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length,c;for(n=0;n<o;n++)c=a[n],t.call(null,e[c],c,e)}}function xPy(e,t){if(VJo(e))return null;t=t.toLowerCase();let r=Object.keys(e),n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}var Hsa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zPy=e=>!lka(e)&&e!==Hsa;function Gbf(){let{caseless:e,skipUndefined:t}=zPy(this)&&this||{},r={},n=(i,a)=>{let o=e&&xPy(r,a)||a;PEs(r[o])&&PEs(i)?r[o]=Gbf(r[o],i):PEs(i)?r[o]=Gbf({},i):fka(i)?r[o]=i.slice():(!t||!lka(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&HJo(arguments[i],n);return r}var JoC=(e,t,r,{allOwnKeys:n}={})=>(HJo(t,(i,a)=>{r&&Uxe(i)?e[a]=UJo(i,r):e[a]=i},{allOwnKeys:n}),e),KoC=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$oC=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},YoC=(e,t,r,n)=>{let i,a,o,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&Jbf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},XoC=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return n!==-1&&n===r},ZoC=e=>{if(!e)return null;if(fka(e))return e;let t=e.length;if(!FPy(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},koC=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Jbf(Uint8Array)),euC=(e,t)=>{let n=(e&&e[wEs]).call(e),i;for(;(i=n.next())&&!i.done;){let a=i.value;t.call(e,a[0],a[1])}},tuC=(e,t)=>{let r,n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ruC=nqr("HTMLFormElement"),nuC=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),qPy=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),iuC=nqr("RegExp"),QPy=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};HJo(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},auC=e=>{QPy(e,(t,r)=>{if(Uxe(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let n=e[r];if(Uxe(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ouC=(e,t)=>{let r={},n=i=>{i.forEach(a=>{r[a]=!0})};return fka(e)?n(e):n(String(e).split(t)),r},uuC=()=>{},suC=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cuC(e){return!!(e&&Uxe(e.append)&&e[RPy]==="FormData"&&e[wEs])}var luC=e=>{let t=new Array(10),r=(n,i)=>{if(WJo(n)){if(t.indexOf(n)>=0)return;if(VJo(n))return n;if(!("toJSON"in n)){t[i]=n;let a=fka(n)?[]:{};return HJo(n,(o,c)=>{let d=r(o,i+1);!lka(d)&&(a[c]=d)}),t[i]=void 0,a}}return n};return r(e,0)},fuC=nqr("AsyncFunction"),duC=e=>e&&(WJo(e)||Uxe(e))&&Uxe(e.then)&&Uxe(e.catch),LPy=((e,t)=>e?setImmediate:t?((r,n)=>(Hsa.addEventListener("message",({source:i,data:a})=>{i===Hsa&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Hsa.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Uxe(Hsa.postMessage)),puC=typeof queueMicrotask<"u"?queueMicrotask.bind(Hsa):typeof process<"u"&&process.nextTick||LPy,_uC=e=>e!=null&&Uxe(e[wEs]),Yf={isArray:fka,isArrayBuffer:NPy,isBuffer:VJo,isFormData:QoC,isArrayBufferView:MoC,isString:BoC,isNumber:FPy,isBoolean:ToC,isObject:WJo,isPlainObject:PEs,isEmptyObject:qoC,isReadableStream:UoC,isRequest:VoC,isResponse:WoC,isHeaders:HoC,isUndefined:lka,isDate:RoC,isFile:NoC,isBlob:FoC,isRegExp:iuC,isFunction:Uxe,isStream:zoC,isURLSearchParams:LoC,isTypedArray:koC,isFileList:xoC,forEach:HJo,merge:Gbf,extend:JoC,trim:GoC,stripBOM:KoC,inherits:$oC,toFlatObject:YoC,kindOf:jEs,kindOfTest:nqr,endsWith:XoC,toArray:ZoC,forEachEntry:euC,matchAll:tuC,isHTMLForm:ruC,hasOwnProperty:qPy,hasOwnProp:qPy,reduceDescriptors:QPy,freezeMethods:auC,toObjectSet:ouC,toCamelCase:nuC,noop:uuC,toFiniteNumber:suC,findKey:xPy,global:Hsa,isContextDefined:zPy,isSpecCompliantForm:cuC,toJSONObject:luC,isAsyncFn:fuC,isThenable:duC,setImmediate:LPy,asap:puC,isIterable:_uC};function dka(e,t,r,n,i){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),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}Yf.inherits(dka,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:Yf.toJSONObject(this.config),code:this.code,status:this.status}}});var UPy=dka.prototype,VPy={};["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=>{VPy[e]={value:e}});Object.defineProperties(dka,VPy);Object.defineProperty(UPy,"isAxiosError",{value:!0});dka.from=(e,t,r,n,i,a)=>{let o=Object.create(UPy);Yf.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError");let c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return dka.call(o,c,d,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};var Dm=dka;var WPy=fa($1s(),1),SEs=WPy.default;function Kbf(e){return Yf.isPlainObject(e)||Yf.isArray(e)}function GPy(e){return Yf.endsWith(e,"[]")?e.slice(0,-2):e}function HPy(e,t,r){return e?e.concat(t).map(function(i,a){return i=GPy(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function huC(e){return Yf.isArray(e)&&!e.some(Kbf)}var yuC=Yf.toFlatObject(Yf,{},null,function(t){return/^is[A-Z]/.test(t)});function vuC(e,t,r){if(!Yf.isObject(e))throw new TypeError("target must be an object");t=t||new(SEs||FormData),r=Yf.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,M){return!Yf.isUndefined(M[C])});let n=r.metaTokens,i=r.visitor||u,a=r.dots,o=r.indexes,d=(r.Blob||typeof Blob<"u"&&Blob)&&Yf.isSpecCompliantForm(t);if(!Yf.isFunction(i))throw new TypeError("visitor must be a function");function s(P){if(P===null)return"";if(Yf.isDate(P))return P.toISOString();if(Yf.isBoolean(P))return P.toString();if(!d&&Yf.isBlob(P))throw new Dm("Blob is not supported. Use a Buffer instead.");return Yf.isArrayBuffer(P)||Yf.isTypedArray(P)?d&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function u(P,C,M){let T=P;if(P&&!M&&typeof P=="object"){if(Yf.endsWith(C,"{}"))C=n?C:C.slice(0,-2),P=JSON.stringify(P);else if(Yf.isArray(P)&&huC(P)||(Yf.isFileList(P)||Yf.endsWith(C,"[]"))&&(T=Yf.toArray(P)))return C=GPy(C),T.forEach(function(U,R){!(Yf.isUndefined(U)||U===null)&&t.append(o===!0?HPy([C],R,a):o===null?C:C+"[]",s(U))}),!1}return Kbf(P)?!0:(t.append(HPy(M,C,a),s(P)),!1)}let l=[],m=Object.assign(yuC,{defaultVisitor:u,convertValue:s,isVisitable:Kbf});function A(P,C){if(!Yf.isUndefined(P)){if(l.indexOf(P)!==-1)throw Error("Circular reference detected in "+C.join("."));l.push(P),Yf.forEach(P,function(T,z){(!(Yf.isUndefined(T)||T===null)&&i.call(t,T,Yf.isString(z)?z.trim():z,C,m))===!0&&A(T,C?C.concat(z):[z])}),l.pop()}}if(!Yf.isObject(e))throw new TypeError("data must be an object");return A(e),t}var I4i=vuC;function JPy(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function KPy(e,t){this._pairs=[],e&&I4i(e,this,t)}var $Py=KPy.prototype;$Py.append=function(t,r){this._pairs.push([t,r])};$Py.toString=function(t){let r=t?function(n){return t.call(this,n,JPy)}:JPy;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var YPy=KPy;function buC(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Gsa(e,t,r){if(!t)return e;let n=r&&r.encode||buC;Yf.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,a;if(i?a=i(t,r):a=Yf.isURLSearchParams(t)?t.toString():new YPy(t,r).toString(n),a){let o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var $bf=class{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Yf.forEach(this.handlers,function(n){n!==null&&t(n)})}},Ybf=$bf;var pka={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ewy=fa(require("crypto"),1);var XPy=fa(require("url"),1),ZPy=XPy.default.URLSearchParams;var Xbf="abcdefghijklmnopqrstuvwxyz",kPy="0123456789",twy={DIGIT:kPy,ALPHA:Xbf,ALPHA_DIGIT:Xbf+Xbf.toUpperCase()+kPy},guC=(e=16,t=twy.ALPHA_DIGIT)=>{let r="",{length:n}=t,i=new Uint32Array(e);ewy.default.randomFillSync(i);for(let a=0;a<e;a++)r+=t[i[a]%n];return r},rwy={isNode:!0,classes:{URLSearchParams:ZPy,FormData:SEs,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:twy,generateString:guC,protocols:["http","https","file","data"]};var egf={};ff(egf,{hasBrowserEnv:()=>kbf,hasStandardBrowserEnv:()=>muC,hasStandardBrowserWebWorkerEnv:()=>OuC,navigator:()=>Zbf,origin:()=>AuC});var kbf=typeof window<"u"&&typeof document<"u",Zbf=typeof navigator=="object"&&navigator||void 0,muC=kbf&&(!Zbf||["ReactNative","NativeScript","NS"].indexOf(Zbf.product)<0),OuC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",AuC=kbf&&window.location.href||"http://localhost";var V2={...egf,...rwy};function tgf(e,t){return I4i(e,new V2.classes.URLSearchParams,{visitor:function(r,n,i,a){return V2.isNode&&Yf.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function PuC(e){return Yf.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wuC(e){let t={},r=Object.keys(e),n,i=r.length,a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}function juC(e){function t(r,n,i,a){let o=r[a++];if(o==="__proto__")return!0;let c=Number.isFinite(+o),d=a>=r.length;return o=!o&&Yf.isArray(i)?i.length:o,d?(Yf.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!c):((!i[o]||!Yf.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&Yf.isArray(i[o])&&(i[o]=wuC(i[o])),!c)}if(Yf.isFormData(e)&&Yf.isFunction(e.entries)){let r={};return Yf.forEachEntry(e,(n,i)=>{t(PuC(n),i,r,0)}),r}return null}var DEs=juC;function EuC(e,t,r){if(Yf.isString(e))try{return(t||JSON.parse)(e),Yf.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var rgf={transitional:pka,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=Yf.isObject(t);if(a&&Yf.isHTMLForm(t)&&(t=new FormData(t)),Yf.isFormData(t))return i?JSON.stringify(DEs(t)):t;if(Yf.isArrayBuffer(t)||Yf.isBuffer(t)||Yf.isStream(t)||Yf.isFile(t)||Yf.isBlob(t)||Yf.isReadableStream(t))return t;if(Yf.isArrayBufferView(t))return t.buffer;if(Yf.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return tgf(t,this.formSerializer).toString();if((c=Yf.isFileList(t))||n.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return I4i(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),EuC(t)):t}],transformResponse:[function(t){let r=this.transitional||rgf.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(Yf.isResponse(t)||Yf.isReadableStream(t))return t;if(t&&Yf.isString(t)&&(n&&!this.responseType||i)){let o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?Dm.from(c,Dm.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:V2.classes.FormData,Blob:V2.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Yf.forEach(["delete","get","head","post","put","patch"],e=>{rgf.headers[e]={}});var _ka=rgf;var SuC=Yf.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"]),nwy=e=>{let t={},r,n,i;return e&&e.split(`
|
|
2165
2165
|
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&SuC[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};var iwy=Symbol("internals");function GJo(e){return e&&String(e).trim().toLowerCase()}function CEs(e){return e===!1||e==null?e:Yf.isArray(e)?e.map(CEs):String(e)}function DuC(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}var CuC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ngf(e,t,r,n,i){if(Yf.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!Yf.isString(t)){if(Yf.isString(n))return t.indexOf(n)!==-1;if(Yf.isRegExp(n))return n.test(t)}}function IuC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function MuC(e,t){let r=Yf.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}var hka=class{constructor(t){t&&this.set(t)}set(t,r,n){let i=this;function a(c,d,s){let u=GJo(d);if(!u)throw new Error("header name must be a non-empty string");let l=Yf.findKey(i,u);(!l||i[l]===void 0||s===!0||s===void 0&&i[l]!==!1)&&(i[l||d]=CEs(c))}let o=(c,d)=>Yf.forEach(c,(s,u)=>a(s,u,d));if(Yf.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(Yf.isString(t)&&(t=t.trim())&&!CuC(t))o(nwy(t),r);else if(Yf.isObject(t)&&Yf.isIterable(t)){let c={},d,s;for(let u of t){if(!Yf.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[s=u[0]]=(d=c[s])?Yf.isArray(d)?[...d,u[1]]:[d,u[1]]:u[1]}o(c,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=GJo(t),t){let n=Yf.findKey(this,t);if(n){let i=this[n];if(!r)return i;if(r===!0)return DuC(i);if(Yf.isFunction(r))return r.call(this,i,n);if(Yf.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=GJo(t),t){let n=Yf.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ngf(this,this[n],n,r)))}return!1}delete(t,r){let n=this,i=!1;function a(o){if(o=GJo(o),o){let c=Yf.findKey(n,o);c&&(!r||ngf(n,n[c],c,r))&&(delete n[c],i=!0)}}return Yf.isArray(t)?t.forEach(a):a(t),i}clear(t){let r=Object.keys(this),n=r.length,i=!1;for(;n--;){let a=r[n];(!t||ngf(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){let r=this,n={};return Yf.forEach(this,(i,a)=>{let o=Yf.findKey(n,a);if(o){r[o]=CEs(i),delete r[a];return}let c=t?IuC(a):String(a).trim();c!==a&&delete r[a],r[c]=CEs(i),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return Yf.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&Yf.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
2166
2166
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){let n=(this[iwy]=this[iwy]={accessors:{}}).accessors,i=this.prototype;function a(o){let c=GJo(o);n[c]||(MuC(i,o),n[c]=!0)}return Yf.isArray(t)?t.forEach(a):a(t),this}};hka.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Yf.reduceDescriptors(hka.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Yf.freezeMethods(hka);var j$=hka;function JJo(e,t){let r=this||_ka,n=t||r,i=j$.from(n.headers),a=n.data;return Yf.forEach(e,function(c){a=c.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function KJo(e){return!!(e&&e.__CANCEL__)}function awy(e,t,r){Dm.call(this,e??"canceled",Dm.ERR_CANCELED,t,r),this.name="CanceledError"}Yf.inherits(awy,Dm,{__CANCEL__:!0});var Bnt=awy;function S9r(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Dm("Request failed with status code "+r.status,[Dm.ERR_BAD_REQUEST,Dm.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function igf(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function agf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jsa(e,t,r){let n=!igf(t);return e&&(n||r==!1)?agf(e,t):t}var Owy=fa(Y1s(),1),Awy=fa(require("http"),1),Pwy=fa(require("https"),1),wwy=fa(require("util"),1),jwy=fa(obf(),1),PAi=fa(require("zlib"),1);var Ksa="1.12.2";function $Jo(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var BuC=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function ogf(e,t,r){let n=r&&r.Blob||V2.classes.Blob,i=$Jo(e);if(t===void 0&&n&&(t=!0),i==="data"){e=i.length?e.slice(i.length+1):e;let a=BuC.exec(e);if(!a)throw new Dm("Invalid URL",Dm.ERR_INVALID_URL);let o=a[1],c=a[2],d=a[3],s=Buffer.from(decodeURIComponent(d),c?"base64":"utf8");if(t){if(!n)throw new Dm("Blob is not supported",Dm.ERR_NOT_SUPPORT);return new n([s],{type:o})}return s}throw new Dm("Unsupported protocol "+i,Dm.ERR_NOT_SUPPORT)}var Ysa=fa(require("stream"),1);var owy=fa(require("stream"),1);var ugf=Symbol("internals"),sgf=class extends owy.default.Transform{constructor(t){t=Yf.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!Yf.isUndefined(i[n])),super({readableHighWaterMark:t.chunkSize});let r=this[ugf]={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",n=>{n==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(t){let r=this[ugf];return r.onReadCallback&&r.onReadCallback(),super._read(t)}_transform(t,r,n){let i=this[ugf],a=i.maxRate,o=this.readableHighWaterMark,c=i.timeWindow,d=1e3/c,s=a/d,u=i.minChunkSize!==!1?Math.max(i.minChunkSize,s*.01):0,l=(A,P)=>{let C=Buffer.byteLength(A);i.bytesSeen+=C,i.bytes+=C,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(A)?process.nextTick(P):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(P)}},m=(A,P)=>{let C=Buffer.byteLength(A),M=null,T=o,z,U=0;if(a){let R=Date.now();(!i.ts||(U=R-i.ts)>=c)&&(i.ts=R,z=s-i.bytes,i.bytes=z<0?-z:0,U=0),z=s-i.bytes}if(a){if(z<=0)return setTimeout(()=>{P(null,A)},c-U);z<T&&(T=z)}T&&C>T&&C-T>u&&(M=A.subarray(T),A=A.subarray(0,T)),l(A,M?()=>{process.nextTick(P,null,M)}:P)};m(t,function A(P,C){if(P)return n(P);C?m(C,A):n(null)})}},cgf=sgf;var Ewy=require("events");var swy=fa(require("util"),1),cwy=require("stream");var{asyncIterator:uwy}=Symbol,TuC=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[uwy]?yield*e[uwy]():yield e},IEs=TuC;var quC=V2.ALPHABET.ALPHA_DIGIT+"-_",YJo=typeof TextEncoder=="function"?new TextEncoder:new swy.default.TextEncoder,$sa=`\r
|
|
2167
2167
|
`,RuC=YJo.encode($sa),NuC=2,lgf=class{constructor(t,r){let{escapeName:n}=this.constructor,i=Yf.isString(r),a=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${$sa}`;i?r=YJo.encode(String(r).replace(/\r?\n|\r\n?/g,$sa)):a+=`Content-Type: ${r.type||"application/octet-stream"}${$sa}`,this.headers=YJo.encode(a+$sa),this.contentLength=i?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+NuC,this.name=t,this.value=r}async*encode(){yield this.headers;let{value:t}=this;Yf.isTypedArray(t)?yield t:yield*IEs(t),yield RuC}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},FuC=(e,t,r)=>{let{tag:n="form-data-boundary",size:i=25,boundary:a=n+"-"+V2.generateString(i,quC)}=r||{};if(!Yf.isFormData(e))throw TypeError("FormData instance required");if(a.length<1||a.length>70)throw Error("boundary must be 10-70 characters long");let o=YJo.encode("--"+a+$sa),c=YJo.encode("--"+a+"--"+$sa),d=c.byteLength,s=Array.from(e.entries()).map(([l,m])=>{let A=new lgf(l,m);return d+=A.size,A});d+=o.byteLength*s.length,d=Yf.toFiniteNumber(d);let u={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(d)&&(u["Content-Length"]=d),t&&t(u),cwy.Readable.from((async function*(){for(let l of s)yield o,yield*l.encode();yield c})())},lwy=FuC;var fwy=fa(require("stream"),1),fgf=class extends fwy.default.Transform{__transform(t,r,n){this.push(t),n()}_transform(t,r,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,r)}this.__transform(t,r,n)}},dwy=fgf;var xuC=(e,t)=>Yf.isAsyncFn(e)?function(...r){let n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(a){n(a)}},n)}:e,pwy=xuC;function zuC(e,t){e=e||10;let r=new Array(e),n=new Array(e),i=0,a=0,o;return t=t!==void 0?t:1e3,function(d){let s=Date.now(),u=n[a];o||(o=s),r[i]=d,n[i]=s;let l=a,m=0;for(;l!==i;)m+=r[l++],l=l%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),s-o<t)return;let A=u&&s-u;return A?Math.round(m*1e3/A):void 0}}var _wy=zuC;function QuC(e,t){let r=0,n=1e3/t,i,a,o=(s,u=Date.now())=>{r=u,i=null,a&&(clearTimeout(a),a=null),e(...s)};return[(...s)=>{let u=Date.now(),l=u-r;l>=n?o(s,u):(i=s,a||(a=setTimeout(()=>{a=null,o(i)},n-l)))},()=>i&&o(i)]}var hwy=QuC;var AAi=(e,t,r=3)=>{let n=0,i=_wy(50,250);return hwy(a=>{let o=a.loaded,c=a.lengthComputable?a.total:void 0,d=o-n,s=i(d),u=o<=c;n=o;let l={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:s||void 0,estimated:s&&c&&u?(c-o)/s:void 0,event:a,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(l)},r)},yka=(e,t)=>{let r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},vka=e=>(...t)=>Yf.asap(()=>e(...t));function dgf(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length,o=n.length;for(let m=0;m<o;m++)if(n.charCodeAt(m)===37&&m+2<o){let A=n.charCodeAt(m+1),P=n.charCodeAt(m+2);(A>=48&&A<=57||A>=65&&A<=70||A>=97&&A<=102)&&(P>=48&&P<=57||P>=65&&P<=70||P>=97&&P<=102)&&(a-=2,m+=2)}let c=0,d=o-1,s=m=>m>=2&&n.charCodeAt(m-2)===37&&n.charCodeAt(m-1)===51&&(n.charCodeAt(m)===68||n.charCodeAt(m)===100);d>=0&&(n.charCodeAt(d)===61?(c++,d--):s(d)&&(c++,d-=3)),c===1&&d>=0&&(n.charCodeAt(d)===61||s(d))&&c++;let l=Math.floor(a/4)*3-(c||0);return l>0?l:0}return Buffer.byteLength(n,"utf8")}var ywy={flush:PAi.default.constants.Z_SYNC_FLUSH,finishFlush:PAi.default.constants.Z_SYNC_FLUSH},LuC={flush:PAi.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:PAi.default.constants.BROTLI_OPERATION_FLUSH},vwy=Yf.isFunction(PAi.default.createBrotliDecompress),{http:UuC,https:VuC}=jwy.default,WuC=/https:?/,bwy=V2.protocols.map(e=>e+":"),gwy=(e,[t,r])=>(e.on("end",r).on("error",r),t);function HuC(e,t){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t)}function Swy(e,t,r){let n=t;if(!n&&n!==!1){let i=Owy.default.getProxyForUrl(r);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let a=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+a}e.headers.host=e.hostname+(e.port?":"+e.port:"");let i=n.hostname||n.host;e.hostname=i,e.host=i,e.port=n.port,e.path=r,n.protocol&&(e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}e.beforeRedirects.proxy=function(a){Swy(a,t,a.href)}}var GuC=typeof process<"u"&&Yf.kindOf(process)==="process",JuC=e=>new Promise((t,r)=>{let n,i,a=(d,s)=>{i||(i=!0,n&&n(d,s))},o=d=>{a(d),t(d)},c=d=>{a(d,!0),r(d)};e(o,c,d=>n=d).catch(c)}),KuC=({address:e,family:t})=>{if(!Yf.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},mwy=(e,t)=>KuC(Yf.isObject(e)?e:{address:e,family:t}),Dwy=GuC&&function(t){return JuC(async function(n,i,a){let{data:o,lookup:c,family:d}=t,{responseType:s,responseEncoding:u}=t,l=t.method.toUpperCase(),m,A=!1,P;if(c){let Se=pwy(c,St=>Yf.isArray(St)?St:[St]);c=(St,yt,Ne)=>{Se(St,yt,(De,Qt,Xe)=>{if(De)return Ne(De);let Yt=Yf.isArray(Qt)?Qt.map(Mt=>mwy(Mt)):[mwy(Qt,Xe)];yt.all?Ne(De,Yt):Ne(De,Yt[0].address,Yt[0].family)})}}let C=new Ewy.EventEmitter,M=()=>{t.cancelToken&&t.cancelToken.unsubscribe(T),t.signal&&t.signal.removeEventListener("abort",T),C.removeAllListeners()};a((Se,St)=>{m=!0,St&&(A=!0,M())});function T(Se){C.emit("abort",!Se||Se.type?new Bnt(null,t,P):Se)}C.once("abort",i),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(T),t.signal&&(t.signal.aborted?T():t.signal.addEventListener("abort",T)));let z=Jsa(t.baseURL,t.url,t.allowAbsoluteUrls),U=new URL(z,V2.hasBrowserEnv?V2.origin:void 0),R=U.protocol||bwy[0];if(R==="data:"){if(t.maxContentLength>-1){let St=String(t.url||z||"");if(dgf(St)>t.maxContentLength)return i(new Dm("maxContentLength size of "+t.maxContentLength+" exceeded",Dm.ERR_BAD_RESPONSE,t))}let Se;if(l!=="GET")return S9r(n,i,{status:405,statusText:"method not allowed",headers:{},config:t});try{Se=ogf(t.url,s==="blob",{Blob:t.env&&t.env.Blob})}catch(St){throw Dm.from(St,Dm.ERR_BAD_REQUEST,t)}return s==="text"?(Se=Se.toString(u),(!u||u==="utf8")&&(Se=Yf.stripBOM(Se))):s==="stream"&&(Se=Ysa.default.Readable.from(Se)),S9r(n,i,{data:Se,status:200,statusText:"OK",headers:new j$,config:t})}if(bwy.indexOf(R)===-1)return i(new Dm("Unsupported protocol "+R,Dm.ERR_BAD_REQUEST,t));let V=j$.from(t.headers).normalize();V.set("User-Agent","axios/"+Ksa,!1);let{onUploadProgress:$,onDownloadProgress:re}=t,Y=t.maxRate,te,ne;if(Yf.isSpecCompliantForm(o)){let Se=V.getContentType(/boundary=([-_\w\d]{10,70})/i);o=lwy(o,St=>{V.set(St)},{tag:`axios-${Ksa}-boundary`,boundary:Se&&Se[1]||void 0})}else if(Yf.isFormData(o)&&Yf.isFunction(o.getHeaders)){if(V.set(o.getHeaders()),!V.hasContentLength())try{let Se=await wwy.default.promisify(o.getLength).call(o);Number.isFinite(Se)&&Se>=0&&V.setContentLength(Se)}catch{}}else if(Yf.isBlob(o)||Yf.isFile(o))o.size&&V.setContentType(o.type||"application/octet-stream"),V.setContentLength(o.size||0),o=Ysa.default.Readable.from(IEs(o));else if(o&&!Yf.isStream(o)){if(!Buffer.isBuffer(o))if(Yf.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(Yf.isString(o))o=Buffer.from(o,"utf-8");else return i(new Dm("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Dm.ERR_BAD_REQUEST,t));if(V.setContentLength(o.length,!1),t.maxBodyLength>-1&&o.length>t.maxBodyLength)return i(new Dm("Request body larger than maxBodyLength limit",Dm.ERR_BAD_REQUEST,t))}let Oe=Yf.toFiniteNumber(V.getContentLength());Yf.isArray(Y)?(te=Y[0],ne=Y[1]):te=ne=Y,o&&($||te)&&(Yf.isStream(o)||(o=Ysa.default.Readable.from(o,{objectMode:!1})),o=Ysa.default.pipeline([o,new cgf({maxRate:Yf.toFiniteNumber(te)})],Yf.noop),$&&o.on("progress",gwy(o,yka(Oe,AAi(vka($),!1,3)))));let ge;if(t.auth){let Se=t.auth.username||"",St=t.auth.password||"";ge=Se+":"+St}if(!ge&&U.username){let Se=U.username,St=U.password;ge=Se+":"+St}ge&&V.delete("authorization");let ve;try{ve=Gsa(U.pathname+U.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Se){let St=new Error(Se.message);return St.config=t,St.url=t.url,St.exists=!0,i(St)}V.set("Accept-Encoding","gzip, compress, deflate"+(vwy?", br":""),!1);let be={path:ve,method:l,headers:V.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:ge,protocol:R,family:d,beforeRedirect:HuC,beforeRedirects:{}};!Yf.isUndefined(c)&&(be.lookup=c),t.socketPath?be.socketPath=t.socketPath:(be.hostname=U.hostname.startsWith("[")?U.hostname.slice(1,-1):U.hostname,be.port=U.port,Swy(be,t.proxy,R+"//"+U.hostname+(U.port?":"+U.port:"")+be.path));let Me,Be=WuC.test(be.protocol);if(be.agent=Be?t.httpsAgent:t.httpAgent,t.transport?Me=t.transport:t.maxRedirects===0?Me=Be?Pwy.default:Awy.default:(t.maxRedirects&&(be.maxRedirects=t.maxRedirects),t.beforeRedirect&&(be.beforeRedirects.config=t.beforeRedirect),Me=Be?VuC:UuC),t.maxBodyLength>-1?be.maxBodyLength=t.maxBodyLength:be.maxBodyLength=1/0,t.insecureHTTPParser&&(be.insecureHTTPParser=t.insecureHTTPParser),P=Me.request(be,function(St){if(P.destroyed)return;let yt=[St],Ne=+St.headers["content-length"];if(re||ne){let Mt=new cgf({maxRate:Yf.toFiniteNumber(ne)});re&&Mt.on("progress",gwy(Mt,yka(Ne,AAi(vka(re),!0,3)))),yt.push(Mt)}let De=St,Qt=St.req||P;if(t.decompress!==!1&&St.headers["content-encoding"])switch((l==="HEAD"||St.statusCode===204)&&delete St.headers["content-encoding"],(St.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":yt.push(PAi.default.createUnzip(ywy)),delete St.headers["content-encoding"];break;case"deflate":yt.push(new dwy),yt.push(PAi.default.createUnzip(ywy)),delete St.headers["content-encoding"];break;case"br":vwy&&(yt.push(PAi.default.createBrotliDecompress(LuC)),delete St.headers["content-encoding"])}De=yt.length>1?Ysa.default.pipeline(yt,Yf.noop):yt[0];let Xe=Ysa.default.finished(De,()=>{Xe(),M()}),Yt={status:St.statusCode,statusText:St.statusMessage,headers:new j$(St.headers),config:t,request:Qt};if(s==="stream")Yt.data=De,S9r(n,i,Yt);else{let Mt=[],Ke=0;De.on("data",function(sr){Mt.push(sr),Ke+=sr.length,t.maxContentLength>-1&&Ke>t.maxContentLength&&(A=!0,De.destroy(),i(new Dm("maxContentLength size of "+t.maxContentLength+" exceeded",Dm.ERR_BAD_RESPONSE,t,Qt)))}),De.on("aborted",function(){if(A)return;let sr=new Dm("stream has been aborted",Dm.ERR_BAD_RESPONSE,t,Qt);De.destroy(sr),i(sr)}),De.on("error",function(sr){P.destroyed||i(Dm.from(sr,null,t,Qt))}),De.on("end",function(){try{let sr=Mt.length===1?Mt[0]:Buffer.concat(Mt);s!=="arraybuffer"&&(sr=sr.toString(u),(!u||u==="utf8")&&(sr=Yf.stripBOM(sr))),Yt.data=sr}catch(sr){return i(Dm.from(sr,null,t,Yt.request,Yt))}S9r(n,i,Yt)})}C.once("abort",Mt=>{De.destroyed||(De.emit("error",Mt),De.destroy())})}),C.once("abort",Se=>{i(Se),P.destroy(Se)}),P.on("error",function(St){i(Dm.from(St,null,t,P))}),P.on("socket",function(St){St.setKeepAlive(!0,1e3*60)}),t.timeout){let Se=parseInt(t.timeout,10);if(Number.isNaN(Se)){i(new Dm("error trying to parse `config.timeout` to int",Dm.ERR_BAD_OPTION_VALUE,t,P));return}P.setTimeout(Se,function(){if(m)return;let yt=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",Ne=t.transitional||pka;t.timeoutErrorMessage&&(yt=t.timeoutErrorMessage),i(new Dm(yt,Ne.clarifyTimeoutError?Dm.ETIMEDOUT:Dm.ECONNABORTED,t,P)),T()})}if(Yf.isStream(o)){let Se=!1,St=!1;o.on("end",()=>{Se=!0}),o.once("error",yt=>{St=!0,P.destroy(yt)}),o.on("close",()=>{!Se&&!St&&T(new Bnt("Request stream has been aborted",t,P))}),o.pipe(P)}else P.end(o)})};var Cwy=V2.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,V2.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(V2.origin),V2.navigator&&/(msie|trident)/i.test(V2.navigator.userAgent)):()=>!0;var Iwy=V2.hasStandardBrowserEnv?{write(e,t,r,n,i,a){let o=[e+"="+encodeURIComponent(t)];Yf.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Yf.isString(n)&&o.push("path="+n),Yf.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Mwy=e=>e instanceof j$?{...e}:e;function iqr(e,t){t=t||{};let r={};function n(s,u,l,m){return Yf.isPlainObject(s)&&Yf.isPlainObject(u)?Yf.merge.call({caseless:m},s,u):Yf.isPlainObject(u)?Yf.merge({},u):Yf.isArray(u)?u.slice():u}function i(s,u,l,m){if(Yf.isUndefined(u)){if(!Yf.isUndefined(s))return n(void 0,s,l,m)}else return n(s,u,l,m)}function a(s,u){if(!Yf.isUndefined(u))return n(void 0,u)}function o(s,u){if(Yf.isUndefined(u)){if(!Yf.isUndefined(s))return n(void 0,s)}else return n(void 0,u)}function c(s,u,l){if(l in t)return n(s,u);if(l in e)return n(void 0,s)}let d={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(s,u,l)=>i(Mwy(s),Mwy(u),l,!0)};return Yf.forEach(Object.keys({...e,...t}),function(u){let l=d[u]||i,m=l(e[u],t[u],u);Yf.isUndefined(m)&&l!==c||(r[u]=m)}),r}var MEs=e=>{let t=iqr({},e),{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:c}=t;if(t.headers=o=j$.from(o),t.url=Gsa(Jsa(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Yf.isFormData(r)){if(V2.hasStandardBrowserEnv||V2.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(Yf.isFunction(r.getHeaders)){let d=r.getHeaders(),s=["content-type","content-length"];Object.entries(d).forEach(([u,l])=>{s.includes(u.toLowerCase())&&o.set(u,l)})}}if(V2.hasStandardBrowserEnv&&(n&&Yf.isFunction(n)&&(n=n(t)),n||n!==!1&&Cwy(t.url))){let d=i&&a&&Iwy.read(a);d&&o.set(i,d)}return t};var $uC=typeof XMLHttpRequest<"u",Bwy=$uC&&function(e){return new Promise(function(r,n){let i=MEs(e),a=i.data,o=j$.from(i.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:s}=i,u,l,m,A,P;function C(){A&&A(),P&&P(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let M=new XMLHttpRequest;M.open(i.method.toUpperCase(),i.url,!0),M.timeout=i.timeout;function T(){if(!M)return;let U=j$.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),V={data:!c||c==="text"||c==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:U,config:e,request:M};S9r(function(re){r(re),C()},function(re){n(re),C()},V),M=null}"onloadend"in M?M.onloadend=T:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(T)},M.onabort=function(){M&&(n(new Dm("Request aborted",Dm.ECONNABORTED,e,M)),M=null)},M.onerror=function(R){let V=R&&R.message?R.message:"Network Error",$=new Dm(V,Dm.ERR_NETWORK,e,M);$.event=R||null,n($),M=null},M.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",V=i.transitional||pka;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),n(new Dm(R,V.clarifyTimeoutError?Dm.ETIMEDOUT:Dm.ECONNABORTED,e,M)),M=null},a===void 0&&o.setContentType(null),"setRequestHeader"in M&&Yf.forEach(o.toJSON(),function(R,V){M.setRequestHeader(V,R)}),Yf.isUndefined(i.withCredentials)||(M.withCredentials=!!i.withCredentials),c&&c!=="json"&&(M.responseType=i.responseType),s&&([m,P]=AAi(s,!0),M.addEventListener("progress",m)),d&&M.upload&&([l,A]=AAi(d),M.upload.addEventListener("progress",l),M.upload.addEventListener("loadend",A)),(i.cancelToken||i.signal)&&(u=U=>{M&&(n(!U||U.type?new Bnt(null,e,M):U),M.abort(),M=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));let z=$Jo(i.url);if(z&&V2.protocols.indexOf(z)===-1){n(new Dm("Unsupported protocol "+z+":",Dm.ERR_BAD_REQUEST,e));return}M.send(a||null)})};var YuC=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i,a=function(s){if(!i){i=!0,c();let u=s instanceof Error?s:this.reason;n.abort(u instanceof Dm?u:new Bnt(u instanceof Error?u.message:u))}},o=t&&setTimeout(()=>{o=null,a(new Dm(`timeout ${t} of ms exceeded`,Dm.ETIMEDOUT))},t),c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(s=>{s.unsubscribe?s.unsubscribe(a):s.removeEventListener("abort",a)}),e=null)};e.forEach(s=>s.addEventListener("abort",a));let{signal:d}=n;return d.unsubscribe=()=>Yf.asap(c),d}},Twy=YuC;var XuC=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},ZuC=async function*(e,t){for await(let r of kuC(e))yield*XuC(r,t)},kuC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},pgf=(e,t,r,n)=>{let i=ZuC(e,t),a=0,o,c=d=>{o||(o=!0,n&&n(d))};return new ReadableStream({async pull(d){try{let{done:s,value:u}=await i.next();if(s){c(),d.close();return}let l=u.byteLength;if(r){let m=a+=l;r(m)}d.enqueue(new Uint8Array(u))}catch(s){throw c(s),s}},cancel(d){return c(d),i.return()}},{highWaterMark:2})};var qwy=64*1024,{isFunction:BEs}=Yf,esC=(({Request:e,Response:t})=>({Request:e,Response:t}))(Yf.global),{ReadableStream:Rwy,TextEncoder:Nwy}=Yf.global,Fwy=(e,...t)=>{try{return!!e(...t)}catch{return!1}},tsC=e=>{e=Yf.merge.call({skipUndefined:!0},esC,e);let{fetch:t,Request:r,Response:n}=e,i=t?BEs(t):typeof fetch=="function",a=BEs(r),o=BEs(n);if(!i)return!1;let c=i&&BEs(Rwy),d=i&&(typeof Nwy=="function"?(P=>C=>P.encode(C))(new Nwy):async P=>new Uint8Array(await new r(P).arrayBuffer())),s=a&&c&&Fwy(()=>{let P=!1,C=new r(V2.origin,{body:new Rwy,method:"POST",get duplex(){return P=!0,"half"}}).headers.has("Content-Type");return P&&!C}),u=o&&c&&Fwy(()=>Yf.isReadableStream(new n("").body)),l={stream:u&&(P=>P.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(P=>{!l[P]&&(l[P]=(C,M)=>{let T=C&&C[P];if(T)return T.call(C);throw new Dm(`Response type '${P}' is not supported`,Dm.ERR_NOT_SUPPORT,M)})});let m=async P=>{if(P==null)return 0;if(Yf.isBlob(P))return P.size;if(Yf.isSpecCompliantForm(P))return(await new r(V2.origin,{method:"POST",body:P}).arrayBuffer()).byteLength;if(Yf.isArrayBufferView(P)||Yf.isArrayBuffer(P))return P.byteLength;if(Yf.isURLSearchParams(P)&&(P=P+""),Yf.isString(P))return(await d(P)).byteLength},A=async(P,C)=>{let M=Yf.toFiniteNumber(P.getContentLength());return M??m(C)};return async P=>{let{url:C,method:M,data:T,signal:z,cancelToken:U,timeout:R,onDownloadProgress:V,onUploadProgress:$,responseType:re,headers:Y,withCredentials:te="same-origin",fetchOptions:ne}=MEs(P),Oe=t||fetch;re=re?(re+"").toLowerCase():"text";let ge=Twy([z,U&&U.toAbortSignal()],R),ve=null,be=ge&&ge.unsubscribe&&(()=>{ge.unsubscribe()}),Me;try{if($&&s&&M!=="get"&&M!=="head"&&(Me=await A(Y,T))!==0){let De=new r(C,{method:"POST",body:T,duplex:"half"}),Qt;if(Yf.isFormData(T)&&(Qt=De.headers.get("content-type"))&&Y.setContentType(Qt),De.body){let[Xe,Yt]=yka(Me,AAi(vka($)));T=pgf(De.body,qwy,Xe,Yt)}}Yf.isString(te)||(te=te?"include":"omit");let Be=a&&"credentials"in r.prototype,Se={...ne,signal:ge,method:M.toUpperCase(),headers:Y.normalize().toJSON(),body:T,duplex:"half",credentials:Be?te:void 0};ve=a&&new r(C,Se);let St=await(a?Oe(ve,ne):Oe(C,Se)),yt=u&&(re==="stream"||re==="response");if(u&&(V||yt&&be)){let De={};["status","statusText","headers"].forEach(Mt=>{De[Mt]=St[Mt]});let Qt=Yf.toFiniteNumber(St.headers.get("content-length")),[Xe,Yt]=V&&yka(Qt,AAi(vka(V),!0))||[];St=new n(pgf(St.body,qwy,Xe,()=>{Yt&&Yt(),be&&be()}),De)}re=re||"text";let Ne=await l[Yf.findKey(l,re)||"text"](St,P);return!yt&&be&&be(),await new Promise((De,Qt)=>{S9r(De,Qt,{data:Ne,headers:j$.from(St.headers),status:St.status,statusText:St.statusText,config:P,request:ve})})}catch(Be){throw be&&be(),Be&&Be.name==="TypeError"&&/Load failed|fetch/i.test(Be.message)?Object.assign(new Dm("Network Error",Dm.ERR_NETWORK,P,ve),{cause:Be.cause||Be}):Dm.from(Be,Be&&Be.code,P,ve)}}},rsC=new Map,_gf=e=>{let t=e?e.env:{},{fetch:r,Request:n,Response:i}=t,a=[n,i,r],o=a.length,c=o,d,s,u=rsC;for(;c--;)d=a[c],s=u.get(d),s===void 0&&u.set(d,s=c?new Map:tsC(t)),u=s;return s},JT9=_gf();var hgf={http:Dwy,xhr:Bwy,fetch:{get:_gf}};Yf.forEach(hgf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var xwy=e=>`- ${e}`,isC=e=>Yf.isFunction(e)||e===null||e===!1,TEs={getAdapter:(e,t)=>{e=Yf.isArray(e)?e:[e];let{length:r}=e,n,i,a={};for(let o=0;o<r;o++){n=e[o];let c;if(i=n,!isC(n)&&(i=hgf[(c=String(n)).toLowerCase()],i===void 0))throw new Dm(`Unknown adapter '${c}'`);if(i&&(Yf.isFunction(i)||(i=i.get(t))))break;a[c||"#"+o]=i}if(!i){let o=Object.entries(a).map(([d,s])=>`adapter ${d} `+(s===!1?"is not supported by the environment":"is not available in the build")),c=r?o.length>1?`since :
|
|
@@ -2402,7 +2402,7 @@ ${R}${z}${V}${ono}`});function YRs({message:e,error:t,logger:r,logLevel:n=K1.Err
|
|
|
2402
2402
|
Run ${od.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
|
|
2403
2403
|
Run ${od.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),gka(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function ABf({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!BWy(e))return;let i=t??"",a=e.filter(c=>c.isUpgradeAvailable);r!=null&&(a=a.slice(0,r+1));let o=a.sort((c,d)=>c.generatorName.localeCompare(d.generatorName)||c.currentVersion.localeCompare(d.currentVersion));for(let c of o)i+=`
|
|
2404
2404
|
${await HLC(c.generatorName)} (${c.apiName!=null?"API: "+c.apiName+", ":""}Group: ${c.generatorGroup}) `+od.dim(c.currentVersion)+od.reset(" \u2192 ")+od.green(c.latestVersion);return i+=`
|
|
2405
|
-
`,n?gka(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function HLC(e){let r=await new MWy.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 GLC({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let m=hzi(u.name,l),A=await gLr({generatorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let o={type:"multiApi",versions:{}};return await qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let l=hzi(s.name,u),m=await gLr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:u});m!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:m})},generatorFilter:r,groupFilter:n}),o}async function qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await RTr({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let d of c.groups)if(!(i!=null&&d.groupName!==i))for(let s of d.generators)n!=null&&s.name!==n||await r(a.workspaceName,d.groupName,s,o)}})}))}function RWy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${i} has an upgrade available...`);let d=a3e(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:o,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function eNs({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let o=[];if(e!=null){let c=await GLC({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...RWy(s,d,t.logger));else o.push(...RWy(c.versions,void 0,t.logger))}return o}var FXo=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${i} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var lno=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var PBf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)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(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),NWy=typeof globalThis.AbortController=="function",FWy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xWy=typeof globalThis.ReadableStream=="function",zWy=typeof globalThis.FormData=="function",tNs=["get","post","put","patch","head","delete"],JLC=()=>{};JLC();var QWy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},rNs=2147483647,LWy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,nNs=Symbol("stop"),UWy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},VWy={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 KLC=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=LWy,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},WWy=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),n){i+=n.byteLength;let c=t===0?0:i/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=a},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},HWy=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(WWy(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},GWy=(e,t,r)=>{if(!e.body)return e;let n=KLC(r??e.body);return new Request(e,{duplex:"half",body:WWy(e.body,n,t)})};var fno=e=>e!==null&&typeof e=="object";var xXo=(...e)=>{for(let t of e)if((!fno(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return EBf({},...e)},wBf=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function iNs(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:EBf(e[r]??[],t[r]??[])}var jBf=(e={},t={})=>({beforeRequest:iNs(e,t,"beforeRequest"),beforeRetry:iNs(e,t,"beforeRetry"),afterResponse:iNs(e,t,"afterResponse"),beforeError:iNs(e,t,"beforeError")}),EBf=(...e)=>{let t={},r={},n={};for(let i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(fno(i)){for(let[a,o]of Object.entries(i))fno(o)&&a in t&&(o=EBf(t[a],o)),t={...t,[a]:o};fno(i.hooks)&&(n=jBf(n,i.hooks),t.hooks=n),fno(i.headers)&&(r=wBf(r,i.headers),t.headers=r)}return t};var KWy=e=>tNs.includes(e)?e.toUpperCase():e,$LC=["get","put","head","delete","options","trace"],YLC=[408,413,429,500,502,503,504],XLC=[413,429,503],JWy={limit:2,methods:$LC,statusCodes:YLC,afterStatusCodes:XLC,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},$Wy=(e={})=>{if(typeof e=="number")return{...JWy,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{...JWy,...e}};async function SBf(e,t,r,n){return new Promise((i,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new lno(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function DBf(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}var YWy=(e,t)=>{let r={};for(let n in t)!(n in VWy)&&!(n in UWy)&&!(n in e)&&(r[n]=t[n]);return r},XWy=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var zXo=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rNs)throw new RangeError(`The \`timeout\` option cannot be greater than ${rNs}`);await Promise.resolve();let c=await n._fetch();for(let d of n._options.hooks.afterResponse){let s=await d(n.request,n._options,n._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let d=new FXo(c,n.request,n._options);for(let s of n._options.hooks.beforeError)d=await s(d);throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xWy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return HWy(c.clone(),n._options.onDownloadProgress)}return c},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{let c=n._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),n.request.bodyUsed||d.push(n.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(QWy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:wBf(this._input.headers,r.headers),hooks:jBf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:KWy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:$Wy(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(NWy&&FWy){let n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(PBf&&(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),XWy(this._options.searchParams)){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(zWy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!PBf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=GWy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof lno)throw t;if(t instanceof FXo){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let n=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(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let a=this._options.retry.maxRetryAfter??i;return i<a?i: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 n=Math.min(this._calculateRetryDelay(r),rNs);if(this._retryCount<1)throw r;await DBf(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===nNs)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=YWy(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):SBf(this._originalRequest,t,this.abortController,this._options)}};var CBf=e=>{let t=(r,n)=>zXo.create(r,xXo(e,n));for(let r of tNs)t[r]=(n,i)=>zXo.create(n,xXo(e,i,{method:r}));return t.create=r=>CBf(xXo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),CBf(xXo(e,r))),t.stop=nNs,t},ZLC=CBf(),ZWy=ZLC;var OHy=fa(mHy(),1);function qBf(e){let t=(0,OHy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var hGy=fa(_Gy(),1),yGy=fa(v5r(),1),JBf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},KBf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function $Bf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??qBf(i),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,hGy.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,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await ZWy(o,{headers:d,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new JBf(e):l}if(t.allVersions)return s;let u=new KBf(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(n&&!l)for(let[A,P]of Object.entries(s.versions))P.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=yGy.default.maxSatisfying(A,r),!r)throw u}let{time:m}=s;if(s=s.versions[r],s.time=m,!s)throw u}return s}async function HXo(e,t){let{version:r}=await $Bf(e.toLowerCase(),t);return r}async function t7i({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:HXo(e.packageName,{version:t?"prerelease":"latest"})}var vGy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],yNs=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=K1.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new kRs(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(i==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.90.1"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${od.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new sie}failWithoutThrowing(t,r){this.didSucceed=!1,YRs({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await cka()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await TWy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
2405
|
+
`,n?gka(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function HLC(e){let r=await new MWy.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 GLC({cliContext:e,project:{apiWorkspaces:t},generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){if(t.length===1){let c={type:"singleApi",versions:{}};return await qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(d,s,u,l)=>{c.versions[s]==null&&(c.versions[s]={});let m=hzi(u.name,l),A=await gLr({generatorName:m,cliVersion:e.environment.packageVersion,currentGeneratorVersion:u.version,channel:i,includeMajor:a,context:l});A!=null&&(c.versions[s][u.name]={previousVersion:u.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),c}let o={type:"multiApi",versions:{}};return await qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:async(c,d,s,u)=>{if(c==null)return;o.versions[c]==null&&(o.versions[c]={}),o.versions[c][d]==null&&(o.versions[c][d]={});let l=hzi(s.name,u),m=await gLr({generatorName:l,cliVersion:e.environment.packageVersion,currentGeneratorVersion:s.version,channel:i,includeMajor:a,context:u});m!=null&&(o.versions[c][d][s.name]={previousVersion:s.version,latestVersion:m})},generatorFilter:r,groupFilter:n}),o}async function qWy({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async a=>{await e.runTaskForWorkspace(a,async o=>{let c=await RTr({absolutePathToWorkspace:a.absoluteFilePath,context:o});if(!(c==null||c.groups==null)){for(let d of c.groups)if(!(i!=null&&d.groupName!==i))for(let s of d.generators)n!=null&&s.name!==n||await r(a.workspaceName,d.groupName,s,o)}})}))}function RWy(e,t,r){let n=[];for(let[i,a]of Object.entries(e))for(let[o,c]of Object.entries(a)){r.debug(`Checking if ${o} in group ${i} has an upgrade available...`);let d=a3e(c.latestVersion,c.previousVersion);r.debug(`Latest version: ${c.latestVersion}. `+(d?"Upgrade available.":"No upgrade available.")),n.push({generatorName:o,generatorGroup:i,apiName:t,isUpgradeAvailable:d,currentVersion:c.previousVersion,latestVersion:c.latestVersion})}return n}async function eNs({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a}){let o=[];if(e!=null){let c=await GLC({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:a});if(c.type==="multiApi")for(let[d,s]of Object.entries(c.versions))o.push(...RWy(s,d,t.logger));else o.push(...RWy(c.versions,void 0,t.logger))}return o}var FXo=class extends Error{response;request;options;constructor(t,r,n){let i=t.status||t.status===0?t.status:"",a=t.statusText??"",o=`${i} ${a}`.trim(),c=o?`status code ${o}`:"an unknown error";super(`Request failed with ${c}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}};var lno=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};var PBf=(()=>{let e=!1,t=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)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(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),NWy=typeof globalThis.AbortController=="function",FWy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",xWy=typeof globalThis.ReadableStream=="function",zWy=typeof globalThis.FormData=="function",tNs=["get","post","put","patch","head","delete"],JLC=()=>{};JLC();var QWy={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},rNs=2147483647,LWy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,nNs=Symbol("stop"),UWy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},VWy={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 KLC=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,n]of e)t+=LWy,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{let t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},WWy=(e,t,r)=>{let n,i=0;return e.pipeThrough(new TransformStream({transform(a,o){if(o.enqueue(a),n){i+=n.byteLength;let c=t===0?0:i/t;c>=1&&(c=1-Number.EPSILON),r?.({percent:c,totalBytes:Math.max(t,i),transferredBytes:i},n)}n=a},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,i),transferredBytes:i},n))}}))},HWy=(e,t)=>{if(!e.body)return e;if(e.status===204)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});let r=Number(e.headers.get("content-length"))||0;return new Response(WWy(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})},GWy=(e,t,r)=>{if(!e.body)return e;let n=KLC(r??e.body);return new Request(e,{duplex:"half",body:WWy(e.body,n,t)})};var fno=e=>e!==null&&typeof e=="object";var xXo=(...e)=>{for(let t of e)if((!fno(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return EBf({},...e)},wBf=(e={},t={})=>{let r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(let[a,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function iNs(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:EBf(e[r]??[],t[r]??[])}var jBf=(e={},t={})=>({beforeRequest:iNs(e,t,"beforeRequest"),beforeRetry:iNs(e,t,"beforeRetry"),afterResponse:iNs(e,t,"afterResponse"),beforeError:iNs(e,t,"beforeError")}),EBf=(...e)=>{let t={},r={},n={};for(let i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(fno(i)){for(let[a,o]of Object.entries(i))fno(o)&&a in t&&(o=EBf(t[a],o)),t={...t,[a]:o};fno(i.hooks)&&(n=jBf(n,i.hooks),t.hooks=n),fno(i.headers)&&(r=wBf(r,i.headers),t.headers=r)}return t};var KWy=e=>tNs.includes(e)?e.toUpperCase():e,$LC=["get","put","head","delete","options","trace"],YLC=[408,413,429,500,502,503,504],XLC=[413,429,503],JWy={limit:2,methods:$LC,statusCodes:YLC,afterStatusCodes:XLC,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},$Wy=(e={})=>{if(typeof e=="number")return{...JWy,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{...JWy,...e}};async function SBf(e,t,r,n){return new Promise((i,a)=>{let o=setTimeout(()=>{r&&r.abort(),a(new lno(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(()=>{clearTimeout(o)})})}async function DBf(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(t.reason)}let a=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}var YWy=(e,t)=>{let r={};for(let n in t)!(n in VWy)&&!(n in UWy)&&!(n in e)&&(r[n]=t[n]);return r},XWy=e=>e===void 0?!1:Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0:typeof e=="object"?Object.keys(e).length>0:typeof e=="string"?e.trim().length>0:!!e;var zXo=class e{static create(t,r){let n=new e(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rNs)throw new RangeError(`The \`timeout\` option cannot be greater than ${rNs}`);await Promise.resolve();let c=await n._fetch();for(let d of n._options.hooks.afterResponse){let s=await d(n.request,n._options,n._decorateResponse(c.clone()));s instanceof globalThis.Response&&(c=s)}if(n._decorateResponse(c),!c.ok&&n._options.throwHttpErrors){let d=new FXo(c,n.request,n._options);for(let s of n._options.hooks.beforeError)d=await s(d);throw d}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!xWy)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return HWy(c.clone(),n._options.onDownloadProgress)}return c},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{let c=n._originalRequest,d=[];c&&!c.bodyUsed&&d.push(c.body?.cancel()),n.request.bodyUsed||d.push(n.request.body?.cancel()),await Promise.all(d)});for(let[c,d]of Object.entries(QWy))c==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(o[c]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||d);let s=await o;if(c==="json"){if(s.status===204)return"";let u=await s.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return s[c]()});return o}static#e(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof URLSearchParams)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0)):t}request;abortController;_retryCount=0;_input;_options;_originalRequest;constructor(t,r={}){if(this._input=t,this._options={...r,headers:wBf(this._input.headers,r.headers),hooks:jBf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:KWy(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:$Wy(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(NWy&&FWy){let n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(PBf&&(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),XWy(this._options.searchParams)){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(e.#e(this._options.searchParams)).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(zWy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!PBf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=GWy(this.request,this._options.onUploadProgress,this._options.body))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof lno)throw t;if(t instanceof FXo){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;let n=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(n&&this._options.retry.afterStatusCodes.includes(t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let a=this._options.retry.maxRetryAfter??i;return i<a?i: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 n=Math.min(this._calculateRetryDelay(r),rNs);if(this._retryCount<1)throw r;await DBf(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===nNs)return;return this._retry(t)}}async _fetch(){for(let r of this._options.hooks.beforeRequest){let n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}let t=YWy(this.request,this._options);return this._originalRequest=this.request,this.request=this._originalRequest.clone(),this._options.timeout===!1?this._options.fetch(this._originalRequest,t):SBf(this._originalRequest,t,this.abortController,this._options)}};var CBf=e=>{let t=(r,n)=>zXo.create(r,xXo(e,n));for(let r of tNs)t[r]=(n,i)=>zXo.create(n,xXo(e,i,{method:r}));return t.create=r=>CBf(xXo(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),CBf(xXo(e,r))),t.stop=nNs,t},ZLC=CBf(),ZWy=ZLC;var OHy=fa(mHy(),1);function qBf(e){let t=(0,OHy.default)("npm",{registry:"https://registry.npmjs.org/"}),r=t[`${e}:registry`]||t.config_registry||t.registry;return r.slice(-1)==="/"?r:`${r}/`}var hGy=fa(_Gy(),1),yGy=fa(v5r(),1),JBf=class extends Error{constructor(t){super(`Package \`${t}\` could not be found`),this.name="PackageNotFoundError"}},KBf=class extends Error{constructor(t,r){super(`Version \`${r}\` for package \`${t}\` could not be found`),this.name="VersionNotFoundError"}};async function $Bf(e,t={}){let{version:r="latest"}=t,{omitDeprecated:n=!0}=t,i=e.split("/")[0],a=t.registryUrl??qBf(i),o=new URL(encodeURIComponent(e).replace(/^%40/,"@"),a),c=(0,hGy.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,c&&(d.authorization=`${c.type} ${c.token}`);let s;try{s=await ZWy(o,{headers:d,keepalive:!0}).json()}catch(l){throw l?.response?.status===404?new JBf(e):l}if(t.allVersions)return s;let u=new KBf(e,r);if(s["dist-tags"][r]){let{time:l}=s;s=s.versions[s["dist-tags"][r]],s.time=l}else if(r){let l=!!s.versions[r];if(n&&!l)for(let[A,P]of Object.entries(s.versions))P.deprecated&&delete s.versions[A];if(!l){let A=Object.keys(s.versions);if(r=yGy.default.maxSatisfying(A,r),!r)throw u}let{time:m}=s;if(s=s.versions[r],s.time=m,!s)throw u}return s}async function HXo(e,t){let{version:r}=await $Bf(e.toLowerCase(),t);return r}async function t7i({cliEnvironment:e,includePreReleases:t=!1}){return e.packageName!=="fern-api"?e.packageVersion:HXo(e.packageName,{version:t?"prerelease":"latest"})}var vGy=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],yNs=class{environment;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=K1.Info;isLocal;constructor(t,r,{isLocal:n}){this.ttyAwareLogger=new kRs(t,r),this.isLocal=n??!1;let i=this.getPackageName(),a=this.getPackageVersion(),o=this.getCliName();(i==null||a==null||o==null)&&this.exitProgram(),this.environment={packageName:i,packageVersion:a,cliName:o}}getPackageName(){return"fern-api"}getPackageVersion(){return"0.91.0"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${od.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r){throw this.failWithoutThrowing(t,r),new sie}failWithoutThrowing(t,r){this.didSucceed=!1,YRs({message:t,error:r,logger:this.logger})}async exit({code:t}={}){(!this._suppressUpgradeMessage||!this.isLocal)&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish(),await(await cka()).flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable(),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await TWy({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
2406
2406
|
`)||(r+=`
|
|
2407
2407
|
`),this.stderr.info(r))}catch{}}async exitIfFailed(){this.didSucceed||await this.exit()}exitProgram({code:t}={}){process.exit(t??(this.didSucceed?0:1))}longestWorkspaceName;registerWorkspaces(t){let r=C$l(t.map(n=>n.type==="docs"?"docs":n.workspaceName??"api"),n=>n.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 MXo(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 n=this.addTaskWithInit(t).start(),i;try{i=await r(n)}catch(a){throw a.message.includes("globalThis")?(n.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE),n.failWithoutThrowing()):n.failWithoutThrowing(void 0,a),new sie}finally{n.finish()}return i}async instrumentPostHogEvent(t){this.isLocal||(await cka()).sendEvent(t)}logger=q5r((t,...r)=>this.log(t,...r));stderr=q5r((t,...r)=>this.logStderr(t,...r));constructTaskInitForWorkspace(t){let r=bGy(t.type==="docs"?"docs":t.workspaceName??"api"),n=1+(this.longestWorkspaceName!=null?bGy(this.longestWorkspaceName):r).length,i=r.padEnd(n),a=vGy[this.numTasks++%vGy.length],o=od.hex(a)(i);return{...this.constructTaskInit(),logPrefix:o}}constructTaskInit(){return{logImmediately:t=>this.logImmediately(t),takeOverTerminal:t=>this.ttyAwareLogger.takeOverTerminal(t),onResult:t=>{t===bV.Failure&&(this.didSucceed=!1)},instrumentPostHogEvent:async t=>{await this.instrumentPostHogEvent(t)},shouldBufferLogs:!1}}log(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}])}logStderr(t,...r){this.logImmediately([{parts:r,level:t,time:new Date}],{stderr:!0})}logImmediately(t,{stderr:r=!1}={}){let n=t.filter(i=>C3i.indexOf(i.level)>=C3i.indexOf(this.logLevel));this.ttyAwareLogger.log(n,{includeDebugInfo:this.logLevel===K1.Debug,stderr:r})}_suppressUpgradeMessage=!1;suppressUpgradeMessage(){this._suppressUpgradeMessage=!0}_isUpgradeAvailable;async isUpgradeAvailable({includePreReleases:t=!1}={}){if(this._isUpgradeAvailable==null){this.logger.debug(`Checking if ${this.environment.packageName} upgrade is available...`);let r=await t7i({cliEnvironment:this.environment,includePreReleases:t}),n=a3e(r,this.environment.packageVersion);this.logger.debug(`Latest version: ${r}. `+(n?"Upgrade available.":"No upgrade available."));let i={isUpgradeAvailable:n,latestVersion:r},a=await eNs({project:this.project,cliContext:this});this._isUpgradeAvailable={cliUpgradeInfo:i,generatorUpgradeInfo:a}}return this._isUpgradeAvailable}async confirmPrompt(t,r=!1){try{return await fBf({message:t,choices:[{name:"No",value:!1},{name:"Yes",value:!0}],default:r,theme:{prefix:od.yellow("?"),style:{answer:i=>od.cyan(i),message:i=>od.bold(i),highlight:i=>od.cyan(i)}}})}catch(n){throw n?.name==="ExitPromptError"?(this.logger.info(`
|
|
2408
2408
|
Cancelled by user.`),new sie):n}}async getInput(t){return await uBf({message:t.message,default:t.default})}};function bGy(e){return`[${e}]:`}var Dqr=class{generatorsConfiguration;workspaceName;cliVersion;absoluteFilePath;changelog;constructor({generatorsConfiguration:t,workspaceName:r,cliVersion:n,absoluteFilePath:i,changelog:a}){this.generatorsConfiguration=t,this.workspaceName=r,this.cliVersion=n,this.absoluteFilePath=i,this.changelog=a}};var ait=class extends Dqr{definition;sources;type="fern";constructor({definition:t,sources:r,...n}){super(n),this.definition=t,this.sources=r??[]}async getDefinition(){return this.definition}async toFernWorkspace(){return this}getSources(){return this.sources}getAbsoluteFilePaths(){return[this.absoluteFilePath]}};var hyt={enableUniqueErrorsPerEndpoint:!1,detectGlobalHeaders:!0,objectQueryParameters:!1,respectReadonlySchemas:!1,respectNullableSchemas:!1,onlyIncludeReferencedSchemas:!1,inlinePathParameters:!1,useBytesForBinaryResponse:!1,respectForwardCompatibleEnums:!1,wrapReferencesToNullableInOptional:!0,coerceOptionalSchemasToNullable:!0,groupEnvironmentsByHost:!1};function GXo({options:e,overrides:t}){return{enableUniqueErrorsPerEndpoint:t?.enableUniqueErrorsPerEndpoint??e?.enableUniqueErrorsPerEndpoint??hyt.enableUniqueErrorsPerEndpoint,detectGlobalHeaders:t?.detectGlobalHeaders??e?.detectGlobalHeaders??hyt.detectGlobalHeaders,objectQueryParameters:t?.objectQueryParameters??e?.objectQueryParameters??hyt.objectQueryParameters,respectReadonlySchemas:t?.respectReadonlySchemas??e?.respectReadonlySchemas??hyt.respectReadonlySchemas,respectNullableSchemas:t?.respectNullableSchemas??e?.respectNullableSchemas??hyt.respectNullableSchemas,onlyIncludeReferencedSchemas:t?.onlyIncludeReferencedSchemas??e?.onlyIncludeReferencedSchemas??hyt.onlyIncludeReferencedSchemas,inlinePathParameters:t?.inlinePathParameters??e?.inlinePathParameters??hyt.inlinePathParameters,useBytesForBinaryResponse:t?.useBytesForBinaryResponse??e?.useBytesForBinaryResponse??hyt.useBytesForBinaryResponse,respectForwardCompatibleEnums:t?.respectForwardCompatibleEnums??e?.respectForwardCompatibleEnums??hyt.respectForwardCompatibleEnums,wrapReferencesToNullableInOptional:t?.wrapReferencesToNullableInOptional??e?.wrapReferencesToNullableInOptional??hyt.wrapReferencesToNullableInOptional,coerceOptionalSchemasToNullable:t?.coerceOptionalSchemasToNullable??e?.coerceOptionalSchemasToNullable??hyt.coerceOptionalSchemasToNullable,groupEnvironmentsByHost:t?.groupEnvironmentsByHost??e?.groupEnvironmentsByHost??hyt.groupEnvironmentsByHost}}var gwe={openapi:e=>({...e,type:"openapi",_visit:function(t){return gwe._visit(this,t)}}),protobuf:e=>({...e,type:"protobuf",_visit:function(t){return gwe._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 bno={protobuf:e=>({...e,type:"protobuf",_visit:function(t){return bno._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"protobuf":return t.protobuf(e);default:return t._other(e)}}};var Hde={basic:e=>({...e,type:"basic",_visit:function(t){return Hde._visit(this,t)}}),bearer:e=>({...e,type:"bearer",_visit:function(t){return Hde._visit(this,t)}}),header:e=>({...e,type:"header",_visit:function(t){return Hde._visit(this,t)}}),query:e=>({...e,type:"query",_visit:function(t){return Hde._visit(this,t)}}),oauth:e=>({...e,type:"oauth",_visit:function(t){return Hde._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 wS={primitive:e=>({value:e,type:"primitive",_visit:function(t){return wS._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return wS._visit(this,t)}}),array:e=>({value:e,type:"array",_visit:function(t){return wS._visit(this,t)}}),map:e=>({value:e,type:"map",_visit:function(t){return wS._visit(this,t)}}),enum:e=>({value:e,type:"enum",_visit:function(t){return wS._visit(this,t)}}),literal:e=>({value:e,type:"literal",_visit:function(t){return wS._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return wS._visit(this,t)}}),null:e=>({...e,type:"null",_visit:function(t){return wS._visit(this,t)}}),unknown:e=>({value:e,type:"unknown",_visit:function(t){return wS._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"null":return t.null(e);case"unknown":return t.unknown(e.value);default:return t._other(e)}}};var wO={int:e=>({value:e,type:"int",_visit:function(t){return wO._visit(this,t)}}),int64:e=>({value:e,type:"int64",_visit:function(t){return wO._visit(this,t)}}),uint:e=>({value:e,type:"uint",_visit:function(t){return wO._visit(this,t)}}),uint64:e=>({value:e,type:"uint64",_visit:function(t){return wO._visit(this,t)}}),float:e=>({value:e,type:"float",_visit:function(t){return wO._visit(this,t)}}),double:e=>({value:e,type:"double",_visit:function(t){return wO._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return wO._visit(this,t)}}),datetime:e=>({value:e,type:"datetime",_visit:function(t){return wO._visit(this,t)}}),date:e=>({value:e,type:"date",_visit:function(t){return wO._visit(this,t)}}),base64:e=>({value:e,type:"base64",_visit:function(t){return wO._visit(this,t)}}),boolean:e=>({value:e,type:"boolean",_visit:function(t){return wO._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 r7i={boolean:e=>({value:e,type:"boolean",_visit:function(t){return r7i._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return r7i._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 n7i={discriminated:e=>({value:e,type:"discriminated",_visit:function(t){return n7i._visit(this,t)}}),undiscriminated:e=>({value:e,type:"undiscriminated",_visit:function(t){return n7i._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 vNs={};ff(vNs,{Availability:()=>Gde,CustomCodeSample:()=>OVr,EndpointExample:()=>yyt,EndpointResponseExample:()=>vyt,HttpMethod:()=>Kde,LiteralSchemaValue:()=>FV,MultipartRequestPropertyEncoding:()=>ZBf,MultipartSchema:()=>AVr,OneOfSchema:()=>PVr,Pagination:()=>oit,PrimitiveSchemaValue:()=>Oq,Request:()=>Cqr,Response:()=>Wbe,RetriesConfiguration:()=>JXo,Schema:()=>kj,SupportedSdkLanguage:()=>Jde,WebhookHttpMethod:()=>XBf,WebsocketMessageOrigin:()=>YBf});var YBf={Client:"client",Server:"server",_visit:(e,t)=>{switch(e){case YBf.Client:return t.client();case YBf.Server:return t.server();default:return t._other()}}};var XBf={Get:"GET",Post:"POST",_visit:(e,t)=>{switch(e){case XBf.Get:return t.get();case XBf.Post:return t.post();default:return t._other()}}};var Gde={GenerallyAvailable:"GenerallyAvailable",Beta:"Beta",Deprecated:"Deprecated",_visit:(e,t)=>{switch(e){case Gde.GenerallyAvailable:return t.generallyAvailable();case Gde.Beta:return t.beta();case Gde.Deprecated:return t.deprecated();default:return t._other()}}};var JXo={disabled:e=>({value:e,type:"disabled",_visit:function(t){return JXo._visit(this,t)}}),_visit:(e,t)=>{switch(e.type){case"disabled":return t.disabled(e.value);default:return t._other(e)}}};var oit={cursor:e=>({...e,type:"cursor",_visit:function(t){return oit._visit(this,t)}}),offset:e=>({...e,type:"offset",_visit:function(t){return oit._visit(this,t)}}),custom:e=>({...e,type:"custom",_visit:function(t){return oit._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 OVr={language:e=>({...e,type:"language",_visit:function(t){return OVr._visit(this,t)}}),sdk:e=>({...e,type:"sdk",_visit:function(t){return OVr._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 Jde={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 Jde.Curl:return t.curl();case Jde.Python:return t.python();case Jde.Javascript:return t.javascript();case Jde.Typescript:return t.typescript();case Jde.Go:return t.go();case Jde.Ruby:return t.ruby();case Jde.Csharp:return t.csharp();case Jde.Java:return t.java();case Jde.Js:return t.js();case Jde.Node:return t.node();case Jde.Ts:return t.ts();case Jde.Nodets:return t.nodets();case Jde.Golang:return t.golang();case Jde.Dotnet:return t.dotnet();case Jde.Jvm:return t.jvm();default:return t._other()}}};var yyt={unknown:e=>({value:e,type:"unknown",_visit:function(t){return yyt._visit(this,t)}}),full:e=>({...e,type:"full",_visit:function(t){return yyt._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 vyt={withStreaming:e=>({...e,type:"withStreaming",_visit:function(t){return vyt._visit(this,t)}}),withoutStreaming:e=>({value:e,type:"withoutStreaming",_visit:function(t){return vyt._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 Kde={Get:"GET",Post:"POST",Put:"PUT",Patch:"PATCH",Delete:"DELETE",Head:"HEAD",Options:"OPTIONS",Trace:"TRACE",_visit:(e,t)=>{switch(e){case Kde.Get:return t.get();case Kde.Post:return t.post();case Kde.Put:return t.put();case Kde.Patch:return t.patch();case Kde.Delete:return t.delete();case Kde.Head:return t.head();case Kde.Options:return t.options();case Kde.Trace:return t.trace();default:return t._other()}}};var Cqr={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return Cqr._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return Cqr._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return Cqr._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return Cqr._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);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var ZBf={Json:"json",Form:"form",_visit:(e,t)=>{switch(e){case ZBf.Json:return t.json();case ZBf.Form:return t.form();default:return t._other()}}};var AVr={file:e=>({...e,type:"file",_visit:function(t){return AVr._visit(this,t)}}),json:e=>({value:e,type:"json",_visit:function(t){return AVr._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 Wbe={file:e=>({...e,type:"file",_visit:function(t){return Wbe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return Wbe._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return Wbe._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return Wbe._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return Wbe._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return Wbe._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return Wbe._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"bytes":return t.bytes(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 kj={primitive:e=>({...e,type:"primitive",_visit:function(t){return kj._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return kj._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return kj._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return kj._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return kj._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return kj._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return kj._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return kj._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return kj._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return kj._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return kj._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 Oq={int:e=>({...e,type:"int",_visit:function(t){return Oq._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return Oq._visit(this,t)}}),uint:()=>({type:"uint",_visit:function(e){return Oq._visit(this,e)}}),uint64:()=>({type:"uint64",_visit:function(e){return Oq._visit(this,e)}}),float:()=>({type:"float",_visit:function(e){return Oq._visit(this,e)}}),double:e=>({...e,type:"double",_visit:function(t){return Oq._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return Oq._visit(this,t)}}),datetime:()=>({type:"datetime",_visit:function(e){return Oq._visit(this,e)}}),date:()=>({type:"date",_visit:function(e){return Oq._visit(this,e)}}),base64:()=>({type:"base64",_visit:function(e){return Oq._visit(this,e)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return Oq._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 FV={boolean:e=>({value:e,type:"boolean",_visit:function(t){return FV._visit(this,t)}}),string:e=>({value:e,type:"string",_visit:function(t){return FV._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 PVr={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return PVr._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return PVr._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 lIe={octetStream:e=>({...e,type:"octetStream",_visit:function(t){return lIe._visit(this,t)}}),multipart:e=>({...e,type:"multipart",_visit:function(t){return lIe._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return lIe._visit(this,t)}}),formUrlEncoded:e=>({...e,type:"formUrlEncoded",_visit:function(t){return lIe._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);case"formUrlEncoded":return t.formUrlEncoded(e);default:return t._other(e)}}};var XL={file:e=>({...e,type:"file",_visit:function(t){return XL._visit(this,t)}}),json:e=>({...e,type:"json",_visit:function(t){return XL._visit(this,t)}}),text:e=>({...e,type:"text",_visit:function(t){return XL._visit(this,t)}}),bytes:e=>({...e,type:"bytes",_visit:function(t){return XL._visit(this,t)}}),streamingSse:e=>({...e,type:"streamingSse",_visit:function(t){return XL._visit(this,t)}}),streamingText:e=>({...e,type:"streamingText",_visit:function(t){return XL._visit(this,t)}}),streamingJson:e=>({...e,type:"streamingJson",_visit:function(t){return XL._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"bytes":return t.bytes(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 Oh={primitive:e=>({...e,type:"primitive",_visit:function(t){return Oh._visit(this,t)}}),object:e=>({...e,type:"object",_visit:function(t){return Oh._visit(this,t)}}),array:e=>({...e,type:"array",_visit:function(t){return Oh._visit(this,t)}}),map:e=>({...e,type:"map",_visit:function(t){return Oh._visit(this,t)}}),optional:e=>({...e,type:"optional",_visit:function(t){return Oh._visit(this,t)}}),enum:e=>({...e,type:"enum",_visit:function(t){return Oh._visit(this,t)}}),reference:e=>({...e,type:"reference",_visit:function(t){return Oh._visit(this,t)}}),literal:e=>({...e,type:"literal",_visit:function(t){return Oh._visit(this,t)}}),oneOf:e=>({value:e,type:"oneOf",_visit:function(t){return Oh._visit(this,t)}}),nullable:e=>({...e,type:"nullable",_visit:function(t){return Oh._visit(this,t)}}),unknown:e=>({...e,type:"unknown",_visit:function(t){return Oh._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 uit={discriminated:e=>({...e,type:"discriminated",_visit:function(t){return uit._visit(this,t)}}),undiscriminated:e=>({...e,type:"undiscriminated",_visit:function(t){return uit._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 U0={int:e=>({...e,type:"int",_visit:function(t){return U0._visit(this,t)}}),int64:e=>({...e,type:"int64",_visit:function(t){return U0._visit(this,t)}}),uint:e=>({...e,type:"uint",_visit:function(t){return U0._visit(this,t)}}),uint64:e=>({...e,type:"uint64",_visit:function(t){return U0._visit(this,t)}}),float:e=>({...e,type:"float",_visit:function(t){return U0._visit(this,t)}}),double:e=>({...e,type:"double",_visit:function(t){return U0._visit(this,t)}}),string:e=>({...e,type:"string",_visit:function(t){return U0._visit(this,t)}}),datetime:e=>({...e,type:"datetime",_visit:function(t){return U0._visit(this,t)}}),date:e=>({...e,type:"date",_visit:function(t){return U0._visit(this,t)}}),base64:e=>({...e,type:"base64",_visit:function(t){return U0._visit(this,t)}}),boolean:e=>({...e,type:"boolean",_visit:function(t){return U0._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 Mj={};ff(Mj,{AllOfPropertyConflict:()=>Wno,ArraySchema:()=>qFs,ArraySchemaWithExample:()=>fxs,Availability:()=>SNs,Base64WithExample:()=>oxs,BasicSecurityScheme:()=>CNs,BearerSecurityScheme:()=>INs,BooleanSchema:()=>DFs,BooleanWithExample:()=>uxs,BytesResponse:()=>qno,CasingOverrides:()=>TNs,CommonProperty:()=>UFs,CommonPropertyWithExample:()=>mxs,CursorPagination:()=>fFs,CustomCodeSample:()=>cFs,CustomCodeSampleLanguage:()=>oFs,CustomCodeSampleSdk:()=>sFs,CustomPagination:()=>pFs,DateWithExample:()=>axs,DatetimeWithExample:()=>ixs,DiscriminatedOneOfSchema:()=>QFs,DiscriminatedOneOfSchemaWithExample:()=>bxs,DoubleSchema:()=>EFs,DoubleWithExample:()=>rxs,Encoding:()=>ENs,Endpoint:()=>_Fs,EndpointExample:()=>xno,EndpointResponseExample:()=>aFs,EndpointSdkName:()=>EVr,EndpointSecurity:()=>Eno,EndpointWithExample:()=>KGy,EnumSchema:()=>Pno,EnumSchemaWithExample:()=>cxs,EnumValue:()=>o7i,ErrorExample:()=>eFs,FernExample:()=>rFs,FileResponse:()=>Bno,FileSchema:()=>GNs,FloatWithExample:()=>txs,FormUrlEncodedRequest:()=>XNs,FullEndpointExample:()=>lFs,FullExample:()=>g5,FullObjectExample:()=>LNs,FullOneOfExample:()=>VNs,GlobalHeader:()=>IFs,Header:()=>s7i,HeaderExample:()=>Fno,HeaderSecurityScheme:()=>MNs,HeaderWithExample:()=>f7i,HttpEndpointServer:()=>Rno,HttpError:()=>tFs,HttpErrorWithExample:()=>YFs,HttpMethod:()=>Sno,IdempotencyHeader:()=>MFs,Int64WithExample:()=>ZFs,IntSchema:()=>wFs,IntWithExample:()=>XFs,JsonRequest:()=>YNs,JsonRequestWithExample:()=>GFs,JsonResponse:()=>Tno,JsonResponseWithExample:()=>Jno,KeyValuePair:()=>UNs,LiteralExample:()=>zNs,LiteralSchema:()=>Vno,LiteralSchemaValue:()=>BFs,LongSchema:()=>jFs,MapSchema:()=>RFs,MapSchemaWithExample:()=>dxs,MultipartRequest:()=>Mno,MultipartRequestProperty:()=>$Ns,MultipartRequestPropertyEncoding:()=>KNs,MultipartSchema:()=>JNs,NamedFullExample:()=>gyt,Namespace:()=>qNs,NamespaceId:()=>xNs,NullExample:()=>QNs,NullableSchema:()=>FFs,NullableSchemaWithExample:()=>_xs,OauthSecurityScheme:()=>NNs,ObjectProperty:()=>zFs,ObjectPropertyConflictInfo:()=>Hno,ObjectPropertyWithExample:()=>vxs,ObjectSchema:()=>TFs,ObjectSchemaWithExample:()=>hxs,OctetStreamRequest:()=>Ino,OffsetPagination:()=>dFs,OneOfSchema:()=>xFs,OneOfSchemaWithExample:()=>yxs,OpenApiIntermediateRepresentation:()=>GGy,OpenApiSource:()=>ANs,OptionalSchema:()=>NFs,OptionalSchemaWithExample:()=>pxs,Pagination:()=>zno,ParseFormUrlEncodedRequest:()=>JFs,ParseMultipartRequest:()=>HFs,ParseOctetStreamRequest:()=>WFs,PathParameter:()=>Dno,PathParameterExample:()=>nFs,PathParameterWithExample:()=>VFs,PrimitiveExample:()=>jno,PrimitiveSchema:()=>l7i,PrimitiveSchemaValue:()=>CFs,PrimitiveSchemaValueWithExample:()=>sxs,PrimitiveSchemaWithExample:()=>Kno,PropertyKey:()=>wno,ProtobufEncoding:()=>jNs,ProtobufSource:()=>PNs,QueryParameter:()=>Cno,QueryParameterExample:()=>Nno,QueryParameterWithExample:()=>Gno,QuerySecurityScheme:()=>BNs,ReferencedSchema:()=>SVr,Request:()=>ZNs,RequestWithExample:()=>KFs,Response:()=>kNs,ResponseWithExample:()=>$Fs,RetriesConfiguration:()=>Qno,Schema:()=>SI,SchemaId:()=>fIe,SchemaWithExample:()=>J6,Schemas:()=>PFs,SdkGroup:()=>RNs,SdkGroupInfo:()=>WNs,SdkGroupName:()=>u7i,SecurityScheme:()=>FNs,SecuritySchemeId:()=>Ano,Server:()=>XXo,Source:()=>wNs,StatusCode:()=>wVr,StreamingResponseExample:()=>iFs,StringSchema:()=>SFs,StringSchemaWithExample:()=>nxs,SupportedSdkLanguage:()=>uFs,Tag:()=>DNs,TagId:()=>dIe,Tags:()=>HNs,TextResponse:()=>c7i,Uint64WithExample:()=>exs,UintWithExample:()=>kFs,UnDiscriminatedOneOfSchema:()=>LFs,UnDiscriminatedOneOfSchemaWithExample:()=>gxs,UnknownSchemaWithExample:()=>lxs,Webhook:()=>hFs,WebhookExampleCall:()=>Uno,WebhookHttpMethod:()=>Lno,WebhookWithExample:()=>$Gy,WebsocketChannel:()=>AFs,WebsocketHandshake:()=>yFs,WebsocketHandshakeWithExample:()=>JGy,WebsocketMessageExample:()=>mFs,WebsocketMessageOrigin:()=>vFs,WebsocketMessageSchema:()=>bFs,WebsocketServer:()=>gFs,WebsocketSessionExample:()=>OFs,WithAvailability:()=>NP,WithDescription:()=>tv,WithEncoding:()=>u3e,WithInline:()=>G6,WithName:()=>fD,WithNamespace:()=>jS,WithSdkGroupName:()=>PM,WithSdkMethodName:()=>jVr,WithSource:()=>eP,WithStatusCode:()=>byt,WithTitle:()=>AM,commons:()=>nTf,example:()=>iTf,finalIr:()=>aTf,parseIr:()=>oTf});var nTf={};ff(nTf,{BasicSecurityScheme:()=>CNs,BearerSecurityScheme:()=>INs,Encoding:()=>ENs,HeaderSecurityScheme:()=>MNs,Namespace:()=>qNs,NamespaceId:()=>xNs,OauthSecurityScheme:()=>NNs,OpenApiSource:()=>ANs,ProtobufEncoding:()=>jNs,ProtobufSource:()=>PNs,QuerySecurityScheme:()=>BNs,SchemaId:()=>fIe,SdkGroup:()=>RNs,SdkGroupName:()=>u7i,SecurityScheme:()=>FNs,SecuritySchemeId:()=>Ano,Server:()=>XXo,Source:()=>wNs,StatusCode:()=>wVr,Tag:()=>DNs,TagId:()=>dIe,WithAvailability:()=>NP,WithDescription:()=>tv,WithEncoding:()=>u3e,WithInline:()=>G6,WithName:()=>fD,WithNamespace:()=>jS,WithSdkGroupName:()=>PM,WithSdkMethodName:()=>jVr,WithSource:()=>eP,WithStatusCode:()=>byt,WithTitle:()=>AM});var Gr={};ff(Gr,{JsonError:()=>gno,ParseError:()=>mno,any:()=>TGy,bigint:()=>mGy,boolean:()=>qGy,booleanLiteral:()=>BGy,date:()=>OGy,discriminant:()=>VGy,enum_:()=>gNs,getObjectLikeUtils:()=>Iqr,getObjectUtils:()=>cfa,getSchemaUtils:()=>b5,isProperty:()=>a7i,lazy:()=>AGy,lazyObject:()=>CGy,list:()=>ONs,number:()=>RGy,object:()=>mNs,objectWithoutOptionalProperties:()=>DGy,optional:()=>kBf,property:()=>wGy,record:()=>zGy,set:()=>QGy,string:()=>NGy,stringLiteral:()=>MGy,transform:()=>eTf,undiscriminatedUnion:()=>UGy,union:()=>HGy,unknown:()=>FGy,withParsedProperties:()=>rTf});var Aq={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 K2(e,t){return`Expected ${t}. Received ${i9C(e)}.`}function i9C(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 $de(e){return{...e,json:gGy(e.json),parse:gGy(e.parse)}}function gGy(e){return(t,r)=>{let n=e(t,r),{skipValidation:i=!1}=r??{};return!n.ok&&i?(console.warn(["Failed to validate.",...n.errors.map(a=>" - "+(a.path.length>0?`${a.path.join(".")}: ${a.message}`:a.message))].join(`
|